LLVM API Documentation
#include <TargetInstrInfo.h>


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) | |
Definition at line 461 of file TargetInstrInfo.h.
| llvm::TargetInstrInfoImpl::TargetInstrInfoImpl | ( | const TargetInstrDesc * | desc, | |
| unsigned | NumOpcodes | |||
| ) | [inline, protected] |
Definition at line 463 of file TargetInstrInfo.h.
| 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::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] |
PredicateInstruction - Convert the instruction into a predicated instruction. It returns true if the operation was successful.
Implements llvm::TargetInstrInfo.
Reimplemented in llvm::ARMInstrInfo.
Definition at line 82 of file TargetInstrInfoImpl.cpp.
References llvm::MachineInstr::getDesc(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isMBB(), llvm::TargetInstrDesc::isPredicable(), llvm::TargetOperandInfo::isPredicate(), llvm::MachineOperand::isReg(), MadeChange, llvm::TargetInstrDesc::OpInfo, llvm::MachineOperand::setImm(), llvm::MachineOperand::setMBB(), and llvm::MachineOperand::setReg().
| 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] |
GetFunctionSizeInBytes - Returns the size of the specified MachineFunction.
Implements llvm::TargetInstrInfo.
Definition at line 118 of file TargetInstrInfoImpl.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), E, llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::TargetInstrInfo::GetInstSizeInBytes(), I, MBB, and MBBI.
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.