Page MenuHomePhabricator

[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

TimeTest
40 msx64 debian > LLVM.MC/AVR::inst-lpm.s
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-mc -triple avr -mattr=lpm,lpmx -show-encoding < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/MC/AVR/inst-lpm.s | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/MC/AVR/inst-lpm.s

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.