This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Rewrite forwardCopyWillClobberTuple to not assume that there are exactly 32 registers. NFC
ClosedPublic

Authored by craig.topper on Oct 8 2021, 3:13 PM.

Details

Summary

This function was copied from ARM where register pairs/triples/quads can wrap around the 32 encoding space. So register 31 can pair with register 0. This is not true for RISCV vectors. The spec specifically mentions the possibility of a future encoding that has more than 32 registers.

This patch removes the modulo from the code and directly checks that destination register is in the source register range and not the beginning of the range. Though I don't expect an identity copy will occur.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 8 2021, 3:13 PM
craig.topper requested review of this revision.Oct 8 2021, 3:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2021, 3:13 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
frasercrmck accepted this revision.Oct 15 2021, 10:04 AM

LGTM. Are there any tests possible for this?

This revision is now accepted and ready to land.Oct 15 2021, 10:04 AM

LGTM. Are there any tests possible for this?

I don't think so. Since our register classes don't wrap around we should never see the wrap this was trying to handle. I think have tests for the different copy directions already though.