-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AMDGPU] Enable "amdgpu-sw-lower-lds" pass in pipeline. #89206
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
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Chaitanya (skc7) ChangesIf AddressSanitizer feature is enabled, Full diff: https://github.com/llvm/llvm-project/pull/89206.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 305a6c8c3b9262..7684cf8f15b59c 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -676,6 +676,11 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks(
if (EarlyInlineAll && !EnableFunctionCalls)
PM.addPass(AMDGPUAlwaysInlinePass());
+
+#if __has_feature(address_sanitizer)
+ EnableLowerModuleLDS = false;
+ PM.addPass(AMDGPUSwLowerLDSPass());
+#endif
});
PB.registerPeepholeEPCallback(
|
@@ -676,6 +676,11 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks( | |||
|
|||
if (EarlyInlineAll && !EnableFunctionCalls) | |||
PM.addPass(AMDGPUAlwaysInlinePass()); | |||
|
|||
#if __has_feature(address_sanitizer) |
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.
The host compiler cannot matter here.
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.
Have made changes to #87265 pass to process only functions which have "sanitize_address" attribute. Will be remove this __has_feature check.
@@ -676,6 +676,11 @@ void AMDGPUTargetMachine::registerPassBuilderCallbacks( | |||
|
|||
if (EarlyInlineAll && !EnableFunctionCalls) | |||
PM.addPass(AMDGPUAlwaysInlinePass()); | |||
|
|||
#if __has_feature(address_sanitizer) | |||
EnableLowerModuleLDS = false; |
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.
You should not be changing the values of global options
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.
With ASAN enabled, #87265 will now lower the LDS. I want to disable "lower-module-lds" pass when lowering is done by the new pass.
Could you please suggest any other way of disabling the "lower-module-lds" pass instead of setting EnableLowerModuleLDS to false?
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.
If you run the asan lowering, the LDS variables cease to exist. LowerModuleLDS can then run after and naturally no-op. You shouldn't need to disable anything
1ec0c19
to
4647b8a
Compare
4647b8a
to
8389b23
Compare
static cl::opt<bool> EnableSwLowerLDS("amdgpu-enable-sw-lower-lds", | ||
cl::desc("Enable sw lower lds pass"), | ||
cl::init(true), cl::Hidden); |
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.
The name is misleading now that it's not a software lowering pass. At least the description should mention sanitizers?
8389b23
to
616df88
Compare
616df88
to
c6bf7ac
Compare
This PR enables "amdgpu-sw-lower-lds" pass in the pipeline.
Also introduces "amdgpu-enable-sw-lower-lds" cmd line flag to enbale/disable the pass.
This PR will be merged once PR #87265 is merged.