[Mlir-commits] [mlir] [mlir][index][spirv] Add conversion for index to spirv (PR #68085)

Finn Plummer llvmlistbot at llvm.org
Tue Oct 3 03:28:32 PDT 2023


================
@@ -693,6 +693,8 @@ SPIRVTypeConverter::SPIRVTypeConverter(spirv::TargetEnvAttr targetAttr,
   addConversion([this](IndexType /*indexType*/) { return getIndexType(); });
 
   addConversion([this](IntegerType intType) -> std::optional<Type> {
+    if (!this->options.convertIntAsScalar)
----------------
inbelic wrote:

The use of this hidden option is currently a hack solution, as when we pass in the integer type we fail the linked check, which will then cause us to return a `nullptr`. Proper implementation would presumably ensure that we are passing the compatibility and extension requirements. So hints for how to solve this are needed.

https://github.com/llvm/llvm-project/blame/77c43e14897a404fbf4a132a1a75d49ba2ec08c1/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp#L232-L235.

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


More information about the Mlir-commits mailing list