[PATCH] D118492: [AMDGPU] Lazily init pal metadata on first function
Sebastian Neubauer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 1 01:29:03 PST 2022
sebastian-ne added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:448-449
bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+ // Init target streamer lazily on the first function so that previous passes
+ // can set metadata.
+ if (!IsTargetStreamerInitialized)
----------------
arsenm wrote:
> This feels like an abuse of the pass manager. You're not supposed to depend on passes on other functions from a function pass. What pass is setting this metadata? Is it a module pass?
A module pass is setting the metadata.
`emitStartOfAsmFile` is called before the module pass is run (when AMDGPUResourceUsageAnalysis is a ModulePass, it works fine with the current main state for some reason).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118492/new/
https://reviews.llvm.org/D118492
More information about the llvm-commits
mailing list