LLVM API Documentation
#include <PPCInstrInfo.h>
Inheritance diagram for llvm::PPCInstrInfo:
Public Member Functions | |
PPCInstrInfo () | |
virtual const MRegisterInfo & | getRegisterInfo () const |
virtual bool | isMoveInstr (const MachineInstr &MI, unsigned &sourceReg, unsigned &destReg) const |
unsigned | isLoadFromStackSlot (MachineInstr *MI, int &FrameIndex) const |
unsigned | isStoreToStackSlot (MachineInstr *MI, int &FrameIndex) const |
virtual MachineInstr * | commuteInstruction (MachineInstr *MI) const |
virtual void | insertNoop (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const |
Static Public Member Functions | |
static unsigned | invertPPCBranchOpcode (unsigned Opcode) |
Definition at line 64 of file PPCInstrInfo.h.
PPCInstrInfo::PPCInstrInfo | ( | ) |
Definition at line 21 of file PPCInstrInfo.cpp.
MachineInstr * PPCInstrInfo::commuteInstruction | ( | MachineInstr * | MI | ) | const [virtual] |
commuteInstruction - If a target has any instructions that are commutable, but require converting to a different instruction or making non-trivial changes to commute them, this method can overloaded to do this. The default implementation of this method simply swaps the first two operands of MI and returns it.
If a target wants to make more aggressive changes, they can construct and return a new machine instruction. If an instruction cannot commute, it can also return null.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 120 of file PPCInstrInfo.cpp.
References llvm::TargetInstrInfo::commuteInstruction(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and MI.
virtual const MRegisterInfo& llvm::PPCInstrInfo::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 73 of file PPCInstrInfo.h.
Referenced by llvm::PPCTargetMachine::getRegisterInfo().
void PPCInstrInfo::insertNoop | ( | MachineBasicBlock & | MBB, | |
MachineBasicBlock::iterator | MI | |||
) | const [virtual] |
insertNoop - Insert a noop into the instruction stream at the specified point.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 150 of file PPCInstrInfo.cpp.
References llvm::BuildMI(), and MBB.
static unsigned llvm::PPCInstrInfo::invertPPCBranchOpcode | ( | unsigned | Opcode | ) | [inline, static] |
Definition at line 93 of file PPCInstrInfo.h.
unsigned PPCInstrInfo::isLoadFromStackSlot | ( | MachineInstr * | MI, | |
int & | FrameIndex | |||
) | const [virtual] |
isLoadFromStackSlot - If the specified machine instruction is a direct load from a stack slot, return the virtual or physical register number of the destination along with the FrameIndex of the loaded stack slot. If not, return 0. This predicate must return 0 if the instruction has any side effects other than loading from the stack slot.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 82 of file PPCInstrInfo.cpp.
References llvm::MachineOperand::getFrameIndex(), llvm::MachineOperand::getImmedValue(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFrameIndex(), llvm::MachineOperand::isImmediate(), and MI.
bool PPCInstrInfo::isMoveInstr | ( | const MachineInstr & | MI, | |
unsigned & | sourceReg, | |||
unsigned & | destReg | |||
) | const [virtual] |
Return true if the instruction is a register to register move and leave the source and dest operands in the passed parameters.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 24 of file PPCInstrInfo.cpp.
References llvm::MachineOperand::getImmedValue(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isImmediate(), llvm::MachineOperand::isRegister(), MI, and llvm::ISD::VOR.
unsigned PPCInstrInfo::isStoreToStackSlot | ( | MachineInstr * | MI, | |
int & | FrameIndex | |||
) | const [virtual] |
isStoreToStackSlot - If the specified machine instruction is a direct store to a stack slot, return the virtual or physical register number of the source reg along with the FrameIndex of the loaded stack slot. If not, return 0. This predicate must return 0 if the instruction has any side effects other than storing to the stack slot.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 100 of file PPCInstrInfo.cpp.
References llvm::MachineOperand::getFrameIndex(), llvm::MachineOperand::getImmedValue(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFrameIndex(), llvm::MachineOperand::isImmediate(), and MI.