This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add an GPR def to the Zvlseg SPILL/RELOAD pseudos
ClosedPublic

Authored by craig.topper on Sep 7 2021, 5:23 PM.

Details

Summary

The expansion of these pseudos creates ADD instructions. Those
ADDs modify a GPR so that it is no longer contains the same value
as the input base pointer. Therefore, I believe we should have a
GPR as a Def on these instructions and expansion should get the
destination register for the ADDs from that operand.

At least in our tests here this works out so that register
scavenging picks the same register as the base pointer.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 7 2021, 5:23 PM
craig.topper requested review of this revision.Sep 7 2021, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2021, 5:23 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
frasercrmck accepted this revision.Sep 8 2021, 4:00 AM

Makes sense to me; I've done a similar thing in the past. The alternative would presumably be to scavenge a scratch register, but I think this is preferable, not least for its simplicity.

This revision is now accepted and ready to land.Sep 8 2021, 4:00 AM
This revision was landed with ongoing or failed builds.Sep 8 2021, 9:23 AM
This revision was automatically updated to reflect the committed changes.