mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-07 12:30:57 +00:00
fix an oversight caught by Frits!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122204 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
48461f6da3
commit
f2a97ed13d
@ -1151,9 +1151,10 @@ Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) {
|
||||
// If the normal result of the add is dead, and the RHS is a constant,
|
||||
// we can transform this into a range comparison.
|
||||
// overflow = uadd a, -4 --> overflow = icmp ugt a, 3
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(II->getArgOperand(1)))
|
||||
return new ICmpInst(ICmpInst::ICMP_UGT, II->getArgOperand(0),
|
||||
ConstantExpr::getNot(CI));
|
||||
if (II->getIntrinsicID() == Intrinsic::uadd_with_overflow)
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(II->getArgOperand(1)))
|
||||
return new ICmpInst(ICmpInst::ICMP_UGT, II->getArgOperand(0),
|
||||
ConstantExpr::getNot(CI));
|
||||
break;
|
||||
case Intrinsic::usub_with_overflow:
|
||||
case Intrinsic::ssub_with_overflow:
|
||||
|
Loading…
Reference in New Issue
Block a user