LLVM API Documentation

llvm::TargetInstrInfoImpl Class Reference

#include <TargetInstrInfo.h>

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

List of all members.

Public Member Functions

virtual MachineInstr * commuteInstruction (MachineInstr *MI, bool NewMI=false) const
virtual bool CommuteChangesDestination (MachineInstr *MI, unsigned &OpIdx) const
virtual bool PredicateInstruction (MachineInstr *MI, const SmallVectorImpl< MachineOperand > &Pred) const
virtual void reMaterialize (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, const MachineInstr *Orig) const
virtual unsigned GetFunctionSizeInBytes (const MachineFunction &MF) const

Protected Member Functions

 TargetInstrInfoImpl (const TargetInstrDesc *desc, unsigned NumOpcodes)


Detailed Description

TargetInstrInfoImpl - This is the default implementation of TargetInstrInfo, which just provides a couple of default implementations for various methods. This separated out because it is implemented in libcodegen, not in libtarget.

Definition at line 465 of file TargetInstrInfo.h.


Constructor & Destructor Documentation

llvm::TargetInstrInfoImpl::TargetInstrInfoImpl ( const TargetInstrDesc *  desc,
unsigned  NumOpcodes 
) [inline, protected]

Definition at line 467 of file TargetInstrInfo.h.


Member Function Documentation

MachineInstr * TargetInstrInfoImpl::commuteInstruction ( MachineInstr *  MI,
bool  NewMI = false 
) 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.

If NewMI is true, then a new machine instruction must be created.

Implements llvm::TargetInstrInfo.

Reimplemented in llvm::PPCInstrInfo, and llvm::X86InstrInfo.

Definition at line 25 of file TargetInstrInfoImpl.cpp.

References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getDesc(), llvm::MachineInstr::getOperand(), llvm::TargetInstrDesc::getOperandConstraint(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), MF, llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setReg(), and llvm::TOI::TIED_TO.

Referenced by llvm::X86InstrInfo::commuteInstruction(), and llvm::PPCInstrInfo::commuteInstruction().

bool TargetInstrInfoImpl::CommuteChangesDestination ( MachineInstr *  MI,
unsigned &  OpIdx 
) const [virtual]

CommuteChangesDestination - Return true if commuting the specified instruction will also changes the destination operand. Also return the current operand index of the would be new destination register by reference. This can happen when the commutable instruction is also a two-address instruction.

Implements llvm::TargetInstrInfo.

Definition at line 67 of file TargetInstrInfoImpl.cpp.

References llvm::MachineInstr::getDesc(), llvm::MachineInstr::getOperand(), llvm::TargetInstrDesc::getOperandConstraint(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), and llvm::TOI::TIED_TO.

bool TargetInstrInfoImpl::PredicateInstruction ( MachineInstr *  MI,
const SmallVectorImpl< MachineOperand > &  Pred 
) const [virtual]

void TargetInstrInfoImpl::reMaterialize ( MachineBasicBlock &  MBB,
MachineBasicBlock::iterator  MI,
unsigned  DestReg,
const MachineInstr *  Orig 
) const [virtual]

reMaterialize - Re-issue the specified 'original' instruction at the specific location targeting a new destination register.

Implements llvm::TargetInstrInfo.

Reimplemented in llvm::ARMInstrInfo, and llvm::X86InstrInfo.

Definition at line 108 of file TargetInstrInfoImpl.cpp.

References llvm::MachineFunction::CloneMachineInstr(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineBasicBlock::insert(), MI, and llvm::MachineOperand::setReg().

unsigned TargetInstrInfoImpl::GetFunctionSizeInBytes ( const MachineFunction &  MF  )  const [virtual]


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