This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][NFC] Refactor emitEntryFunctionPrologue
ClosedPublic

Authored by scott.linder on Feb 24 2020, 4:40 PM.

Details

Summary

Remove dead code and factor repeated conditions out into a single check.
Rename and move code to make it more obvious what is running only for
entry functions. Simplify function arguments to make it clearer what the
relevant inputs are. Make flat scratch init accept an MBB iterator and
move it to where it was logically being emitted within the prologue.

These changes will make a future update to the calling convention
simpler.

Event Timeline

scott.linder created this revision.Feb 24 2020, 4:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 24 2020, 4:40 PM
arsenm added inline comments.Feb 24 2020, 5:18 PM
llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
328–329

s/unsigned/Register

480–481

Should have braces

486

Braces

496

Braces

501

Register

llvm/lib/Target/AMDGPU/SIFrameLowering.h
61

Should probably be const DebugLoc&

72

Ditto

scott.linder marked 7 inline comments as done.

Address feedback

arsenm accepted this revision.Feb 24 2020, 7:16 PM
This revision is now accepted and ready to land.Feb 24 2020, 7:16 PM
This revision was automatically updated to reflect the committed changes.