This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Inline non-kernel functions using extern lds
ClosedPublic

Authored by vangthao on Sep 14 2021, 10:49 AM.

Details

Summary

In https://reviews.llvm.org/D100481, forceful inline of all non-kernel
functions using lds was disabled since AMDGPULowerModuleLDS pass now handles
static lds. However that pass does not handle extern lds so non-kernel
functions using extern lds must sill be inline.

Diff Detail

Event Timeline

vangthao created this revision.Sep 14 2021, 10:49 AM
vangthao requested review of this revision.Sep 14 2021, 10:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2021, 10:49 AM
hsmhsm accepted this revision.Sep 15 2021, 2:17 AM

LGTM

This revision is now accepted and ready to land.Sep 15 2021, 2:17 AM
arsenm added inline comments.Sep 15 2021, 5:59 AM
llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
125

What does the hasInitializer check have to do with this? Initializers are illegal for LDS anyway

vangthao added inline comments.Sep 15 2021, 7:10 AM
llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
125

From https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp#L319, this implies that the variable is extern shared. Is there a better method for checking extern lds?

arsenm accepted this revision.Sep 16 2021, 10:34 AM
arsenm added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
125

This is just a weird helper function, I would have expected !isDeclaration to work just as well

This revision was automatically updated to reflect the committed changes.