[llvm-dev] AMDGPU and support for the new pass manager

Arthur Eubanks via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 4 16:44:00 PST 2020


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-- ...".

I see the following AMDGPU-specific failures:
  LLVM :: CodeGen/AMDGPU/amdgpu-inline.ll
  LLVM :: CodeGen/AMDGPU/infer-addrpace-pipeline.ll
  LLVM :: CodeGen/AMDGPU/internalize.ll
  LLVM :: CodeGen/AMDGPU/llvm.amdgcn.wavefrontsize.ll
  LLVM :: CodeGen/AMDGPU/opt-pipeline.ll
  LLVM :: CodeGen/AMDGPU/propagate-attributes-clone.ll
  LLVM :: CodeGen/AMDGPU/propagate-attributes-single-set.ll
  LLVM :: CodeGen/AMDGPU/simplify-libcalls.ll
  LLVM :: CodeGen/AMDGPU/sroa-before-unroll.ll
  LLVM :: Transforms/LoopUnswitch/AMDGPU/divergent-unswitch.ll

(Also I took a closer look, actually it looks like NVPTX also needs
updating, but NVPTXTargetMachine only adds two passes)

On Fri, Dec 4, 2020 at 3:48 PM Arthur Eubanks <aeubanks at google.com> wrote:

> Currently AMDGPU is the last target which injects passes into the pipeline
> but hasn't been updated to work with the new pass manager.
>
> Recently there was added support for the NPM's equivalent of
> TargetMachine::adjustPassManager(). (Bug
> <https://bugs.llvm.org/show_bug.cgi?id=47244>, Phab
> <https://reviews.llvm.org/D88138>). BPF
> <https://github.com/llvm/llvm-project/blob/99f79cbf31cc6ccdfa1aed253a64c5e8012f4ef7/llvm/lib/Target/BPF/BPFTargetMachine.cpp#L126>
> and Hexagon have their NPM equivalents implemented already, but AMDGPU
> has a lot of custom passes added by adjustPassManager
> <https://github.com/llvm/llvm-project/blob/99f79cbf31cc6ccdfa1aed253a64c5e8012f4ef7/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp#L420> and
> hasn't been updated to work with the NPM.
>
> 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. Here's
> <https://reviews.llvm.org/D91990> an example of porting a pass and adding
> it to the pipeline.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201204/82843b9d/attachment.html>


More information about the llvm-dev mailing list