This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Do not emit 'LPM Rd, Z' on devices without 'FeatureLPMX'
ClosedPublic

Authored by benshi001 on Jan 8 2023, 8:13 PM.

Details

Summary

The LPM instruction has three forms:


formfeature
LPMhasLPM
LPM Rd, ZhasLPMX
LPM Rd, Z+hasLPMX

The second form is always selected in ISelDAGToDAG, even on devices
without FeatureLPMX. This patch emits "LPM + MOV" on devices with
only FeatureLPM.

Diff Detail

Event Timeline

benshi001 created this revision.Jan 8 2023, 8:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 8 2023, 8:13 PM
Herald added subscribers: Jim, hiraditya. · View Herald Transcript
benshi001 requested review of this revision.Jan 8 2023, 8:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 8 2023, 8:13 PM
benshi001 updated this revision to Diff 487270.Jan 8 2023, 8:13 PM
benshi001 edited the summary of this revision. (Show Details)
benshi001 retitled this revision from [AVR] Do not emit 'LPM Rd, Z' on devices without FeatureLPMX to [AVR] Do not emit `LPM Rd, Z` on devices without FeatureLPMX.
benshi001 retitled this revision from [AVR] Do not emit `LPM Rd, Z` on devices without FeatureLPMX to [AVR] Do not emit 'LPM Rd, Z' on devices without 'FeatureLPMX'.Jan 8 2023, 8:19 PM
benshi001 edited the summary of this revision. (Show Details)
benshi001 set the repository for this revision to rG LLVM Github Monorepo.
benshi001 added inline comments.Jan 8 2023, 8:26 PM
llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
869

HasX means if there is extended form of LPM/ELPM.
IsExt means it is E(xtended)LPM, not (ordinray) LPM.

llvm/test/CodeGen/AVR/elpm.ll
161

The only difference between CHECK and NOX is that lpm Rd, Z is replaced by lpm + mov Rd, R0.

benshi001 updated this revision to Diff 487306.Jan 9 2023, 12:09 AM
benshi001 updated this revision to Diff 487321.Jan 9 2023, 1:04 AM
This revision is now accepted and ready to land.Mar 23 2023, 11:08 PM
This revision was landed with ongoing or failed builds.Mar 24 2023, 2:47 AM
This revision was automatically updated to reflect the committed changes.