diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-09-08 16:54:02 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-09-08 16:54:02 +0000 |
commit | 1c608f432318a040514be17c528b97ea0626a02f (patch) | |
tree | e389758426e0256523fa161a2856f5a243f9a429 | |
parent | ebb715b119d241f97e24284f0d1c4afd584bf146 (diff) | |
download | bcm5719-llvm-1c608f432318a040514be17c528b97ea0626a02f.tar.gz bcm5719-llvm-1c608f432318a040514be17c528b97ea0626a02f.zip |
[InstCombine] return a vector-safe true/false constant
I introduced this potential bug by missing this diff in:
https://reviews.llvm.org/rL280873
...however, I'm not sure how to reach this code path with a regression test.
We may be able to remove this code and assume that the transform to a constant
is always handled by InstSimplify?
llvm-svn: 280964
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 527ca038d06..c8e0b332215 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -1431,9 +1431,9 @@ Instruction *InstCombiner::foldICmpAndShift(ICmpInst &Cmp, BinaryOperator *And, // special case, check to see if this means that the result is always // true or false now. if (Cmp.getPredicate() == ICmpInst::ICMP_EQ) - return replaceInstUsesWith(Cmp, Builder->getFalse()); + return replaceInstUsesWith(Cmp, ConstantInt::getFalse(Cmp.getType())); if (Cmp.getPredicate() == ICmpInst::ICMP_NE) - return replaceInstUsesWith(Cmp, Builder->getTrue()); + return replaceInstUsesWith(Cmp, ConstantInt::getTrue(Cmp.getType())); } else { Cmp.setOperand(1, ConstantInt::get(And->getType(), NewCst)); APInt NewAndCst = IsShl ? C2->lshr(*C3) : C2->shl(*C3); |