LLVM API Documentation

llvm::MSP430InstrInfo Class Reference

#include <MSP430InstrInfo.h>

Inheritance diagram for llvm::MSP430InstrInfo:
[legend]
Collaboration diagram for llvm::MSP430InstrInfo:
[legend]

List of all members.

Public Member Functions

 MSP430InstrInfo (MSP430TargetMachine &TM)
virtual const TargetRegisterInfo & getRegisterInfo () const
bool copyRegToReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned DestReg, unsigned SrcReg, const TargetRegisterClass *DestRC, const TargetRegisterClass *SrcRC) const
bool isMoveInstr (const MachineInstr &MI, unsigned &SrcReg, unsigned &DstReg, unsigned &SrcSubIdx, unsigned &DstSubIdx) const
virtual void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC) const
virtual void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC) const
virtual bool spillCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI) const
virtual bool restoreCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI) const
virtual unsigned InsertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl< MachineOperand > &Cond) const


Detailed Description

Definition at line 38 of file MSP430InstrInfo.h.


Constructor & Destructor Documentation

MSP430InstrInfo::MSP430InstrInfo ( MSP430TargetMachine &  TM  )  [explicit]

Definition at line 28 of file MSP430InstrInfo.cpp.


Member Function Documentation

virtual const TargetRegisterInfo& llvm::MSP430InstrInfo::getRegisterInfo (  )  const [inline, virtual]

getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As such, whenever a client has an instance of instruction info, it should always be able to get register info as well (through this method).

Definition at line 48 of file MSP430InstrInfo.h.

Referenced by llvm::MSP430TargetMachine::getRegisterInfo().

bool MSP430InstrInfo::copyRegToReg ( MachineBasicBlock &  MBB,
MachineBasicBlock::iterator  MI,
unsigned  DestReg,
unsigned  SrcReg,
const TargetRegisterClass *  DestRC,
const TargetRegisterClass *  SrcRC 
) const [virtual]

copyRegToReg - Emit instructions to copy between a pair of registers. It returns false if the target does not how to copy between the specified registers.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 68 of file MSP430InstrInfo.cpp.

References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), and llvm::DebugLoc::getUnknownLoc().

bool MSP430InstrInfo::isMoveInstr ( const MachineInstr &  MI,
unsigned &  SrcReg,
unsigned &  DstReg,
unsigned &  SrcSubIdx,
unsigned &  DstSubIdx 
) const [virtual]

Return true if the instruction is a register to register move and return the source and dest operands and their sub-register indices by reference.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 94 of file MSP430InstrInfo.cpp.

References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and llvm::MachineOperand::isReg().

void MSP430InstrInfo::storeRegToStackSlot ( MachineBasicBlock &  MBB,
MachineBasicBlock::iterator  MI,
unsigned  SrcReg,
bool  isKill,
int  FrameIndex,
const TargetRegisterClass *  RC 
) const [virtual]

storeRegToStackSlot - Store the specified register of the given register class to the specified stack frame index. The store instruction is to be added to the given machine basic block before the specified machine instruction. If isKill is true, the register operand is the last use and must be marked kill.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 32 of file MSP430InstrInfo.cpp.

References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::getKillRegState(), llvm::DebugLoc::getUnknownLoc(), and llvm_unreachable.

void MSP430InstrInfo::loadRegFromStackSlot ( MachineBasicBlock &  MBB,
MachineBasicBlock::iterator  MI,
unsigned  DestReg,
int  FrameIndex,
const TargetRegisterClass *  RC 
) const [virtual]

loadRegFromStackSlot - Load the specified register of the given register class from the specified stack frame index. The load instruction is to be added to the given machine basic block before the specified machine instruction.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 51 of file MSP430InstrInfo.cpp.

References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::DebugLoc::getUnknownLoc(), and llvm_unreachable.

bool MSP430InstrInfo::spillCalleeSavedRegisters ( MachineBasicBlock &  MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI 
) const [virtual]

spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of store instructions via storeRegToStackSlot(). Returns false otherwise.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 115 of file MSP430InstrInfo.cpp.

References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::getInfo(), llvm::MachineBasicBlock::getParent(), llvm::DebugLoc::getUnknownLoc(), llvm::RegState::Kill, MF, MFI, Reg, and llvm::MSP430MachineFunctionInfo::setCalleeSavedFrameSize().

bool MSP430InstrInfo::restoreCalleeSavedRegisters ( MachineBasicBlock &  MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI 
) const [virtual]

restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of load instructions via loadRegToStackSlot(). Returns false otherwise.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 139 of file MSP430InstrInfo.cpp.

References llvm::BuildMI(), llvm::MachineBasicBlock::end(), and llvm::DebugLoc::getUnknownLoc().

unsigned MSP430InstrInfo::InsertBranch ( MachineBasicBlock &  MBB,
MachineBasicBlock *  TBB,
MachineBasicBlock *  FBB,
const SmallVectorImpl< MachineOperand > &  Cond 
) const [virtual]

InsertBranch - Insert branch code into the end of the specified MachineBasicBlock. The operands to this method are the same as those returned by AnalyzeBranch. This is only invoked in cases where AnalyzeBranch returns success. It returns the number of instructions inserted.

It is also invoked by tail merging to add unconditional branches in cases where AnalyzeBranch doesn't apply because there was no original branch to analyze. At least this much must be implemented, else tail merging needs to be disabled.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 155 of file MSP430InstrInfo.cpp.

References llvm::MachineInstrBuilder::addMBB(), llvm::BuildMI(), llvm::SmallVectorImpl< T >::empty(), llvm::DebugLoc::getUnknownLoc(), llvm_unreachable, and llvm::SmallVectorImpl< T >::size().


The documentation for this class was generated from the following files: