[llvm] b70c483 - [AMDGPU] Exclude always_inline from max bb threshold
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 3 10:22:06 PST 2021
Author: Stanislav Mekhanoshin
Date: 2021-03-03T10:21:56-08:00
New Revision: b70c483e0416d594116e3ca757ff1ed87fa8de37
URL: https://github.com/llvm/llvm-project/commit/b70c483e0416d594116e3ca757ff1ed87fa8de37
DIFF: https://github.com/llvm/llvm-project/commit/b70c483e0416d594116e3ca757ff1ed87fa8de37.diff
LOG: [AMDGPU] Exclude always_inline from max bb threshold
Honor always_inline attribute when processing -amdgpu-inline-max-bb.
It was lost during the ports of the heuristic. There is no reason
to honor inline hint, but not always inline.
Differential Revision: https://reviews.llvm.org/D97790
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index 6728b07fb48b..d7fa1279e993 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -1147,8 +1147,12 @@ bool GCNTTIImpl::areInlineCompatible(const Function *Caller,
if (!CallerMode.isInlineCompatible(CalleeMode))
return false;
+ if (Callee->hasFnAttribute(Attribute::AlwaysInline) ||
+ Callee->hasFnAttribute(Attribute::InlineHint))
+ return true;
+
// Hack to make compile times reasonable.
- if (InlineMaxBB && !Callee->hasFnAttribute(Attribute::InlineHint)) {
+ if (InlineMaxBB) {
// Single BB does not increase total BB amount.
if (Callee->size() == 1)
return true;
More information about the llvm-commits
mailing list