summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-07 07:40:29 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-07 07:40:29 +0000
commit29c282eac8840e461d14c157fd3529e2adb513e9 (patch)
treecab64fbbe7b922504570f1e2825266bb0aeb3c5b /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
parent1cbc801dd6ca526da9352a9e0b5bd559f0289f4c (diff)
downloadbcm5719-llvm-29c282eac8840e461d14c157fd3529e2adb513e9.tar.gz
bcm5719-llvm-29c282eac8840e461d14c157fd3529e2adb513e9.zip
[InstCombine] Fix two asserts that were accidentally checking that an APInt pointer is non-zero instead of checking that the APInt self is non-zero.
I believe this code used to use APInt references which would have worked. But then they were changed to pointers to allow m_APInt to be used. llvm-svn: 304875
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index c0798e164c3..91dc4ff1a65 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2127,7 +2127,7 @@ Instruction *InstCombiner::foldICmpUDivConstant(ICmpInst &Cmp,
if (!match(UDiv->getOperand(0), m_APInt(C2)))
return nullptr;
- assert(C2 != 0 && "udiv 0, X should have been simplified already.");
+ assert(*C2 != 0 && "udiv 0, X should have been simplified already.");
// (icmp ugt (udiv C2, Y), C) -> (icmp ule Y, C2/(C+1))
Value *Y = UDiv->getOperand(1);
@@ -2140,7 +2140,7 @@ Instruction *InstCombiner::foldICmpUDivConstant(ICmpInst &Cmp,
// (icmp ult (udiv C2, Y), C) -> (icmp ugt Y, C2/C)
if (Cmp.getPredicate() == ICmpInst::ICMP_ULT) {
- assert(C != 0 && "icmp ult X, 0 should have been simplified already.");
+ assert(*C != 0 && "icmp ult X, 0 should have been simplified already.");
return new ICmpInst(ICmpInst::ICMP_UGT, Y,
ConstantInt::get(Y->getType(), C2->udiv(*C)));
}
OpenPOWER on IntegriCloud