[llvm] [SCEV] Generalize (C * A /u C) -> A fold to (C1 * A /u C2) -> C1/C2 * A. (PR #157159)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 9 02:49:22 PDT 2025
================
@@ -3216,13 +3216,16 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
};
}
- // Try to fold (C * D /u C) -> D, if C is a power-of-2 and D is a multiple
- // of C.
+ // Try to fold (C1 * D /u C2) -> C1/C2 * D, if C1 and C2 are powers-of-2,
+ // D is a multiple of C2, and C1 is a multiple of C1.
----------------
nikic wrote:
Should probably say C1 is a multiple of C2?
https://github.com/llvm/llvm-project/pull/157159
More information about the llvm-commits
mailing list