This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add a register class for GPR pairs without SP and use it. NFCI
ClosedPublic

Authored by miyuki on Oct 16 2019, 2:55 AM.

Details

Summary

Currently Thumb2InstrInfo.cpp uses a register class which is
auto-generated by tablegen. Such approach is fragile because
auto-generated classes might change when other register classes are
added. For example, before https://reviews.llvm.org/D62667
we were using GPRPair_with_gsub_1_in_rGPRRegClass, but had to
change it to GPRPair_with_gsub_1_in_GPRwithAPSRnospRegClass
because the former class stopped being generated (this did not change
the functionality though).

This patch adds a register class consisting of even-odd GPR register
pairs from (R0, R1) to (R10, R11), which excludes (R12, SP) and uses
it in Thumb2InstrInfo.cpp instead of
GPRPair_with_gsub_1_in_GPRwithAPSRnospRegClass.

Diff Detail

Event Timeline

miyuki created this revision.Oct 16 2019, 2:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 16 2019, 2:55 AM
miyuki marked an inline comment as done.Oct 16 2019, 2:59 AM
miyuki added inline comments.
llvm/test/CodeGen/ARM/ipra-reg-usage.ll
9

Note: the change in this line (git show --word-diff) is the order of some registers ...[-$r12_sp-] $r0_r1 $r2_r3 {+$r12_sp+}...

simon_tatham accepted this revision.Oct 16 2019, 3:26 AM
This revision is now accepted and ready to land.Oct 16 2019, 3:26 AM
This revision was automatically updated to reflect the committed changes.