]> granicus.if.org Git - llvm/commitdiff
[JumpThreading] When processing compares, explicitly check that the result type is...
authorCraig Topper <craig.topper@gmail.com>
Thu, 4 May 2017 21:45:49 +0000 (21:45 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 4 May 2017 21:45:49 +0000 (21:45 +0000)
Compares always return a scalar integer or vector of integers. isIntegerTy returns false for vectors, but that's not completely obvious. So using isVectorTy is less confusing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302198 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/JumpThreading.cpp

index c7ac955cde0ba09c693c209f0a645a878d1c819d..ae353ea4459576897cf5cc16e068d7620e8225ab 100644 (file)
@@ -580,7 +580,7 @@ bool JumpThreadingPass::ComputeValueKnownInPredecessors(
 
     // If comparing a live-in value against a constant, see if we know the
     // live-in value on any predecessors.
-    if (isa<Constant>(Cmp->getOperand(1)) && Cmp->getType()->isIntegerTy()) {
+    if (isa<Constant>(Cmp->getOperand(1)) && !Cmp->getType()->isVectorTy()) {
       Constant *CmpConst = cast<Constant>(Cmp->getOperand(1));
 
       if (!isa<Instruction>(Cmp->getOperand(0)) ||