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

Hongtao Yu llvmlistbot at llvm.org
Tue Aug 27 16:19:13 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>(
----------------
htyu wrote:

It seems that `ConstantIntOp` cannot take index type.

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


More information about the Mlir-commits mailing list