[llvm] [TTI][AMDGPU] Allow targets to adjust `LastCallToStaticBonus` via `getInliningLastCallToStaticBonus` (PR #111311)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 14:18:17 PDT 2024


================
@@ -240,6 +240,11 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
   bool areInlineCompatible(const Function *Caller,
                            const Function *Callee) const;
 
+  int getInliningLastCallToStaticBonus() const {
+    // InlineConstants::LastCallToStaticBonus * 11 where 11 is AMDGPU's inlining
+    // threshold multiplier.
+    return 165000;
----------------
shiltian wrote:

I applied the multiplier just by choice. It is not like the general model should apply it. I can just set a random large number. There is no general rule (or studied heuristic) here, which exactly echoes the need for a target dependent bonus.

https://github.com/llvm/llvm-project/pull/111311


More information about the llvm-commits mailing list