-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[mlir][SPIRV] Add spirv.vce
when create spirv.module
in GPUToSPIRV
#147267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
In GPUToSPIRV conversion, pass the `spirv.vce` triple obtained from `spirv.target_env` when creating a `spirv.module` in `GPUModuleConversion::matchAndRewrite`
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-mlir-spirv @llvm/pr-subscribers-mlir Author: Jaeho Kim (oojahooo) ChangesIn GPUToSPIRV conversion, we can pass the Full diff: https://github.com/llvm/llvm-project/pull/147267.diff 1 Files Affected:
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();
|
@llvm/pr-subscribers-mlir-gpu Author: Jaeho Kim (oojahooo) ChangesIn GPUToSPIRV conversion, we can pass the Full diff: https://github.com/llvm/llvm-project/pull/147267.diff 1 Files Affected:
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();
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test?
In GPUToSPIRV conversion, we can pass the
spirv.vce
triple obtained fromspirv.target_env
when creating aspirv.module
inGPUModuleConversion::matchAndRewrite
becausespirv.target_env
must derived by executinglookupTargetEnvOrDefault