diff options
| author | Dylan McKay <me@dylanmckay.io> | 2017-10-04 10:33:36 +0000 | 
|---|---|---|
| committer | Dylan McKay <me@dylanmckay.io> | 2017-10-04 10:33:36 +0000 | 
| commit | d00f9c1ef1124341582680c46afc3b8cfef1749e (patch) | |
| tree | 17ec44c3341f24a694f6a0f3bc493e0e9d553118 /llvm/lib | |
| parent | 9ad43a1cf1963219acaac88d763b1e3fc2857554 (diff) | |
| download | bcm5719-llvm-d00f9c1ef1124341582680c46afc3b8cfef1749e.tar.gz bcm5719-llvm-d00f9c1ef1124341582680c46afc3b8cfef1749e.zip  | |
[AVR] Elaborate LDWRdPtr into `ld r, X++; ld r+1, X`
Patch by Gergo Erdi.
llvm-svn: 314896
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/AVR/AVRInstrInfo.td | 6 | 
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp index 400e9bd8fdc..9969fda3a56 100644 --- a/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp +++ b/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp @@ -583,8 +583,8 @@ bool AVRExpandPseudo::expand<AVR::LDWRdPtr>(Block &MBB, BlockIt MBBI) {    unsigned TmpReg = 0; // 0 for no temporary register    unsigned SrcReg = MI.getOperand(1).getReg();    bool SrcIsKill = MI.getOperand(1).isKill(); -  OpLo = AVR::LDRdPtr; -  OpHi = AVR::LDDRdPtrQ; +  OpLo = AVR::LDRdPtrPi; +  OpHi = AVR::LDRdPtr;    TRI->splitReg(DstReg, DstLoReg, DstHiReg);    // Use a temporary register if src and dst registers are the same. @@ -597,6 +597,7 @@ bool AVRExpandPseudo::expand<AVR::LDWRdPtr>(Block &MBB, BlockIt MBBI) {    // Load low byte.    auto MIBLO = buildMI(MBB, MBBI, OpLo)      .addReg(CurDstLoReg, RegState::Define) +    .addReg(SrcReg, RegState::Define)      .addReg(SrcReg);    // Push low byte onto stack if necessary. @@ -606,8 +607,7 @@ bool AVRExpandPseudo::expand<AVR::LDWRdPtr>(Block &MBB, BlockIt MBBI) {    // Load high byte.    auto MIBHI = buildMI(MBB, MBBI, OpHi)      .addReg(CurDstHiReg, RegState::Define) -    .addReg(SrcReg, getKillRegState(SrcIsKill)) -    .addImm(1); +    .addReg(SrcReg, getKillRegState(SrcIsKill));    if (TmpReg) {      // Move the high byte into the final destination. diff --git a/llvm/lib/Target/AVR/AVRInstrInfo.td b/llvm/lib/Target/AVR/AVRInstrInfo.td index 61a227b7bda..8c7b6f24392 100644 --- a/llvm/lib/Target/AVR/AVRInstrInfo.td +++ b/llvm/lib/Target/AVR/AVRInstrInfo.td @@ -1152,10 +1152,10 @@ isReMaterializable = 1 in    //    // Expands to:    // ld Rd,   P+ -  // ld Rd+1, P+ +  // ld Rd+1, P    let Constraints = "@earlyclobber $reg" in    def LDWRdPtr : Pseudo<(outs DREGS:$reg), -                        (ins PTRDISPREGS:$ptrreg), +                        (ins PTRREGS:$ptrreg),                          "ldw\t$reg, $ptrreg",                          [(set i16:$reg, (load i16:$ptrreg))]>,                   Requires<[HasSRAM]>; @@ -1164,7 +1164,7 @@ isReMaterializable = 1 in  // Indirect loads (with postincrement or predecrement).  let mayLoad = 1,  hasSideEffects = 0, -Constraints = "$ptrreg = $base_wb,@earlyclobber $reg,@earlyclobber $base_wb" in +Constraints = "$ptrreg = $base_wb,@earlyclobber $reg" in  {    def LDRdPtrPi : FSTLD<0,                          0b01,  | 

