LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::TargetInstrInfo Class Reference

#include <TargetInstrInfo.h>

Inheritance diagram for llvm::TargetInstrInfo:

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

Collaboration graph
[legend]
List of all members.

Public Types

enum  { PHI = 0 }

Public Member Functions

 TargetInstrInfo (const TargetInstrDescriptor *desc, unsigned NumOpcodes)
virtual ~TargetInstrInfo ()
unsigned getNumOpcodes () const
const TargetInstrDescriptorget (MachineOpCode Opcode) const
const char * getName (MachineOpCode Opcode) const
int getNumOperands (MachineOpCode Opcode) const
InstrSchedClass getSchedClass (MachineOpCode Opcode) const
const unsigned * getImplicitUses (MachineOpCode Opcode) const
const unsigned * getImplicitDefs (MachineOpCode Opcode) const
bool isReturn (MachineOpCode Opcode) const
bool isTwoAddrInstr (MachineOpCode Opcode) const
bool isTerminatorInstr (unsigned Opcode) const
virtual bool isMoveInstr (const MachineInstr &MI, unsigned &sourceReg, unsigned &destReg) const
virtual void insertGoto (MachineBasicBlock &MBB, MachineBasicBlock &TMBB) const
virtual MachineBasicBlock::iterator reverseBranchCondition (MachineBasicBlock::iterator MI) const
unsigned getNumDelaySlots (MachineOpCode Opcode) const
bool isCCInstr (MachineOpCode Opcode) const
bool isNop (MachineOpCode Opcode) const
bool isBranch (MachineOpCode Opcode) const
bool isBarrier (MachineOpCode Opcode) const
bool isCall (MachineOpCode Opcode) const
bool isLoad (MachineOpCode Opcode) const
bool isStore (MachineOpCode Opcode) const
bool hasDelaySlot (unsigned Opcode) const
virtual bool hasResultInterlock (MachineOpCode Opcode) const
virtual int minLatency (MachineOpCode Opcode) const
virtual int maxLatency (MachineOpCode Opcode) const
virtual int getImmedConstantPos (MachineOpCode Opcode) const
virtual bool constantFitsInImmedField (MachineOpCode Opcode, int64_t intValue) const
virtual uint64_t maxImmedConstant (MachineOpCode Opcode, bool &isSignExtended) const

Detailed Description

TargetInstrInfo - Interface to description of machine instructions

Definition at line 86 of file TargetInstrInfo.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
PHI 

Definition at line 98 of file TargetInstrInfo.h.


Constructor & Destructor Documentation

llvm::TargetInstrInfo::TargetInstrInfo const TargetInstrDescriptor desc,
unsigned  NumOpcodes
 

Definition at line 26 of file TargetInstrInfo.cpp.

References llvm::TargetInstrDescriptors.

llvm::TargetInstrInfo::~TargetInstrInfo  )  [virtual]
 

Definition at line 35 of file TargetInstrInfo.cpp.

References llvm::TargetInstrDescriptors.


Member Function Documentation

bool llvm::TargetInstrInfo::constantFitsInImmedField MachineOpCode  Opcode,
int64_t  intValue
const [virtual]
 

Definition at line 39 of file TargetInstrInfo.cpp.

References maxImmedConstant().

Referenced by llvm::SparcV9RegInfo::cpMem2RegMI(), and llvm::SparcV9RegInfo::cpReg2MemMI().

const TargetInstrDescriptor& llvm::TargetInstrInfo::get MachineOpCode  Opcode  )  const [inline]
 

get - Return the machine instruction descriptor that corresponds to the specified instruction opcode.

Definition at line 105 of file TargetInstrInfo.h.

Referenced by llvm::X86InstrInfo::getBaseOpcodeFor(), getImplicitDefs(), getImplicitUses(), getName(), getNumDelaySlots(), getNumOperands(), getSchedClass(), hasDelaySlot(), isBarrier(), isBranch(), isCall(), isCCInstr(), isLoad(), isNop(), isReturn(), isStore(), isTerminatorInstr(), isTwoAddrInstr(), maxImmedConstant(), maxLatency(), minLatency(), and llvm::LiveVariables::runOnMachineFunction().

virtual int llvm::TargetInstrInfo::getImmedConstantPos MachineOpCode  Opcode  )  const [inline, virtual]
 

Reimplemented in llvm::SparcV9InstrInfo.

Definition at line 233 of file TargetInstrInfo.h.

const unsigned* llvm::TargetInstrInfo::getImplicitDefs MachineOpCode  Opcode  )  const [inline]
 

Definition at line 127 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::ImplicitDefs.

const unsigned* llvm::TargetInstrInfo::getImplicitUses MachineOpCode  Opcode  )  const [inline]
 

Definition at line 123 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::ImplicitUses.

const char* llvm::TargetInstrInfo::getName MachineOpCode  Opcode  )  const [inline]
 

Definition at line 110 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::Name.

Referenced by llvm::MachineInstr::print().

unsigned llvm::TargetInstrInfo::getNumDelaySlots MachineOpCode  Opcode  )  const [inline]
 

Definition at line 180 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::numDelaySlots.

Referenced by llvm::ChooseInstructionsForDelaySlots(), llvm::DeleteInstruction(), llvm::FindSlotChoices(), llvm::FindUsefulInstructionsForDelaySlots(), and llvm::ReplaceNopsWithUsefulInstr().

unsigned llvm::TargetInstrInfo::getNumOpcodes  )  const [inline]
 

Definition at line 100 of file TargetInstrInfo.h.

int llvm::TargetInstrInfo::getNumOperands MachineOpCode  Opcode  )  const [inline]
 

