Page MenuHomePhabricator

[AVR][MC] Emit some aliases for GPRs and IO registers
ClosedPublic

Authored by benshi001 on Feb 14 2022, 10:35 PM.

Details

Summary

Emit the following aliases (if available):

.set __tmp_reg__, [0|16]
.set __zero_reg__, [1|17]
.set __SREG__, 63
.set __SP_H__, 62
.set __SP_L__, 61
.set __EIND__, 60
.set __RAMPZ__, 59

Diff Detail

Event Timeline

benshi001 created this revision.Feb 14 2022, 10:35 PM
benshi001 requested review of this revision.Feb 14 2022, 10:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 10:35 PM
benshi001 edited the summary of this revision. (Show Details)Feb 14 2022, 10:37 PM
benshi001 added inline comments.Feb 14 2022, 10:52 PM
llvm/lib/Target/AVR/AVRDevices.td
178

This is just re-format, no functional change.

benshi001 updated this revision to Diff 412298.Mar 1 2022, 6:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2022, 6:27 PM
benshi001 updated this revision to Diff 412311.Mar 1 2022, 7:57 PM
benshi001 updated this revision to Diff 414546.Mar 10 2022, 6:22 PM

I think there is one issue in the test. Other than that, this looks good to me.

llvm/test/MC/AVR/registers.s
7–10 ↗(On Diff #414546)

I don't think this should be needed? The goal of this patch is to avoid the need for these aliases, after all.

benshi001 updated this revision to Diff 417482.Mar 22 2022, 8:37 PM

I think there is one issue in the test. Other than that, this looks good to me.

I have deleted the MC test, since it is uncessary as you pointed.

My patch is only about emiting aliases when doing CodeGen, so one .ll test is enough.

aykevl accepted this revision.Mar 23 2022, 9:56 AM

Hmm, ok. An assembly test might have been useful to show that it actually works but the patch looks fine to me so I'll accept it.

This revision is now accepted and ready to land.Mar 23 2022, 9:56 AM
This revision was landed with ongoing or failed builds.Mar 23 2022, 7:09 PM
This revision was automatically updated to reflect the committed changes.