[llvm] [LV] Rewrite UDiv A, B -> UDiv A, UMax(B, 1) in trip counts if needed. (PR #92177)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 14:30:03 PDT 2024
================
@@ -4304,12 +4304,19 @@ ScalarEvolution::getSequentialMinMaxExpr(SCEVTypes Kind,
}
for (unsigned i = 1, e = Ops.size(); i != e; ++i) {
+ bool MayBeUB = SCEVExprContains(Ops[i], [](const SCEV *S) {
+ auto *UDiv = dyn_cast<SCEVUDivExpr>(S);
+ return UDiv && !isa<SCEVConstant>(UDiv->getOperand(1));
----------------
efriedma-quic wrote:
Need to check for zero constant, I think.
https://github.com/llvm/llvm-project/pull/92177
More information about the llvm-commits
mailing list