@@ -584,8 +584,8 @@ bool AVRExpandPseudo::expand<AVR::LDWRdPtr>(Block &MBB, BlockIt MBBI) {
584
584
unsigned TmpReg = 0 ; // 0 for no temporary register
585
585
unsigned SrcReg = MI.getOperand (1 ).getReg ();
586
586
bool SrcIsKill = MI.getOperand (1 ).isKill ();
587
- OpLo = AVR::LDRdPtr ;
588
- OpHi = AVR::LDDRdPtrQ ;
587
+ OpLo = AVR::LDRdPtrPi ;
588
+ OpHi = AVR::LDRdPtr ;
589
589
TRI->splitReg (DstReg, DstLoReg, DstHiReg);
590
590
591
591
// Use a temporary register if src and dst registers are the same.
@@ -598,6 +598,7 @@ bool AVRExpandPseudo::expand<AVR::LDWRdPtr>(Block &MBB, BlockIt MBBI) {
598
598
// Load low byte.
599
599
auto MIBLO = buildMI (MBB, MBBI, OpLo)
600
600
.addReg (CurDstLoReg, RegState::Define)
601
+ .addReg (SrcReg, RegState::Define)
601
602
.addReg (SrcReg);
602
603
603
604
// Push low byte onto stack if necessary.
@@ -607,8 +608,7 @@ bool AVRExpandPseudo::expand<AVR::LDWRdPtr>(Block &MBB, BlockIt MBBI) {
607
608
// Load high byte.
608
609
auto MIBHI = buildMI (MBB, MBBI, OpHi)
609
610
.addReg (CurDstHiReg, RegState::Define)
610
- .addReg (SrcReg, getKillRegState (SrcIsKill))
611
- .addImm (1 );
611
+ .addReg (SrcReg, getKillRegState (SrcIsKill));
612
612
613
613
if (TmpReg) {
614
614
// Move the high byte into the final destination.
0 commit comments