[PATCH] D145230: [ScalarEvolution] Apply loop guards against min/max for its arguments
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 5 21:19:04 PST 2023
mkazantsev added inline comments.
================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:15096-15099
- case CmpInst::ICMP_UGT:
- RewrittenRHS =
- getUMaxExpr(RewrittenLHS, getAddExpr(RHS, getOne(RHS->getType())));
break;
----------------
I propose refactoring like:
```
case CmpInst::ICMP_UGT:
RHS = RHS - 1;
LLVM_FALLTHROUGH;
case CmpInst::ICMP_UGE:
RewrittenRHS = getUMaxExpr(RewrittenLHS, RHS);
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145230/new/
https://reviews.llvm.org/D145230
More information about the llvm-commits
mailing list