This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Allow spilling FP to memory
ClosedPublic

Authored by kerbowa on May 7 2020, 5:08 PM.

Details

Summary

If there are no available lanes in a reserved VGPR, no free SGPR, and no unused CSR
VGPR when trying to save the FP it needs to be spilled to memory as a last
resort. This can be done in the prolog/epilog if we manually add the spill
and manage exec.

Diff Detail

Event Timeline

kerbowa created this revision.May 7 2020, 5:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2020, 5:08 PM
arsenm added inline comments.May 8 2020, 8:44 AM
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
1025

Shouldn't need to explicitly track this. This should be implied from the stack ID

kerbowa updated this revision to Diff 262902.May 8 2020, 10:52 AM

Infer spill type with stack ID.

arsenm accepted this revision.May 11 2020, 3:18 PM

LGTM with nits

llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
669

Braces

671

*FuncInfo->FramePointerSaveIndex

819

Braces

821

*FuncInfo->FramePointerSaveIndex

This revision is now accepted and ready to land.May 11 2020, 3:18 PM
This revision was automatically updated to reflect the committed changes.