[Mlir-commits] [mlir] [mlir][scf] Add parallelLoopUnrollByFactors() (PR #163806)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Fri Oct 24 01:31:07 PDT 2025
================
@@ -0,0 +1,148 @@
+// RUN: mlir-opt %s -test-parallel-loop-unrolling='unroll-factors=1,2' -split-input-file | FileCheck %s
+// RUN: mlir-opt %s -test-parallel-loop-unrolling='unroll-factors=1,2 loop-depth=1' -split-input-file | FileCheck %s --check-prefix CHECK-UNROLL-INNER
+// RUN: mlir-opt %s -test-parallel-loop-unrolling='unroll-factors=3,1' -split-input-file | FileCheck %s --check-prefix CHECK-UNROLL-BY-3
+
+func.func @unroll_simple_parallel_loop(%arg0: memref<1x16x12xf32>, %arg1: memref<1x16x12xf32>) {
+ %c12 = arith.constant 12 : index
+ %c16 = arith.constant 16 : index
+ %c0 = arith.constant 0 : index
+ %c1 = arith.constant 1 : index
+ scf.parallel (%arg2, %arg3, %arg4) = (%c0, %c0, %c0) to (%c1, %c16, %c12) step (%c1, %c1, %c1) {
----------------
banach-space wrote:
> mlir-opt will rename al the variable names to %arg0, %arg1
Indeed, we are not in control of what `mlir-opt` does with names. So, even `%arg2`, `%arg3`, can (and probably will) be replaced with `%arg0`, `%arg2`. For this reason, we should optimise for what makes parsing _for humans_ easier.
https://github.com/llvm/llvm-project/pull/163806
More information about the Mlir-commits
mailing list