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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 13:39:46 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() &&
----------------
fhahn wrote:

Yep, done now. I guess this code be done separately as NFC, if preferred.

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


More information about the llvm-commits mailing list