This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Correct even register check for amocas.
ClosedPublic

Authored by craig.topper on Jul 12 2023, 11:34 AM.

Details

Summary

We were checking that the encoding within our internal list of
registers was even. This worked today because X0 happens to have
an even value in that enum. This can break if any registers are
added before X0.

The correct check is to make sure it has an even offset from X0.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 12 2023, 11:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 11:34 AM
craig.topper requested review of this revision.Jul 12 2023, 11:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 11:34 AM
asb accepted this revision.Jul 12 2023, 11:42 AM

Thank you. LGTM.

This revision is now accepted and ready to land.Jul 12 2023, 11:42 AM
This revision was landed with ongoing or failed builds.Jul 12 2023, 12:58 PM
This revision was automatically updated to reflect the committed changes.