[Mlir-commits] [mlir] [mlir][affine]make affine-loop-unroll a FunctionOpInterface pass. (PR #126475)
Kunwar Grover
llvmlistbot at llvm.org
Wed Feb 12 18:09:16 PST 2025
================
@@ -240,6 +240,23 @@ func.func @loop_nest_unroll_full() {
return
} // UNROLL-FULL }
+gpu.module @unroll_full {
+ // UNROLL-FULL-LABEL: func @gpu_loop_nest_simplest() {
+ gpu.func @gpu_loop_nest_simplest() {
+ // UNROLL-FULL: affine.for %arg0 = 0 to 100 step 2 {
+ affine.for %i = 0 to 100 step 2 {
+ // UNROLL-FULL: %c1_i32 = arith.constant 1 : i32
+ // UNROLL-FULL-NEXT: %c1_i32_0 = arith.constant 1 : i32
+ // UNROLL-FULL-NEXT: %c1_i32_1 = arith.constant 1 : i32
+ // UNROLL-FULL-NEXT: %c1_i32_2 = arith.constant 1 : i32
+ affine.for %j = 0 to 4 {
+ %x = arith.constant 1 : i32
+ }
+ } // UNROLL-FULL: }
+ gpu.return // UNROLL-FULL: return
+ }
+}
+
----------------
Groverkss wrote:
I don't think we need a test enumerated for every gpu.func case... The functionality is same, just add one simple test. Having a minimal set of tests is important.
https://github.com/llvm/llvm-project/pull/126475
More information about the Mlir-commits
mailing list