[flang-commits] [flang] [MLIR] SPIRV Target Attribute (PR #69949)

Sang Ik Lee via flang-commits flang-commits at lists.llvm.org
Mon Oct 30 14:21:47 PDT 2023


================
@@ -188,4 +188,46 @@ def GpuROCDLAttachTarget: Pass<"rocdl-attach-target", ""> {
   ];
 }
 
+def GpuSPIRVAttachTarget: Pass<"spirv-attach-target", ""> {
+  let summary = "Attaches an SPIRV target attribute to a GPU Module.";
+  let description = [{
+    This pass searches for all GPU Modules in the immediate regions and attaches
+    an SPIRV target if the module matches the name specified by the `module` argument.
+
+    Example:
+    ```
+    // File: in1.mlir:
+    gpu.module @nvvm_module_1 {...}
+    gpu.module @spirv_module_1 {...}
+    // mlir-opt --spirv-attach-target="module=spirv.* ver=v1.0 caps=Kernel" in1.mlir
----------------
silee2 wrote:

Done.

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


More information about the flang-commits mailing list