aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-01-14 15:23:19 +0000
committerJames Molloy <james.molloy@arm.com>2016-01-14 15:23:19 +0000
commita9497f53c93aa3ab575b108e8cc353941e785063 (patch)
tree4bbf3b66b76972bc5f2d131970eed19db774f08d /llvm/lib/Transforms/Utils/Local.cpp
parentb28ae10a163e4be5ef4553987d6e0104b7f806bf (diff)
downloadllvm-a9497f53c93aa3ab575b108e8cc353941e785063.zip
llvm-a9497f53c93aa3ab575b108e8cc353941e785063.tar.gz
llvm-a9497f53c93aa3ab575b108e8cc353941e785063.tar.bz2
[ValueTracking] Understand more select patterns in ComputeKnownBits
Some patterns of select+compare allow us to know exactly the value of the uppermost bits in the select result. For example: %b = icmp ugt i32 %a, 5 %c = select i1 %b, i32 2, i32 %a Here we know that %c is bounded by 5, and therefore KnownZero = ~APInt(5).getActiveBits() = ~7. There are several such patterns, and this patch attempts to understand a reasonable subset of them - namely when the base values are the same (as above), and when they are related by a simple (add nsw), for example (add nsw %a, 4) and %a. llvm-svn: 257769
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
0 files changed, 0 insertions, 0 deletions