Definition at line 114 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::numOperands.

InstrSchedClass llvm::TargetInstrInfo::getSchedClass MachineOpCode  Opcode  )  const [inline]
 

Definition at line 119 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::schedClass.

Referenced by llvm::TargetSchedInfo::getSchedClass().

bool llvm::TargetInstrInfo::hasDelaySlot unsigned  Opcode  )  const [inline]
 

hasDelaySlot - Returns true if the specified instruction has a delay slot which must be filled by the code generator.

Definition at line 211 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_DELAY_SLOT_FLAG.

virtual bool llvm::TargetInstrInfo::hasResultInterlock MachineOpCode  Opcode  )  const [inline, virtual]
 

Reimplemented in llvm::SparcV9InstrInfo.

Definition at line 215 of file TargetInstrInfo.h.

virtual void llvm::TargetInstrInfo::insertGoto MachineBasicBlock MBB,
MachineBasicBlock TMBB
const [inline, virtual]
 

Insert a goto (unconditional branch) sequence to TMBB, at the end of MBB

Reimplemented in llvm::X86InstrInfo.

Definition at line 157 of file TargetInstrInfo.h.

Referenced by ReplaceUsesOfBlockWith().

bool llvm::TargetInstrInfo::isBarrier MachineOpCode  Opcode  )  const [inline]
 

isBarrier - Returns true if the specified instruction stops control flow from executing the instruction immediately following it. Examples include unconditional branches and return instructions.

Definition at line 195 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_BARRIER_FLAG.

bool llvm::TargetInstrInfo::isBranch MachineOpCode  Opcode  )  const [inline]
 

Definition at line 189 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_BRANCH_FLAG.

Referenced by llvm::ChooseInstructionsForDelaySlots(), llvm::NodeCanFillDelaySlot(), and llvm::X86InstrInfo::reverseBranchCondition().

bool llvm::TargetInstrInfo::isCall MachineOpCode  Opcode  )  const [inline]
 

Definition at line 199 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_CALL_FLAG.

Referenced by llvm::LiveRangeInfo::constructLiveRanges().

bool llvm::TargetInstrInfo::isCCInstr MachineOpCode  Opcode  )  const [inline]
 

Definition at line 183 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_CC_FLAG.

bool llvm::TargetInstrInfo::isLoad MachineOpCode  Opcode  )  const [inline]
 

Definition at line 202 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_LOAD_FLAG.

Referenced by llvm::NodeCanFillDelaySlot().

virtual bool llvm::TargetInstrInfo::isMoveInstr const MachineInstr MI,
unsigned &  sourceReg,
unsigned &  destReg
const [inline, virtual]
 

Return true if the instruction is a register to register move and leave the source and dest operands in the passed parameters.

Reimplemented in llvm::PPC32InstrInfo, llvm::PPC64InstrInfo, and llvm::X86InstrInfo.

Definition at line 149 of file TargetInstrInfo.h.

Referenced by llvm::LiveIntervals::runOnMachineFunction().

bool llvm::TargetInstrInfo::isNop MachineOpCode  Opcode  )  const [inline]
 

Definition at line 186 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_NOP_FLAG.

Referenced by llvm::FindUsefulInstructionsForDelaySlots(), and llvm::ReplaceNopsWithUsefulInstr().

bool llvm::TargetInstrInfo::isReturn MachineOpCode  Opcode  )  const [inline]
 

Definition at line 136 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_RET_FLAG.

Referenced by llvm::LiveRangeInfo::constructLiveRanges(), and llvm::SparcV9RegInfo::suggestReg4RetValue().

bool llvm::TargetInstrInfo::isStore MachineOpCode  Opcode  )  const [inline]
 

Definition at line 205 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_STORE_FLAG.

bool llvm::TargetInstrInfo::isTerminatorInstr unsigned  Opcode  )  const [inline]
 

Definition at line 143 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_TERMINATOR_FLAG.

Referenced by llvm::MachineBasicBlock::getFirstTerminator(), and ReplaceUsesOfBlockWith().

bool llvm::TargetInstrInfo::isTwoAddrInstr MachineOpCode  Opcode  )  const [inline]
 

Definition at line 140 of file TargetInstrInfo.h.

References llvm::TargetInstrDescriptor::Flags, get(), and llvm::M_2_ADDR_FLAG.

virtual uint64_t llvm::TargetInstrInfo::maxImmedConstant MachineOpCode  Opcode,
bool &  isSignExtended
const [inline, virtual]
 

Definition at line 249 of file TargetInstrInfo.h.

References get(), llvm::TargetInstrDescriptor::immedIsSignExtended, and llvm::TargetInstrDescriptor::maxImmedConst.

Referenced by constantFitsInImmedField().

virtual int llvm::TargetInstrInfo::maxLatency MachineOpCode  Opcode  )  const [inline, virtual]
 

Definition at line 226 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::latency.

Referenced by llvm::FindUsefulInstructionsForDelaySlots().

virtual int llvm::TargetInstrInfo::minLatency MachineOpCode  Opcode  )  const [inline, virtual]
 

Definition at line 222 of file TargetInstrInfo.h.

References get(), and llvm::TargetInstrDescriptor::latency.

virtual MachineBasicBlock::iterator llvm::TargetInstrInfo::reverseBranchCondition MachineBasicBlock::iterator  MI  )  const [inline, virtual]
 

Reverses the branch condition of the MachineInstr pointed by MI. The instruction is replaced and the new MI is returned.

Reimplemented in llvm::X86InstrInfo.

Definition at line 165 of file TargetInstrInfo.h.

References abort().


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