LLVM API Documentation

llvm::PPCInstrInfo Class Reference

#include <PPCInstrInfo.h>

Inheritance diagram for llvm::PPCInstrInfo:

Inheritance graph
[legend]
Collaboration diagram for llvm::PPCInstrInfo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PPCInstrInfo (PPCTargetMachine &TM)
virtual const MRegisterInfogetRegisterInfo () const
virtual const TargetRegisterClassgetPointerRegClass () 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 MachineInstrcommuteInstruction (MachineInstr *MI) const
virtual void insertNoop (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const

Static Public Member Functions

static unsigned invertPPCBranchOpcode (unsigned Opcode)

Detailed Description

Definition at line 64 of file PPCInstrInfo.h.


Constructor & Destructor Documentation

PPCInstrInfo::PPCInstrInfo ( PPCTargetMachine TM  ) 

Definition at line 21 of file PPCInstrInfo.cpp.


Member Function Documentation

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 74 of file PPCInstrInfo.h.

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

const TargetRegisterClass * PPCInstrInfo::getPointerRegClass (  )  const [virtual]

getPointerRegClass - Return the register class to use to hold pointers. This is used for addressing modes.

Reimplemented from llvm::TargetInstrInfo.

Definition at line 27 of file PPCInstrInfo.cpp.

References llvm::PPCTargetMachine::getSubtargetImpl(), and llvm::PPCSubtarget::isPPC64().

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 35 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, OR, and llvm::ISD::VOR.

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 93 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.

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 111 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.

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 131 of file PPCInstrInfo.cpp.

References llvm::TargetInstrInfo::commuteInstruction(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and MI.

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 161 of file PPCInstrInfo.cpp.

References llvm::BuildMI(), and MBB.

static unsigned llvm::PPCInstrInfo::invertPPCBranchOpcode ( unsigned  Opcode  )  [inline, static]

Definition at line 97 of file PPCInstrInfo.h.


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