This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Reorder the vector register allocation order.
ClosedPublic

Authored by HsiangKai on Oct 7 2021, 4:57 AM.

Details

Summary

GPR uses argument registers as the first group of registers to allocate.
This patch uses vector argument registers, v8 to v23, as the first group
to allocate.

Diff Detail

Event Timeline

HsiangKai created this revision.Oct 7 2021, 4:57 AM
HsiangKai requested review of this revision.Oct 7 2021, 4:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2021, 4:57 AM

It's changed code gen so this should not be NFC?

HsiangKai retitled this revision from [NFC][RISCV] Reorder the vector register allocation order. to [RISCV] Reorder the vector register allocation order..Oct 7 2021, 4:33 PM
kito-cheng added inline comments.Oct 7 2021, 8:18 PM
llvm/lib/Target/RISCV/RISCVRegisterInfo.td
506

https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Target/Target.td#L329

Seems like sequence have optional 4th argument for stride, so this could be simplified to

(add (sequence "V%uM2", 8, 31, 2),
     (sequence "V%uM2", 0, 7, 2)), 2>;
HsiangKai updated this revision to Diff 378499.Oct 10 2021, 6:03 AM

Address Kito's comments.

No objection with this, I guess it is for consistency with GPRs, right?

No objection with this, I guess it is for consistency with GPRs, right?

Yes. Starting with v25 is also strange. It should be an 8x number for LMUL may be 8. To be consistent with GPR to start with argument registers may be a way to go.

frasercrmck accepted this revision.Oct 18 2021, 1:46 AM

LGTM, makes sense

This revision is now accepted and ready to land.Oct 18 2021, 1:46 AM
This revision was landed with ongoing or failed builds.Oct 18 2021, 6:30 PM
This revision was automatically updated to reflect the committed changes.