[PATCH] D97159: [AVR] Fix def state of operands
Ayke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 21 17:03:11 PST 2021
aykevl updated this revision to Diff 325356.
aykevl added a comment.
- merge D97171 <https://reviews.llvm.org/D97171>
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97159/new/
https://reviews.llvm.org/D97159
Files:
llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp
llvm/test/CodeGen/AVR/relax-mem/STDWPtrQRr.mir
Index: llvm/test/CodeGen/AVR/relax-mem/STDWPtrQRr.mir
===================================================================
--- llvm/test/CodeGen/AVR/relax-mem/STDWPtrQRr.mir
+++ llvm/test/CodeGen/AVR/relax-mem/STDWPtrQRr.mir
@@ -26,6 +26,6 @@
; CHECK-NEXT: PUSHWRr $r29r28, implicit-def $sp, implicit $sp
; CHECK-NEXT: $r29r28 = SBCIWRdK $r29r28, -64, implicit-def $sreg, implicit $sreg
; CHECK-NEXT: STWPtrRr $r29r28, $r1r0
- ; CHECK-NEXT: POPWRd $r29r28, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $r29r28 = POPWRd implicit-def $sp, implicit $sp
STDWPtrQRr $r29r28, 64, $r1r0
...
Index: llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp
===================================================================
--- llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp
+++ llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp
@@ -113,7 +113,7 @@
// Pop the original state of the pointer register.
buildMI(MBB, MBBI, AVR::POPWRd)
- .addReg(Ptr.getReg(), getKillRegState(Ptr.isKill()));
+ .addDef(Ptr.getReg(), getKillRegState(Ptr.isKill()));
MI.removeFromParent();
}
Index: llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
===================================================================
--- llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
+++ llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
@@ -650,10 +650,10 @@
if (TmpReg) {
// Move the high byte into the final destination.
- buildMI(MBB, MBBI, AVR::MOVRdRr).addReg(DstHiReg).addReg(TmpReg);
+ buildMI(MBB, MBBI, AVR::MOVRdRr, DstHiReg).addReg(TmpReg);
// Move the low byte from the scratch space into the final destination.
- buildMI(MBB, MBBI, AVR::POPRd).addReg(DstLoReg);
+ buildMI(MBB, MBBI, AVR::POPRd, DstLoReg);
}
MIBLO.setMemRefs(MI.memoperands());
@@ -767,10 +767,10 @@
if (TmpReg) {
// Move the high byte into the final destination.
- buildMI(MBB, MBBI, AVR::MOVRdRr).addReg(DstHiReg).addReg(TmpReg);
+ buildMI(MBB, MBBI, AVR::MOVRdRr, DstHiReg).addReg(TmpReg);
// Move the low byte from the scratch space into the final destination.
- buildMI(MBB, MBBI, AVR::POPRd).addReg(DstLoReg);
+ buildMI(MBB, MBBI, AVR::POPRd, DstLoReg);
}
MIBLO.setMemRefs(MI.memoperands());
@@ -815,10 +815,10 @@
if (TmpReg) {
// Move the high byte into the final destination.
- buildMI(MBB, MBBI, AVR::MOVRdRr).addReg(DstHiReg).addReg(TmpReg);
+ buildMI(MBB, MBBI, AVR::MOVRdRr, DstHiReg).addReg(TmpReg);
// Move the low byte from the scratch space into the final destination.
- buildMI(MBB, MBBI, AVR::POPRd).addReg(DstLoReg);
+ buildMI(MBB, MBBI, AVR::POPRd, DstLoReg);
}
MIBLO.setMemRefs(MI.memoperands());
@@ -1733,8 +1733,9 @@
.addReg(DstHiReg);
// Move the sign bit to the C flag.
- buildMI(MBB, MBBI, AVR::ADDRdRr).addReg(DstHiReg)
- .addReg(DstHiReg, RegState::Define | getDeadRegState(DstIsDead))
+ buildMI(MBB, MBBI, AVR::ADDRdRr)
+ .addReg(DstHiReg, RegState::Define, getDeadRegState(DstIsDead))
+ .addReg(DstHiReg, getKillRegState(DstIsKill) | getDeadRegState(DstIsDead))
.addReg(DstHiReg, getKillRegState(DstIsKill));
// Set upper byte to 0 or -1.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97159.325356.patch
Type: text/x-patch
Size: 3186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210222/bee06ee7/attachment.bin>
More information about the llvm-commits
mailing list