[llvm] r302198 - [JumpThreading] When processing compares, explicitly check that the result type is not a vector rather than check for it being an integer.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 14:45:50 PDT 2017


Author: ctopper
Date: Thu May  4 16:45:49 2017
New Revision: 302198

URL: http://llvm.org/viewvc/llvm-project?rev=302198&view=rev
Log:
[JumpThreading] When processing compares, explicitly check that the result type is not a vector rather than check for it being an integer.

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.

Modified:
    llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=302198&r1=302197&r2=302198&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu May  4 16:45:49 2017
@@ -580,7 +580,7 @@ bool JumpThreadingPass::ComputeValueKnow
 
     // 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)) ||




More information about the llvm-commits mailing list