[Mlir-commits] [mlir] [mlir][spirv] Add a generic `convert-to-spirv` pass (PR #95942)

Mehdi Amini llvmlistbot at llvm.org
Thu Aug 29 13:25:31 PDT 2024


================
@@ -31,6 +31,18 @@ def ConvertToLLVMPass : Pass<"convert-to-llvm"> {
   ];
 }
 
+//===----------------------------------------------------------------------===//
+// ToSPIRV
+//===----------------------------------------------------------------------===//
+
+def ConvertToSPIRVPass : Pass<"convert-to-spirv"> {
+  let summary = "Convert to SPIR-V";
+  let description = [{
+    This is a generic pass to convert to SPIR-V.
----------------
joker-eph wrote:

>  but the dependency on the spirv conversion code will have to move over there in some form.

Why would it have to be moved to the runner? The current pattern is that the transformations are made with `mlir-opt` ahead of invoking the runner (hence why we ended up with a "pure" `mlir-cpu-runner`).

> So we can drop the runner, but it will just make the situation worse).

I think we're talking about different things maybe?
You seem to argue about the need for running some of these tests, while I'm just describing the system architecture of the project, which does not impact in any way which tests we're running.

That is, from a very high-level, the specific runner tool goes away and you do instead something like `mlir-opt -pass-pipeline="builtin.module(convert-to-spirv)" %s | mlir-cpu-runner --shared-libs=mlir_vulkan_runtime.so`.
(this is a transition we made for the `mlir-cuda-runner` ~3 years ago, and the Vulkan runner has been a TODO ever since IIUC)

Note that in this model, the test pass is available for the opt tool, the runner does not need to know about the test passes (or any pass).


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


More information about the Mlir-commits mailing list