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

Angel Zhang llvmlistbot at llvm.org
Mon Aug 12 07:26:47 PDT 2024


================
@@ -33,6 +33,17 @@ func.func @if_yield(%arg0: i1) -> f32 {
 }
 
 // CHECK-LABEL: @while
+// CHECK:       spirv.mlir.loop {
+// CHECK:         spirv.Branch ^[[HEADER:.*]](%{{.*}} : i32)
+// CHECK:       ^[[HEADER]]
+// CHECK:         spirv.Store "Function"
+// CHECK:         spirv.BranchConditional %{{.*}}, ^[[BODY:.*]](%{{.*}} : i32), ^[[MERGE:.*]]
+// CHECK:       ^[[BODY]]
+// CHECK:       spirv.Branch
+// CHECK:       ^[[MERGE]]
+// CHECK:         spirv.mlir.merge
+// CHECK:       }
+// CHECK:       spirv.Load "Function"
----------------
angelz913 wrote:

Outside the `spirv.mlir.loop`, we should have a  `spirv.Load "Function"` to call the previously stored function.

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


More information about the Mlir-commits mailing list