This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Switch to backwards scavenging in eliminateFrameIndex
ClosedPublic

Authored by foad on Jun 7 2023, 12:25 PM.

Details

Summary

Frame index elimination runs backwards so we must use backwards
scavenging. Otherwise, when a scavenged register is spilled, the
scavenger will remember that the register is in use until the restore
point, but it will never reach that restore point. The result is that in
some cases it will keep scavenging different registers instead of
reusing the same one.

Diff Detail

Event Timeline

foad created this revision.Jun 7 2023, 12:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 12:25 PM
foad requested review of this revision.Jun 7 2023, 12:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 12:25 PM
foad added inline comments.Jun 7 2023, 12:26 PM
llvm/test/CodeGen/AMDGPU/GlobalISel/call-outgoing-stack-args.ll
163–173

Good example of resuing s0 instead of lots of different SGPRs.

arsenm accepted this revision.Jun 7 2023, 12:28 PM
This revision is now accepted and ready to land.Jun 7 2023, 12:28 PM
This revision was landed with ongoing or failed builds.Jun 7 2023, 1:01 PM
This revision was automatically updated to reflect the committed changes.