summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
diff options
context:
space:
mode:
authorDylan McKay <me@dylanmckay.io>2017-10-04 10:33:36 +0000
committerDylan McKay <me@dylanmckay.io>2017-10-04 10:33:36 +0000
commitd00f9c1ef1124341582680c46afc3b8cfef1749e (patch)
tree17ec44c3341f24a694f6a0f3bc493e0e9d553118 /llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
parent9ad43a1cf1963219acaac88d763b1e3fc2857554 (diff)
downloadbcm5719-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/Target/AVR/AVRExpandPseudoInsts.cpp')
-rw-r--r--llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp8
1 files changed, 4 insertions, 4 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.
OpenPOWER on IntegriCloud