Skip to content

Commit

Permalink
[JumpThreading] When processing compares, explicitly check that the r…
Browse files Browse the repository at this point in the history
…esult 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302198 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed May 4, 2017
1 parent 0e59845 commit 195a2d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Transforms/Scalar/JumpThreading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) ||
Expand Down

0 comments on commit 195a2d9

Please sign in to comment.