[Mlir-commits] [mlir] [mlir][SPIRV] Add `spirv.vce` when create `spirv.module` in GPUToSPIRV (PR #147267)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jul 7 02:56:34 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Jaeho Kim (oojahooo)
<details>
<summary>Changes</summary>
In GPUToSPIRV conversion, we can pass the `spirv.vce` triple obtained from `spirv.target_env` when creating a `spirv.module` in `GPUModuleConversion::matchAndRewrite` because `spirv.target_env` must derived by executing `lookupTargetEnvOrDefault`
---
Full diff: https://github.com/llvm/llvm-project/pull/147267.diff
1 Files Affected:
- (modified) mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp (+2-2)
``````````diff
diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
index b99ed261ecfa3..9c9afef8c226f 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
@@ -368,8 +368,8 @@ LogicalResult GPUModuleConversion::matchAndRewrite(
// Add a keyword to the module name to avoid symbolic conflict.
std::string spvModuleName = (kSPIRVModule + moduleOp.getName()).str();
auto spvModule = rewriter.create<spirv::ModuleOp>(
- moduleOp.getLoc(), addressingModel, *memoryModel, std::nullopt,
- StringRef(spvModuleName));
+ moduleOp.getLoc(), addressingModel, *memoryModel,
+ targetEnv.getAttr().getTripleAttr(), StringRef(spvModuleName));
// Move the region from the module op into the SPIR-V module.
Region &spvModuleRegion = spvModule.getRegion();
``````````
</details>
https://github.com/llvm/llvm-project/pull/147267
More information about the Mlir-commits
mailing list