From c42db21040deb076df842e8260578794b3700046 Mon Sep 17 00:00:00 2001 From: Nikita Popov 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 47db8f132337f..09b589cf5867d 100644 --- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h +++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h @@ -38,7 +38,6 @@ class SystemZTTIImpl : public BasicTTIImplBase { /// \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 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 09b589cf5867d..ef28b63b5b5a0 100644 --- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h +++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h @@ -38,6 +38,7 @@ class SystemZTTIImpl : public BasicTTIImplBase { /// \name Scalar TTI Implementations /// @{ + unsigned getInliningThresholdMultiplier() const { return 2; } unsigned adjustInliningThreshold(const CallBase *CB) const; InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,