[Mlir-commits] [mlir] [mlir][scf] Allow unrolling loops with integer-typed IV. (PR #106164)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue Aug 27 10:28:06 PDT 2024


================
@@ -264,11 +264,13 @@ bool mlir::getInnermostParallelLoops(Operation *rootOp,
 static Value ceilDivPositive(OpBuilder &builder, Location loc, Value dividend,
                              int64_t divisor) {
   assert(divisor > 0 && "expected positive divisor");
-  assert(dividend.getType().isIndex() && "expected index-typed value");
+  assert(dividend.getType().isIntOrIndex() &&
+         "expected integer or index-typed value");
 
-  Value divisorMinusOneCst =
-      builder.create<arith::ConstantIndexOp>(loc, divisor - 1);
-  Value divisorCst = builder.create<arith::ConstantIndexOp>(loc, divisor);
+  Value divisorMinusOneCst = builder.create<arith::ConstantOp>(
----------------
ftynse wrote:

Nit: we also have a `ConstantIntOp` specialization that will make this slightly less verbose.

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


More information about the Mlir-commits mailing list