diff options
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
| -rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 37a7259a5cd0..53a974c5294c 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -3954,12 +3954,14 @@ static Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS, // LHS >s RHS. case ICmpInst::ICMP_SGT: case ICmpInst::ICMP_SGE: - return ConstantExpr::getICmp(ICmpInst::ICMP_SLT, C, - Constant::getNullValue(C->getType())); + return ConstantFoldCompareInstOperands( + ICmpInst::ICMP_SLT, C, Constant::getNullValue(C->getType()), + Q.DL); case ICmpInst::ICMP_SLT: case ICmpInst::ICMP_SLE: - return ConstantExpr::getICmp(ICmpInst::ICMP_SGE, C, - Constant::getNullValue(C->getType())); + return ConstantFoldCompareInstOperands( + ICmpInst::ICMP_SGE, C, Constant::getNullValue(C->getType()), + Q.DL); // If LHS is non-negative then LHS <u RHS. If LHS is negative then // LHS >u RHS. @@ -5346,9 +5348,6 @@ static Value *foldIdentityShuffles(int DestElt, Value *Op0, Value *Op1, SourceShuf->getMaskValue(RootElt), RootVec, MaxRecurse); } - // TODO: Look through bitcasts? What if the bitcast changes the vector element - // size? - // The source operand is not a shuffle. Initialize the root vector value for // this shuffle if that has not been done yet. if (!RootVec) |
