summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-05-17 20:20:40 +0000
committerSanjay Patel <spatel@rotateright.com>2016-05-17 20:20:40 +0000
commit22b01febd4a92a0f38febf5aec6cf4e0de04fd8d (patch)
tree0788e593b94fb0ae9bd8516e3d39c678a0ae095e /llvm/lib
parent12de0b91ac1f585ed7d11a25fc7cb841a1826aa3 (diff)
downloadbcm5719-llvm-22b01febd4a92a0f38febf5aec6cf4e0de04fd8d.tar.gz
bcm5719-llvm-22b01febd4a92a0f38febf5aec6cf4e0de04fd8d.zip
[InstCombine] add another test for wrong icmp constant (PR27792)
It doesn't matter if the comparison is unsigned; the inc/dec is always signed. llvm-svn: 269831
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index f51cf7321f2..6a38baefe5a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -3150,7 +3150,7 @@ static ICmpInst *canonicalizeCmpWithConstant(ICmpInst &I) {
// Increment or decrement the constant and set the new comparison predicate:
// ULE -> ULT ; UGE -> UGT ; SLE -> SLT ; SGE -> SGT
- Constant *OneOrNegOne = ConstantInt::get(Op1Type, IsLE ? 1 : -1, IsSigned);
+ Constant *OneOrNegOne = ConstantInt::get(Op1Type, IsLE ? 1 : -1, true);
CmpInst::Predicate NewPred = IsLE ? ICmpInst::ICMP_ULT: ICmpInst::ICMP_UGT;
NewPred = IsSigned ? ICmpInst::getSignedPredicate(NewPred) : NewPred;
return new ICmpInst(NewPred, Op0, ConstantExpr::getAdd(Op1C, OneOrNegOne));
OpenPOWER on IntegriCloud