<div dir="ltr">Some indicative failing tests are under the llvm/test/CodeGen/AMDGPU directory when opt's -enable-new-pm flag is set to true by default. They should also be repro'able by adding a corresponding NPM RUN line, e.g. "opt -S -O1 -mtriple=amdgcn-- ..." -> "opt -S -passes='default<O1>' -mtriple=amdgcn-- ...".<div><br></div><div>I see the following AMDGPU-specific failures:</div><div> LLVM :: CodeGen/AMDGPU/amdgpu-inline.ll<br> LLVM :: CodeGen/AMDGPU/infer-addrpace-pipeline.ll<br> LLVM :: CodeGen/AMDGPU/internalize.ll<br> LLVM :: CodeGen/AMDGPU/llvm.amdgcn.wavefrontsize.ll<br> LLVM :: CodeGen/AMDGPU/opt-pipeline.ll<br> LLVM :: CodeGen/AMDGPU/propagate-attributes-clone.ll<br> LLVM :: CodeGen/AMDGPU/propagate-attributes-single-set.ll<br> LLVM :: CodeGen/AMDGPU/simplify-libcalls.ll<br> LLVM :: CodeGen/AMDGPU/sroa-before-unroll.ll<br></div><div> LLVM :: Transforms/LoopUnswitch/AMDGPU/divergent-unswitch.ll<br></div><div><br></div><div>(Also I took a closer look, actually it looks like NVPTX also needs updating, but NVPTXTargetMachine only adds two passes)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 4, 2020 at 3:48 PM Arthur Eubanks <<a href="mailto:aeubanks@google.com">aeubanks@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Currently AMDGPU is the last target which injects passes into the pipeline but hasn't been updated to work with the new pass manager.<div><br></div><div>Recently there was added support for the NPM's equivalent of TargetMachine::adjustPassManager(). (<a href="https://bugs.llvm.org/show_bug.cgi?id=47244" target="_blank">Bug</a>, <a href="https://reviews.llvm.org/D88138" target="_blank">Phab</a>). <a href="https://github.com/llvm/llvm-project/blob/99f79cbf31cc6ccdfa1aed253a64c5e8012f4ef7/llvm/lib/Target/BPF/BPFTargetMachine.cpp#L126" target="_blank">BPF</a> and Hexagon have their NPM equivalents implemented already, but <a href="https://github.com/llvm/llvm-project/blob/99f79cbf31cc6ccdfa1aed253a64c5e8012f4ef7/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp#L420" target="_blank">AMDGPU has a lot of custom passes added by adjustPassManager</a> and hasn't been updated to work with the NPM.</div><div><br></div><div>Could the maintainers of AMDGPU port the necessary passes to the new pass manager add them to AMDGPUTargetMachine::registerPassBuilderCallbacks()? I'm happy to provide any guidance if necessary. <a href="https://reviews.llvm.org/D91990" target="_blank">Here's</a> an example of porting a pass and adding it to the pipeline.</div></div>
</blockquote></div>