Skip to content

Add an option to convert to spirv friendly dielect #741

@robertoraggi

Description

@robertoraggi

cxx lowers directly to the llvm dialect, but maybe we can get spirv and gpu support by lowering also to other core dialects.

mlir-opt --help|grep spirv
      --convert-arith-to-spirv                               -   Convert Arith dialect to SPIR-V dialect
      --convert-cf-to-spirv                                  -   Convert ControlFlow dialect to SPIR-V dialect
      --convert-complex-to-spirv                             -   Convert Complex dialect to SPIRV dialect
      --convert-func-to-spirv                                -   Convert Func dialect to SPIR-V dialect
      --convert-gpu-to-spirv                                 -   Convert GPU dialect to SPIR-V dialect
      --convert-index-to-spirv                               -   Lower the `index` dialect to the `spirv` dialect.
      --convert-math-to-spirv                                -   Convert Math dialect to SPIR-V dialect
      --convert-memref-to-spirv                              -   Convert MemRef dialect to SPIR-V dialect
      --convert-scf-to-spirv                                 -   Convert SCF dialect to SPIR-V dialect.
      --convert-spirv-to-llvm                                -   Convert SPIR-V dialect to LLVM dialect
      --convert-tensor-to-spirv                              -   Convert Tensor dialect to SPIR-V dialect
      --convert-ub-to-spirv                                  -   Convert UB dialect to SPIR-V dialect
      --convert-vector-to-spirv                              -   Convert Vector dialect to SPIR-V dialect
      --decorate-spirv-composite-type-layout                 -   Decorate SPIR-V composite type with layout info
      --map-memref-spirv-storage-class                       -   Map numeric MemRef memory spaces to SPIR-V storage classes
      --spirv-attach-target                                  -   Attaches an SPIR-V target attribute to a GPU Module.
      --spirv-canonicalize-gl                                -   Canonicalize GLSL ops
      --spirv-lower-abi-attrs                                -   Decorate SPIR-V composite type with layout info
      --spirv-rewrite-inserts                                -   Rewrite sequential chains of `spirv.CompositeInsert` operations into `spirv.CompositeConstruct` operations
      --spirv-unify-aliased-resource                         -   Unify access of multiple aliased resources into access of one single resource
      --spirv-update-vce                                     -   Deduce and attach minimal (version, capabilities, extensions) requirements to spirv.module ops
      --spirv-webgpu-prepare                                 -   Prepare SPIR-V to target WebGPU by expanding unsupported ops and replacing with supported ones
  --spirv-ext=<value>                                        - Specify list of enabled SPIR-V extensions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions