mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Another SCEV issue from PR2607; essentially the same issue, but this
time applying to the implicit comparison in smin expressions. The correct way to transform an inequality into the opposite inequality, either signed or unsigned, is with a not expression. I looked through the SCEV code, and I don't think there are any more occurrences of this issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1789,10 +1789,10 @@ SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) {
|
||||
if (LHS == U->getOperand(1) && RHS == U->getOperand(2))
|
||||
return SE.getSMaxExpr(getSCEV(LHS), getSCEV(RHS));
|
||||
else if (LHS == U->getOperand(2) && RHS == U->getOperand(1))
|
||||
// -smax(-x, -y) == smin(x, y).
|
||||
return SE.getNegativeSCEV(SE.getSMaxExpr(
|
||||
SE.getNegativeSCEV(getSCEV(LHS)),
|
||||
SE.getNegativeSCEV(getSCEV(RHS))));
|
||||
// ~smax(~x, ~y) == smin(x, y).
|
||||
return SE.getNotSCEV(SE.getSMaxExpr(
|
||||
SE.getNotSCEV(getSCEV(LHS)),
|
||||
SE.getNotSCEV(getSCEV(RHS))));
|
||||
break;
|
||||
case ICmpInst::ICMP_ULT:
|
||||
case ICmpInst::ICMP_ULE:
|
||||
|
Reference in New Issue
Block a user