[PATCH] D94153: [AMDGPU][Inliner] Remove amdgpu-inline and add new TTI inline hooks

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 21:25:49 PST 2021


aeubanks created this revision.
Herald added subscribers: nikic, kerbowa, haicheng, hiraditya, eraman, t-tye, tpr, dstuttard, yaxunl, mgorny, nhaehnle, jvesely, kzhuravl, arsenm.
aeubanks requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Having a custom inliner doesn't really fit in with the new PM's
pipeline. It's also extra technical debt.

amdgpu-inline only does a couple of custom things compared to the normal
inliner:

1. It forces inlining for "wrapper" functions
2. It disables inlining if the number of BBs in a function would exceed some limit
3. It increases the threshold if there are pointers to private arrays(?)

These can all be handled as TTI inliner hooks.
There already exists a hook for backends to multiply the inlining
threshold.

This way we can remove the custom amdgpu-inline pass.

This caused inline-hint.ll to fail, and after some investigation, it
looks like getInliningThresholdMultiplier() was previously getting
applied twice in amdgpu-inline (https://reviews.llvm.org/D62707 fixed it
not applying at all, so some later inliner change must have fixed
something), so I had to change the threshold in the test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94153

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/CodeGen/BasicTTIImpl.h
  llvm/lib/Analysis/InlineCost.cpp
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPU.h
  llvm/lib/Target/AMDGPU/AMDGPUInline.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
  llvm/lib/Target/AMDGPU/CMakeLists.txt
  llvm/test/CodeGen/AMDGPU/amdgpu-inline.ll
  llvm/test/CodeGen/AMDGPU/inline-maxbb.ll
  llvm/test/CodeGen/AMDGPU/opt-pipeline.ll
  llvm/test/Transforms/Inline/AMDGPU/amdgpu-inline-alloca-argument.ll
  llvm/test/Transforms/Inline/AMDGPU/inline-amdgpu-vecbonus.ll
  llvm/test/Transforms/Inline/AMDGPU/inline-hint.ll
  llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94153.314794.patch
Type: text/x-patch
Size: 26540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210106/3dba445f/attachment.bin>


More information about the llvm-commits mailing list