[Mlir-commits] [mlir] Lower affine modulo by powers of two using bitwise AND (PR #146311)
Uday Bondhugula
llvmlistbot at llvm.org
Tue Oct 7 06:14:29 PDT 2025
================
@@ -80,12 +80,27 @@ class AffineApplyExpander
/// let remainder = srem a, b;
/// negative = a < 0 in
/// select negative, remainder + b, remainder.
+ ///
+ /// Special case for power of 2: use bitwise AND (x & (n-1)) for non-negative
----------------
bondhugula wrote:
power of 2 RHS
https://github.com/llvm/llvm-project/pull/146311
More information about the Mlir-commits
mailing list