[llvm] [SCEV] Preserve divisibility info when creating UMax/SMax expressions. (PR #160012)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 07:59:21 PDT 2025


================
@@ -15768,7 +15773,8 @@ void ScalarEvolution::LoopGuards::collectFromBlock(
     // Return true if Expr known to divide by \p DividesBy.
     std::function<bool(const SCEV *, const SCEV *&)> IsKnownToDivideBy =
         [&](const SCEV *Expr, const SCEV *DividesBy) {
-          if (SE.getURemExpr(Expr, DividesBy)->isZero())
+          if (Expr->getType()->isIntegerTy() &&
----------------
nikic wrote:

Why is this change necessary?

https://github.com/llvm/llvm-project/pull/160012


More information about the llvm-commits mailing list