[llvm] [SystemZ] Remove getInliningThresholdMultiplier() override (PR #94612)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 16 06:27:56 PDT 2024
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/94612
>From c42db21040deb076df842e8260578794b3700046 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Thu, 6 Jun 2024 14:57:04 +0200
Subject: [PATCH 1/2] [SystemZ] Remove getInliningThresholdMultiplier()
override
Using this TTI hook is only appropriate for GPU targets that need
to maximally flatten all functions.
The inlining threshold multiplier should not be increased for
ordinary targets -- while this may increase benchmark scores, it
can also result in large code size increases and runaway inlining,
resulting in build OOM/timeouts.
---
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
index 47db8f132337fc..09b589cf5867d2 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
@@ -38,7 +38,6 @@ class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
/// \name Scalar TTI Implementations
/// @{
- unsigned getInliningThresholdMultiplier() const { return 3; }
unsigned adjustInliningThreshold(const CallBase *CB) const;
InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,
>From 2fdbb7e8db3e2cc1992fe1a5bcc6b853d00a4f42 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Fri, 16 Aug 2024 15:23:43 +0200
Subject: [PATCH 2/2] Set the threshold multiplier to 2 instead
---
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
index 09b589cf5867d2..ef28b63b5b5a02 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
@@ -38,6 +38,7 @@ class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
/// \name Scalar TTI Implementations
/// @{
+ unsigned getInliningThresholdMultiplier() const { return 2; }
unsigned adjustInliningThreshold(const CallBase *CB) const;
InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,
More information about the llvm-commits
mailing list