diff options
author | Pierre van Houtryve <pierre.vanhoutryve@amd.com> | 2025-05-15 09:54:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-15 09:54:21 +0200 |
commit | aa9f8596b01fef013ab62c20e61fc96d165f60f7 (patch) | |
tree | 5978fbec3e2d39d07552cbc12a1bac5b735cef25 /llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp | |
parent | 291fa641ec084ce32468d8a2a9205157d88b022d (diff) | |
download | llvm-aa9f8596b01fef013ab62c20e61fc96d165f60f7.zip llvm-aa9f8596b01fef013ab62c20e61fc96d165f60f7.tar.gz llvm-aa9f8596b01fef013ab62c20e61fc96d165f60f7.tar.bz2 |
[AMDGPU] Add flag to prevent reruns of LowerModuleLDS (#129520)
FullLTO has to run this early before module splitting occurs otherwise
module splitting won't work as expected. There was a targeted fix for
fortran on another branch that disables the LTO run but that'd break
full LTO module splitting entirely.
Test changes are due to metadata indexes shifting.
See #122891
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp index 34ba53c..f79069b 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp @@ -1038,6 +1038,12 @@ public: } bool runOnModule(Module &M) { + // Check if we've already lowered this module. The pass may run more + // than once in the LTO pipeline, and multiple runs aren't supported. + if (M.getModuleFlag("amdgpu.lowered_lds")) + return false; + M.addModuleFlag(Module::ModFlagBehavior::Error, "amdgpu.lowered_lds", 1); + CallGraph CG = CallGraph(M); bool Changed = superAlignLDSGlobals(M); |