This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Don't check hasStackObjects() when reserving VGPR
ClosedPublic

Authored by ruiling on Mar 10 2021, 6:22 AM.

Details

Summary

We have amdgpu_gfx functions that have high register pressure. If
we do not reserve VGPR for SGPR spill, we will fall into the path
to spill the SGPR to memory, which does not only have correctness issue,
but also have really bad performance.

I don't know why there is the check for hasStackObjects(), in our case,
we don't have stack objects at the time of finalizeLowering(). So just
remove the check that we always reserve a VGPR for possible SGPR spill
in non-entry functions.

Diff Detail

Event Timeline

ruiling created this revision.Mar 10 2021, 6:22 AM
ruiling requested review of this revision.Mar 10 2021, 6:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2021, 6:22 AM
arsenm accepted this revision.Mar 10 2021, 4:20 PM
This revision is now accepted and ready to land.Mar 10 2021, 4:20 PM
This revision was landed with ongoing or failed builds.Mar 11 2021, 4:11 PM
This revision was automatically updated to reflect the committed changes.