This is an archive of the discontinued LLVM Phabricator instance.

[Spill2Reg][2/9] This patch adds spill/reload collection.
Needs ReviewPublic

Authored by vporpo on Jan 26 2022, 5:35 PM.

Details

Summary

Walk through the code looking for spills and reloads and group them
per stack slot.

Diff Detail

Event Timeline

vporpo created this revision.Jan 26 2022, 5:35 PM
vporpo requested review of this revision.Jan 26 2022, 5:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2022, 5:35 PM
vporpo updated this revision to Diff 403477.Jan 26 2022, 7:53 PM

[Spill2Reg] This patch adds spill/reload collection.

vporpo updated this revision to Diff 403807.Jan 27 2022, 2:33 PM

Added a check that disables tha pass if NoImplicitFloat is set.

arsenm added a subscriber: arsenm.Feb 3 2022, 3:26 PM
arsenm added inline comments.
llvm/lib/CodeGen/Spill2Reg.cpp
151

I wouldn't assume the memory size is the same as the register size

192

Typo spils

vporpo retitled this revision from [Spill2Reg] This patch adds spill/reload collection. to [Spill2Reg][2/9] This patch adds spill/reload collection..Feb 4 2022, 9:48 AM
vporpo marked an inline comment as done.Feb 15 2022, 10:59 AM
vporpo added inline comments.
llvm/lib/CodeGen/Spill2Reg.cpp
151

Perhaps the variable name is bad. MemBits is the size of the register and we are using it later in the code generation phase to choose which insert/extract instruction to use.
Wdyt about renaming it to SpillBits ?

vporpo updated this revision to Diff 409008.Feb 15 2022, 12:21 PM

Renamed MemBits to SpillBits and fixed typo.

Carrot added inline comments.Apr 13 2022, 12:40 PM
llvm/lib/CodeGen/Spill2Reg.cpp
79

typo 'memoru'

llvm/lib/Target/X86/X86InstrInfo.cpp
9489

Instead of checking opcode, it's better to check register class.

Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 12:40 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
vporpo marked 2 inline comments as done.Apr 13 2022, 2:37 PM
vporpo updated this revision to Diff 422667.Apr 13 2022, 2:39 PM

Updated isLegalToSpill2Reg() to take a reg argument instead of opcode.

vporpo updated this revision to Diff 438035.Jun 17 2022, 2:16 PM

Replaced StackSlotDataEntry::getRegClass() with getSpilledReg().

The patches have gone through a round of reviews by @Carrot . @arsenm could you also take a look ? Thanks!