[llvm] [AMDGPU] Enable "amdgpu-sw-lower-lds" pass in pipeline. (PR #89206)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 03:34:36 PDT 2024


https://github.com/skc7 created https://github.com/llvm/llvm-project/pull/89206

If AddressSanitizer feature is enabled, 
"amdgpu-sw-lower-lds" pass will be enabled in the pipeline,
"amdgpu-lower-module-lds" pass will be disabled with this PR.

>From 901d8a0ca79ca0445762907bab2c2f648c73899b Mon Sep 17 00:00:00 2001
From: skc7 <Krishna.Sankisa at amd.com>
Date: Thu, 18 Apr 2024 15:58:10 +0530
Subject: [PATCH] [AMDGPU] Enable amdgpu-sw-lower-lds pass in pipeline.

---
 llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 5 +++++
 1 file changed, 5 insertions(+)

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(



More information about the llvm-commits mailing list