[PATCH] D131844: [AVR] Use @earlyclobber instead of register scavenging

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 13 13:04:26 PDT 2022


aykevl created this revision.
aykevl added reviewers: dylanmckay, benshi001.
Herald added subscribers: Jim, hiraditya.
Herald added a project: All.
aykevl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The code to support the case when the register allocator has assigned
the same register to the src and the dst register operand isn't actually
needed:

- LDWRdPtr and LDDWRdPtrQ have an @earlyclobber on the output register, so the register allocator will make sure to allocate a different register for the output register.
- LDDWRdYQ does not have an @earlyclobber, but the pointer register is the fixed Y register which is reserved. The register allocator won't use reserved registers for the output value.

This removes a special case in the code that makes the pseudo
instruction expansion pass more complicated than it needs to be.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131844

Files:
  llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
  llvm/test/CodeGen/AVR/pseudo/LDWRdPtr-same-src-dst.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131844.452451.patch
Type: text/x-patch
Size: 5262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220813/d2dc651a/attachment.bin>


More information about the llvm-commits mailing list