[llvm] [AMDGPU] Make AMDGPULowerKernelArguments a module pass (PR #112790)
Janek van Oirschot via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 12 10:07:45 PST 2024
================
@@ -1170,8 +1166,7 @@
; GCN-O3-NEXT: CallGraph Construction
; GCN-O3-NEXT: Call Graph SCC Pass Manager
; GCN-O3-NEXT: AMDGPU Annotate Kernel Features
-; GCN-O3-NEXT: FunctionPass Manager
-; GCN-O3-NEXT: AMDGPU Lower Kernel Arguments
+; GCN-O3-NEXT: AMDGPU Lower Kernel Arguments
----------------
JanekvO wrote:
wrt some of the (legacy) passes: it may not be an issue for now I'd be cautious adding module passes in the (Pre)CodeGen part as it pops off the CGSCC pass off the pass manager stack. From what I see in `llc-pipeline.ll`, it shouldn't be an issue but it's the reason why a few lines under where you add the pass in `AMDGPUTargetMachine` you see a sudden `addPass(new DummyCGSCCPass());` added: it pushes the CGSCC pass back on the pass manager stack.
Related to that: having the pass be a function pass will more than likely run the functions in CGSCC order anyways since it seems to inherit the CGSCC pass manager from the `AMDGPUAnnotateKernelFeatures` pass before it.
TL;DR: fine to add module pass in this case but may need a comment in `AMDGPUTargetMachine` mentioning that it pops off the CGSCC pass manager from the PM stack for future explorers of said code.
https://github.com/llvm/llvm-project/pull/112790
More information about the llvm-commits
mailing list