[PATCH] D117504: AMDGPU: Convert AMDGPUResourceUsageAnalysis to a Module pass

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 14:48:26 PST 2022


arsenm added a comment.

In D117504#3261571 <https://reviews.llvm.org/D117504#3261571>, @sebastian-ne wrote:

> I think I found the problem and I’m a little surprised it currently works.
> In the llpc pipeline, a module pass (`PipelineStateClearer`) writes pal metadata into the `amdgpu.pal.metadata.msgpack` metadata.
> This metadata is read by the `AMDGPUAsmPrinter`, extended as functions are emitted and finally written out in `AMDGPUTarget[…]Streamer::finish`.
>
> The reading of the metadata happens in `AMDGPUAsmPrinter::emitStartOfAsmFile`, which is called from `AsmPrinter::doInitialization`, which in turn is called when the pass manager is initialized.
> So, the metadata is read at pass manager initialization, but it’s only written afterwards when running a pass, resulting in missing metadata in the output.

So what is the takeaway from this? My initial thought is this that metadata is not intended to be used to share information between passes this way. I think we need to get indirect/alias calls working correctly, so should I just push the first patch and wait for you to resolve this issue?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117504/new/

https://reviews.llvm.org/D117504



More information about the llvm-commits mailing list