mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
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
This commit is contained in:
parent
48d8afab73
commit
e3ce8aab0a
@ -17,6 +17,8 @@
|
||||
#include "ARMMachineFunctionInfo.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/CodeGen/MachineMemOperand.h"
|
||||
#include "llvm/CodeGen/PseudoSourceValue.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "Thumb1InstrInfo.h"
|
||||
|
||||
@ -122,9 +124,16 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
isARMLowRegister(SrcReg))) && "Unknown regclass!");
|
||||
|
||||
if (RC == ARM::tGPRRegisterClass) {
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
|
||||
MachineMemOperand::MOStore, 0,
|
||||
MFI.getObjectSize(FI),
|
||||
MFI.getObjectAlignment(FI));
|
||||
AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::tSpill))
|
||||
.addReg(SrcReg, getKillRegState(isKill))
|
||||
.addFrameIndex(FI).addImm(0));
|
||||
.addFrameIndex(FI).addImm(0).addMemOperand(MMO));
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,8 +149,15 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
isARMLowRegister(DestReg))) && "Unknown regclass!");
|
||||
|
||||
if (RC == ARM::tGPRRegisterClass) {
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
|
||||
MachineMemOperand::MOLoad, 0,
|
||||
MFI.getObjectSize(FI),
|
||||
MFI.getObjectAlignment(FI));
|
||||
AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::tRestore), DestReg)
|
||||
.addFrameIndex(FI).addImm(0));
|
||||
.addFrameIndex(FI).addImm(0).addMemOperand(MMO));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include "ARMMachineFunctionInfo.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/CodeGen/MachineMemOperand.h"
|
||||
#include "llvm/CodeGen/PseudoSourceValue.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "Thumb2InstrInfo.h"
|
||||
|
||||
@ -90,9 +92,16 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
if (RC == ARM::GPRRegisterClass) {
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
|
||||
MachineMemOperand::MOStore, 0,
|
||||
MFI.getObjectSize(FI),
|
||||
MFI.getObjectAlignment(FI));
|
||||
AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::t2STRi12))
|
||||
.addReg(SrcReg, getKillRegState(isKill))
|
||||
.addFrameIndex(FI).addImm(0));
|
||||
.addFrameIndex(FI).addImm(0).addMemOperand(MMO));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -107,8 +116,15 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
if (RC == ARM::GPRRegisterClass) {
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
|
||||
MachineMemOperand::MOLoad, 0,
|
||||
MFI.getObjectSize(FI),
|
||||
MFI.getObjectAlignment(FI));
|
||||
AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::t2LDRi12), DestReg)
|
||||
.addFrameIndex(FI).addImm(0));
|
||||
.addFrameIndex(FI).addImm(0).addMemOperand(MMO));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user