llvm.org GIT mirror llvm / e3ce8aa
Fix a couple more places where we are creating ld / st instructions without memoperands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85746 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 10 years ago
2 changed file(s) with 36 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1616 #include "ARMMachineFunctionInfo.h"
1717 #include "llvm/CodeGen/MachineFrameInfo.h"
1818 #include "llvm/CodeGen/MachineInstrBuilder.h"
19 #include "llvm/CodeGen/MachineMemOperand.h"
20 #include "llvm/CodeGen/PseudoSourceValue.h"
1921 #include "llvm/ADT/SmallVector.h"
2022 #include "Thumb1InstrInfo.h"
2123
121123 isARMLowRegister(SrcReg))) && "Unknown regclass!");
122124
123125 if (RC == ARM::tGPRRegisterClass) {
126 MachineFunction &MF = *MBB.getParent();
127 MachineFrameInfo &MFI = *MF.getFrameInfo();
128 MachineMemOperand *MMO =
129 MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
130 MachineMemOperand::MOStore, 0,
131 MFI.getObjectSize(FI),
132 MFI.getObjectAlignment(FI));
124133 AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::tSpill))
125134 .addReg(SrcReg, getKillRegState(isKill))
126 .addFrameIndex(FI).addImm(0));
135 .addFrameIndex(FI).addImm(0).addMemOperand(MMO));
127136 }
128137 }
129138
139148 isARMLowRegister(DestReg))) && "Unknown regclass!");
140149
141150 if (RC == ARM::tGPRRegisterClass) {
151 MachineFunction &MF = *MBB.getParent();
152 MachineFrameInfo &MFI = *MF.getFrameInfo();
153 MachineMemOperand *MMO =
154 MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
155 MachineMemOperand::MOLoad, 0,
156 MFI.getObjectSize(FI),
157 MFI.getObjectAlignment(FI));
142158 AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::tRestore), DestReg)
143 .addFrameIndex(FI).addImm(0));
159 .addFrameIndex(FI).addImm(0).addMemOperand(MMO));
144160 }
145161 }
146162
1717 #include "ARMMachineFunctionInfo.h"
1818 #include "llvm/CodeGen/MachineFrameInfo.h"
1919 #include "llvm/CodeGen/MachineInstrBuilder.h"
20 #include "llvm/CodeGen/MachineMemOperand.h"
21 #include "llvm/CodeGen/PseudoSourceValue.h"
2022 #include "llvm/ADT/SmallVector.h"
2123 #include "Thumb2InstrInfo.h"
2224
8991 if (I != MBB.end()) DL = I->getDebugLoc();
9092
9193 if (RC == ARM::GPRRegisterClass) {
94 MachineFunction &MF = *MBB.getParent();
95 MachineFrameInfo &MFI = *MF.getFrameInfo();
96 MachineMemOperand *MMO =
97 MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
98 MachineMemOperand::MOStore, 0,
99 MFI.getObjectSize(FI),
100 MFI.getObjectAlignment(FI));
92101 AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::t2STRi12))
93102 .addReg(SrcReg, getKillRegState(isKill))
94 .addFrameIndex(FI).addImm(0));
103 .addFrameIndex(FI).addImm(0).addMemOperand(MMO));
95104 return;
96105 }
97106
106115 if (I != MBB.end()) DL = I->getDebugLoc();
107116
108117 if (RC == ARM::GPRRegisterClass) {
118 MachineFunction &MF = *MBB.getParent();
119 MachineFrameInfo &MFI = *MF.getFrameInfo();
120 MachineMemOperand *MMO =
121 MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
122 MachineMemOperand::MOLoad, 0,
123 MFI.getObjectSize(FI),
124 MFI.getObjectAlignment(FI));
109125 AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::t2LDRi12), DestReg)
110 .addFrameIndex(FI).addImm(0));
126 .addFrameIndex(FI).addImm(0).addMemOperand(MMO));
111127 return;
112128 }
113129