[llvm] [AMDGPU] Run LowerLDS at the end of the fullLTO pipeline (PR #75333)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 00:31:26 PST 2024


================
@@ -1088,6 +1096,15 @@ class AMDGPULowerModuleLDS {
   }
 
   bool runOnModule(Module &M) {
+    // This pass may run twice in a full LTO pipeline.
+    //
+    // If we ran it early, we'll have added metadata to skip next runs.
+    if (M.getModuleFlag("amdgcn.lowered_module_lds"))
----------------
Pierre-vh wrote:

I think there's different TargetMachine instances in this case, we have no way to tell if we're running the backend as part of a full lto partitioned module (= LowerLDS ran) or if we're running it as usual (= we'd like to keep LowerLDS in the usual place). The module flag is the only way to reliably communicate that I can think of

https://github.com/llvm/llvm-project/pull/75333


More information about the llvm-commits mailing list