From 63960e79e16bc96aadd1e00a28f4387631728154 Mon Sep 17 00:00:00 2001 From: oojahooo Date: Mon, 7 Jul 2025 18:52:50 +0900 Subject: [PATCH] [mlir][SPIRV] Add `spirv.vce` when create `spirv.module` in GPUToSPIRV In GPUToSPIRV conversion, pass the `spirv.vce` triple obtained from `spirv.target_env` when creating a `spirv.module` in `GPUModuleConversion::matchAndRewrite` --- mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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( - 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();