1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[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
This commit is contained in:
Stanislav Mekhanoshin 2021-03-02 11:06:30 -08:00
parent 6997a9ef05
commit 2b0a0e51ae

View File

@ -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;