aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-01-05 21:11:21 -0800
committerArthur Eubanks <aeubanks@google.com>2021-01-21 20:29:17 -0800
commita11bf9a7fbd3693d6d4bca8ef2ba1d2f0758f9be (patch)
tree47b9f36a3ea7a6a5afabe5613690fb9803a91840 /llvm/lib/Analysis/InlineCost.cpp
parentba9b4ea4eeaef039e80df10695a11e6ed35d415a (diff)
downloadllvm-a11bf9a7fbd3693d6d4bca8ef2ba1d2f0758f9be.zip
llvm-a11bf9a7fbd3693d6d4bca8ef2ba1d2f0758f9be.tar.gz
llvm-a11bf9a7fbd3693d6d4bca8ef2ba1d2f0758f9be.tar.bz2
[AMDGPU][Inliner] Remove amdgpu-inline and add a new TTI inline hook
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 disables inlining if the number of BBs in a function would exceed some limit 2) 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. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D94153
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index ff589b8..a35f5e1 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1580,6 +1580,7 @@ void InlineCostCallAnalyzer::updateThreshold(CallBase &Call, Function &Callee) {
// Finally, take the target-specific inlining threshold multiplier into
// account.
Threshold *= TTI.getInliningThresholdMultiplier();
+ Threshold += TTI.adjustInliningThreshold(&Call);
SingleBBBonus = Threshold * SingleBBBonusPercent / 100;
VectorBonus = Threshold * VectorBonusPercent / 100;