[Mlir-commits] [mlir] [mlir][spirv] Add tests for `scf.while` and `scf.for` in `convert-to-spirv` pass (PR #102528)

Jakub Kuderski llvmlistbot at llvm.org
Fri Aug 9 21:27:28 PDT 2024


================
@@ -45,3 +56,30 @@ func.func @while(%arg0: i32, %arg1: i32) -> i32 {
   }
   return %0 : i32
 }
+
+// CHECK-LABEL: @for
+// CHECK:       spirv.mlir.loop {
+// CHECK:         spirv.Branch ^[[HEADER:.*]](%{{.*}}, %{{.*}}, %{{.*}} : i32, f32, f32)
+// CHECK:       ^[[HEADER]]
+// CHECK:         spirv.BranchConditional %{{.*}}, ^[[BODY:.*]], ^[[MERGE:.*]]
+// CHECK:       ^[[BODY]]
+// CHECK-DAG:     spirv.Store "Function"
+// CHECK-DAG:     spirv.Store "Function"
+// CHECK:       spirv.Branch ^[[HEADER]]
+// CHECK:       ^[[MERGE]]
+// CHECK:         spirv.mlir.merge
+// CHECK:      }
+// CHECK-DAG:  spirv.Load "Function"
+// CHECK-DAG:  spirv.Load "Function"
----------------
kuhar wrote:

Same here

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


More information about the Mlir-commits mailing list