aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-02-27 19:53:45 +0000
committerCraig Topper <craig.topper@intel.com>2018-02-27 19:53:45 +0000
commit301991080e24ac402793ca6684daa2fc70647f8a (patch)
tree50631586f141be7472fc4d34a5dccad86f6338b7 /llvm/lib/Analysis/ValueTracking.cpp
parent308e27ee9df861a219f62acb5452969fd161cecc (diff)
downloadllvm-301991080e24ac402793ca6684daa2fc70647f8a.zip
llvm-301991080e24ac402793ca6684daa2fc70647f8a.tar.gz
llvm-301991080e24ac402793ca6684daa2fc70647f8a.tar.bz2
[ValueTracking] Teach cannotBeOrderedLessThanZeroImpl to look through ExtractElement.
This is similar to what's done in computeKnownBits and computeSignBits. Don't do anything fancy just collect information valid for any element. Differential Revision: https://reviews.llvm.org/D43789 llvm-svn: 326237
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index a1ec9df..31cb63d 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2783,6 +2783,12 @@ static bool cannotBeOrderedLessThanZeroImpl(const Value *V,
// Widening/narrowing never change sign.
return cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, SignBitOnly,
Depth + 1);
+ case Instruction::ExtractElement:
+ // Look through extract element. At the moment we keep this simple and skip
+ // tracking the specific element. But at least we might find information
+ // valid for all elements of the vector.
+ return cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, SignBitOnly,
+ Depth + 1);
case Instruction::Call:
const auto *CI = cast<CallInst>(I);
Intrinsic::ID IID = getIntrinsicForCallSite(CI, TLI);