diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp @@ -1147,8 +1147,12 @@ 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;