[Mlir-commits] [mlir] [MLIR][GPUToLLVMSPV] Update ConvertGpuOpsToLLVMSPVOps's option (PR #118818)

Jefferson Le Quellec llvmlistbot at llvm.org
Wed Dec 11 01:51:29 PST 2024


================
@@ -553,9 +553,9 @@ def ConvertGpuOpsToLLVMSPVOps : Pass<"convert-gpu-to-llvm-spv", "gpu::GPUModuleO
     "Generate LLVM operations to be ingested by a SPIR-V backend for gpu operations";
   let dependentDialects = ["LLVM::LLVMDialect"];
   let options = [
-    Option<"indexBitwidth", "index-bitwidth", "unsigned",
-           /*default=kDeriveIndexBitwidthFromDataLayout*/"0",
-           "Bitwidth of the index type, 0 to use size of machine word">,
+    Option<"use64bitIndex", "use-64bit-index",
+           "bool", /*default=*/"false",
+           "Use 64-bit integers to convert index types">,
----------------
jle-quel wrote:

Thanks for the feedback!

I understand your reasoning for preferring an **enum** to make the supported options more explicit. However, the related passes—such as `convert-gpu-to-spirv`, `convert-index-to-spirv`, and `convert-memref-to-spirv`—already use this boolean option to toggle between **32-bit** and **64-bit** indices.

To maintain consistency across these conversion passes, would it be better to keep this option as a **boolean** as well? This ensures uniformity and avoids introducing a different style of option specification in a single pass.

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


More information about the Mlir-commits mailing list