This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Use correct register class for LPM/ELPM
AbandonedPublic

Authored by aykevl on Jan 20 2022, 9:41 AM.

Details

Summary

This was worked around in pseudo instruction expanson pass using scavengeGPR8 or pushing/popping registers, but there is a much simpler solution: specify the correct register class for these instructions.

Diff Detail

Unit TestsFailed

Event Timeline

aykevl created this revision.Jan 20 2022, 9:41 AM
aykevl requested review of this revision.Jan 20 2022, 9:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2022, 9:41 AM
benshi001 added inline comments.Jan 21 2022, 5:53 AM
llvm/lib/Target/AVR/AVRInstrInfo.td
1697

I am not sure this is a good solution. Actually I can not write assmebly LPM R30, Z. Why no only use register calss LPM8 / DREGSLPM only for pseudo instructions ?

aykevl abandoned this revision.EditedJan 22 2022, 10:09 AM

Hmm, I realize that this is not the best approach. I will make a new patch. You are correct that some instructions had the wrong register class operand.