diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-05-29 00:31:18 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-05-29 00:31:18 +0000 |
commit | 70c2bbd29c71c0d35bd09c89f4d2f0af4991b6d3 (patch) | |
tree | ddcd213be99d590328bf7b41d62bc818fd68c259 /llvm/lib/Analysis | |
parent | 484b5ab39d20586e1d554adf5b38c08b43c98dec (diff) | |
download | bcm5719-llvm-70c2bbd29c71c0d35bd09c89f4d2f0af4991b6d3.tar.gz bcm5719-llvm-70c2bbd29c71c0d35bd09c89f4d2f0af4991b6d3.zip |
[ValueTracking] ICmp instructions propagate poison
This is a stripped down version of D19211, leaving out the questionable
"branching in poison is UB" bit.
llvm-svn: 271150
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 8a0695c325d..58f6cd187dd 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -3477,6 +3477,11 @@ bool llvm::propagatesFullPoison(const Instruction *I) { return false; } + case Instruction::ICmp: + // Comparing poison with any value yields poison. This is why, for + // instance, x s< (x +nsw 1) can be folded to true. + return true; + case Instruction::GetElementPtr: // A GEP implicitly represents a sequence of additions, subtractions, // truncations, sign extensions and multiplications. The multiplications |