[Mlir-commits] [mlir] [MLIR][SPIRV] Add conversion for spirv.SpecConstant and spirv.mlir.referenceof to LLVM (PR #188746)

Mehdi Amini llvmlistbot at llvm.org
Mon Apr 13 04:21:08 PDT 2026


joker-eph wrote:

@IgWod : yes this would probably be better (to more faithfully target the LLVM SPIRV backend), but for just general lowering to LLVM I would think this lowering would work?

The problem of the intrinsics you mention is two-fold I think:

1) It will only work when targeting the SPIRV backend, while the SPIRV-to-LLVM lowering in MLIR is (also) intended to support running on a LLVM CPU backend (for example)
2) The intrinsics support is incomplete in LLVM:

```
  def int_spv_named_boolean_spec_constant
      : Intrinsic<[llvm_i1_ty], [llvm_i32_ty, llvm_i1_ty, llvm_metadata_ty],
                  [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<1>>]>;
  // TODO: possibly add intrinsics for other types of Spec Constants and a
  //       corresponding Clang builtin.
```



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


More information about the Mlir-commits mailing list