summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/Mips16InstrInfo.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-11-24 06:18:50 +0000
committerReed Kotler <rkotler@mips.com>2013-11-24 06:18:50 +0000
commite77071da427a2631c0c666845a78c953ca90e53c (patch)
treeb9b434a9274e82c55a200d5d813e74b9f5375399 /lib/Target/Mips/Mips16InstrInfo.cpp
parent1fcb390d438f836ca5a84805a5193a695fb2d27f (diff)
downloadllvm-e77071da427a2631c0c666845a78c953ca90e53c.tar.gz
llvm-e77071da427a2631c0c666845a78c953ca90e53c.tar.bz2
llvm-e77071da427a2631c0c666845a78c953ca90e53c.tar.xz
Make sure that for C++ emitting LwConstant32 pseudos, that it corresponds
to what is needed for constant islands. The prescan method for Mips16 constant islands will eventually go away. It is only temporary and should be done earlier when the instructions are first created or from the DAG. If we keep it here we need to handle better the situation where constant islands is called multiple times since don't want to prescan more than once. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/Mips16InstrInfo.cpp')
-rw-r--r--lib/Target/Mips/Mips16InstrInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/Mips/Mips16InstrInfo.cpp b/lib/Target/Mips/Mips16InstrInfo.cpp
index 000ea2897f..050464ffae 100644
--- a/lib/Target/Mips/Mips16InstrInfo.cpp
+++ b/lib/Target/Mips/Mips16InstrInfo.cpp
@@ -281,7 +281,7 @@ void Mips16InstrInfo::adjustStackPtrBig(unsigned SP, int64_t Amount,
//
//
MachineInstrBuilder MIB1 = BuildMI(MBB, I, DL, get(Mips::LwConstant32), Reg1);
- MIB1.addImm(Amount);
+ MIB1.addImm(Amount).addImm(-1);
MachineInstrBuilder MIB2 = BuildMI(MBB, I, DL, get(Mips::MoveR3216), Reg2);
MIB2.addReg(Mips::SP, RegState::Kill);
MachineInstrBuilder MIB3 = BuildMI(MBB, I, DL, get(Mips::AdduRxRyRz16), Reg1);
@@ -393,7 +393,7 @@ Mips16InstrInfo::loadImmediate(unsigned FrameReg,
}
else
Available.reset(Reg);
- BuildMI(MBB, II, DL, get(Mips::LwConstant32), Reg).addImm(Imm);
+ BuildMI(MBB, II, DL, get(Mips::LwConstant32), Reg).addImm(Imm).addImm(-1);
NewImm = 0;
if (FrameReg == Mips::SP) {
SpReg = Available.find_first();