summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-07-21 06:43:38 +0000
committerCraig Topper <craig.topper@intel.com>2019-07-21 06:43:38 +0000
commit1d149d08d3aeed65d5b10ee2e84c72e661122344 (patch)
treece6202caf5b674c33c4e14f185537bba0b65ae88
parent8fabdfe9fcd2927a0a7cbdf3a15c7cf9b7a52019 (diff)
downloadbcm5719-llvm-1d149d08d3aeed65d5b10ee2e84c72e661122344.tar.gz
bcm5719-llvm-1d149d08d3aeed65d5b10ee2e84c72e661122344.zip
[InstCombine] Remove insertRangeTest code that handles the equality case.
For equality, the function called getTrue/getFalse with the VT of the comparison input. But getTrue/getFalse need the boolean VT. So if this code ever executed, it would assert. I believe these cases are removed by InstSimplify so we don't get here. So this patch just fixes up an assert to exclude the equality possibility and removes the broken code. llvm-svn: 366649
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index fd53c67b47f..1a7a25b21c3 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -164,12 +164,10 @@ Instruction *InstCombiner::OptAndOp(BinaryOperator *Op,
/// whether to treat V, Lo, and Hi as signed or not.
Value *InstCombiner::insertRangeTest(Value *V, const APInt &Lo, const APInt &Hi,
bool isSigned, bool Inside) {
- assert((isSigned ? Lo.sle(Hi) : Lo.ule(Hi)) &&
- "Lo is not <= Hi in range emission code!");
+ assert((isSigned ? Lo.slt(Hi) : Lo.ult(Hi)) &&
+ "Lo is not < Hi in range emission code!");
Type *Ty = V->getType();
- if (Lo == Hi)
- return Inside ? ConstantInt::getFalse(Ty) : ConstantInt::getTrue(Ty);
// V >= Min && V < Hi --> V < Hi
// V < Min || V >= Hi --> V >= Hi
OpenPOWER on IntegriCloud