aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
diff options
context:
space:
mode:
authorJon Chesterfield <jonathanchesterfield@gmail.com>2024-08-28 18:30:48 +0100
committerGitHub <noreply@github.com>2024-08-28 18:30:48 +0100
commit1bde8e0b80860743fcd55da28f0ba9acb7a26a9c (patch)
tree171544f8ee2340a60d2c42ff83caf45b9bec114e /llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
parentb40677ccf871c5e514aa824d187350f9279c6c1c (diff)
downloadllvm-1bde8e0b80860743fcd55da28f0ba9acb7a26a9c.zip
llvm-1bde8e0b80860743fcd55da28f0ba9acb7a26a9c.tar.gz
llvm-1bde8e0b80860743fcd55da28f0ba9acb7a26a9c.tar.bz2
[AMDGPU] Don't realign already allocated LDS. Point fix for 106412 (#106421)
Fixes 106412. The logic that skips the pass on already-lowered variables doesn't cover the path that increases alignment of variables. If a variable is allocated at 24 and then given 16 byte alignment, the backend notices and fatal-errors on the inconsistency.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
index 92b42e2..38f0b6d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
@@ -1131,6 +1131,11 @@ private:
continue;
}
+ if (GV.isAbsoluteSymbolRef()) {
+ // If the variable is already allocated, don't change the alignment
+ continue;
+ }
+
Align Alignment = AMDGPU::getAlign(DL, &GV);
TypeSize GVSize = DL.getTypeAllocSize(GV.getValueType());