This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Only support sp, r0 and r1 in llvm.read_register
ClosedPublic

Authored by aykevl on Feb 18 2021, 9:17 AM.

Details

Summary

Most other registers are allocatable and therefore cannot be used.

This issue was flagged by the machine verifier, because reading other registers is considered reading from an undefined register.

While working on this, I noticed that writing the stack pointer produced invalid code. But I figured that is a different issue (and I'm not sure whether it happens in practice).

Diff Detail

Event Timeline

aykevl created this revision.Feb 18 2021, 9:17 AM
aykevl requested review of this revision.Feb 18 2021, 9:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 9:17 AM
aykevl edited the summary of this revision. (Show Details)Feb 18 2021, 9:18 AM
aykevl updated this revision to Diff 325251.Feb 20 2021, 3:12 PM
  • fix lint warnings

there is a lint warning.

aykevl updated this revision to Diff 327764.Mar 3 2021, 6:15 AM
  • fix lint warning
benshi001 accepted this revision.Mar 3 2021, 6:29 PM
This revision is now accepted and ready to land.Mar 3 2021, 6:29 PM
This revision was automatically updated to reflect the committed changes.
llvm/test/CodeGen/AVR/intrinsics/named-reg-special.ll