28#define DEBUG_TYPE "msp430-reg-info"
30#define GET_REGINFO_TARGET_DESC
31#include "MSP430GenRegisterInfo.inc"
41 static const MCPhysReg CalleeSavedRegs[] = {
42 MSP430::R4, MSP430::R5, MSP430::R6, MSP430::R7,
43 MSP430::R8, MSP430::R9, MSP430::R10,
46 static const MCPhysReg CalleeSavedRegsFP[] = {
47 MSP430::R5, MSP430::R6, MSP430::R7,
48 MSP430::R8, MSP430::R9, MSP430::R10,
51 static const MCPhysReg CalleeSavedRegsIntr[] = {
52 MSP430::R4, MSP430::R5, MSP430::R6, MSP430::R7,
53 MSP430::R8, MSP430::R9, MSP430::R10, MSP430::R11,
54 MSP430::R12, MSP430::R13, MSP430::R14, MSP430::R15,
57 static const MCPhysReg CalleeSavedRegsIntrFP[] = {
58 MSP430::R5, MSP430::R6, MSP430::R7,
59 MSP430::R8, MSP430::R9, MSP430::R10, MSP430::R11,
60 MSP430::R12, MSP430::R13, MSP430::R14, MSP430::R15,
66 CalleeSavedRegsIntrFP : CalleeSavedRegsFP);
69 CalleeSavedRegsIntr : CalleeSavedRegs);
99 return &MSP430::GR16RegClass;
104 int SPAdj,
unsigned FIOperandNum,
106 assert(SPAdj == 0 &&
"Unexpected");
113 int FrameIndex =
MI.getOperand(FIOperandNum).getIndex();
115 unsigned BasePtr = (TFI->
hasFP(MF) ? MSP430::R4 : MSP430::SP);
127 Offset +=
MI.getOperand(FIOperandNum + 1).getImm();
129 if (
MI.getOpcode() == MSP430::ADDframe) {
135 MI.setDesc(
TII.get(MSP430::MOV16rr));
136 MI.getOperand(FIOperandNum).ChangeToRegister(BasePtr,
false);
139 MI.removeOperand(FIOperandNum + 1);
156 MI.getOperand(FIOperandNum).ChangeToRegister(BasePtr,
false);
157 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(
Offset);
163 return TFI->
hasFP(MF) ? MSP430::R4 : MSP430::SP;
This file implements the BitVector class.
const HexagonInstrInfo * TII
uint64_t IntrinsicInst * II
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register.
bool eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
BitVector getReservedRegs(const MachineFunction &MF) const override
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
Register getFrameRegister(const MachineFunction &MF) const override
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
TargetInstrInfo - Interface to description of machine instruction set.
virtual const TargetInstrInfo * getInstrInfo() const
@ MSP430_INTR
Used for MSP430 interrupt routines.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.