LLVM API Documentation
#include <ARMBaseInstrInfo.h>
Definition at line 159 of file ARMBaseInstrInfo.h.
| ARMBaseInstrInfo::ARMBaseInstrInfo | ( | ) | [explicit, protected] |
Definition at line 33 of file ARMBaseInstrInfo.cpp.
Implemented in llvm::ARMInstrInfo, llvm::Thumb1InstrInfo, and llvm::Thumb2InstrInfo.
Referenced by convertToThreeAddress().
| virtual bool llvm::ARMBaseInstrInfo::BlockHasNoFallThrough | ( | const MachineBasicBlock & | MBB | ) | const [pure virtual] |
BlockHasNoFallThrough - Return true if the specified block does not fall-through into its successor block. This is primarily used when a branch is unanalyzable. It is useful for things like unconditional indirect branches (jump tables).
Reimplemented from llvm::TargetInstrInfo.
Implemented in llvm::ARMInstrInfo, llvm::Thumb1InstrInfo, and llvm::Thumb2InstrInfo.
| MachineInstr * ARMBaseInstrInfo::convertToThreeAddress | ( | MachineFunction::iterator & | MFI, | |
| MachineBasicBlock::iterator & | MBBI, | |||
| LiveVariables * | LV | |||
| ) | const [virtual] |
convertToThreeAddress - This method must be implemented by targets that set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target may be able to convert a two-address instruction into one or more true three-address instructions on demand. This allows the X86 target (for example) to convert ADD and SHL instructions into LEA instructions if they would require register copies due to two-addressness.
This method returns a null pointer if the transformation cannot be performed, otherwise it returns the last new instruction.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 38 of file ARMBaseInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::ARMII::AddrMode2, llvm::ARMII::AddrMode3, llvm::ARMII::AddrModeMask, llvm::LiveVariables::addVirtualRegisterDead(), llvm::LiveVariables::addVirtualRegisterKilled(), Base, BaseReg, llvm::BuildMI(), EnableARM3Addr, llvm::ARM_AM::getAM2Offset(), llvm::ARM_AM::getAM2Op(), llvm::ARM_AM::getAM2ShiftOpc(), llvm::ARM_AM::getAM3Offset(), llvm::ARM_AM::getAM3Op(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getDesc(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getNumOperands(), llvm::TargetInstrDesc::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), llvm::ARM_AM::getSOImmVal(), llvm::ARM_AM::getSORegOpc(), getUnindexedOpcode(), llvm::LiveVariables::getVarInfo(), llvm::ARMII::IndexModeMask, llvm::ARMII::IndexModePost, llvm::ARMII::IndexModePre, llvm::ARMII::IndexModeShift, llvm::MachineOperand::isDead(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::LiveVariables::VarInfo::Kills, llvm::TargetInstrDesc::mayStore(), MF, MI, Offset, Pred, llvm::MachineInstr::readsRegister(), Reg, llvm::LiveVariables::VarInfo::removeKill(), llvm::MachineOperand::setIsDead(), llvm::ARM_AM::sub, and llvm::TargetInstrDesc::TSFlags.
| virtual const ARMBaseRegisterInfo& llvm::ARMBaseInstrInfo::getRegisterInfo | ( | ) | const [pure virtual] |
Implemented in llvm::ARMInstrInfo, llvm::Thumb1InstrInfo, and llvm::Thumb2InstrInfo.
Referenced by llvm::ThumbTargetMachine::getRegisterInfo().
| bool ARMBaseInstrInfo::AnalyzeBranch | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock *& | TBB, | |||
| MachineBasicBlock *& | FBB, | |||
| SmallVectorImpl< MachineOperand > & | Cond, | |||
| bool | AllowModify | |||
| ) | const [virtual] |
AnalyzeBranch - Analyze the branching code at the end of MBB, returning true if it cannot be understood (e.g. it's a switch dispatch or isn't implemented for a target). Upon success, this returns false and returns with the following information in various cases:
1. If this block ends with no branches (it just falls through to its succ) just return false, leaving TBB/FBB null. 2. If this block ends with only an unconditional branch, it sets TBB to be the destination block. 3. If this block ends with an conditional branch and it falls through to a successor block, it sets TBB to be the branch destination block and a list of operands that evaluate the condition. These operands can be passed to other TargetInstrInfo methods to create new branches. 4. If this block ends with a conditional branch followed by an unconditional branch, it returns the 'true' destination in TBB, the 'false' destination in FBB, and a list of operands that evaluate the condition. These operands can be passed to other TargetInstrInfo methods to create new branches.
Note that RemoveBranch and InsertBranch must be implemented to support cases where this method returns success.
If AllowModify is true, then this routine is allowed to modify the basic block (e.g. delete instructions after the unconditional branch).
Reimplemented from llvm::TargetInstrInfo.
Definition at line 191 of file ARMBaseInstrInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::isCondBranchOpcode(), llvm::isJumpTableBranchOpcode(), llvm::isUncondBranchOpcode(), llvm::TargetInstrInfo::isUnpredicatedTerminator(), and llvm::SmallVectorImpl< T >::push_back().
| unsigned ARMBaseInstrInfo::RemoveBranch | ( | MachineBasicBlock & | MBB | ) | const [virtual] |
RemoveBranch - Remove the branching code at the end of the specific MBB. This is only invoked in cases where AnalyzeBranch returns success. It returns the number of instructions that were removed.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 263 of file ARMBaseInstrInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), llvm::isCondBranchOpcode(), and llvm::isUncondBranchOpcode().
| unsigned ARMBaseInstrInfo::InsertBranch | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock * | TBB, | |||
| MachineBasicBlock * | FBB, | |||
| const SmallVectorImpl< MachineOperand > & | Cond | |||
| ) | const [virtual] |
InsertBranch - Insert branch code into the end of the specified MachineBasicBlock. The operands to this method are the same as those returned by AnalyzeBranch. This is only invoked in cases where AnalyzeBranch returns success. It returns the number of instructions inserted.
It is also invoked by tail merging to add unconditional branches in cases where AnalyzeBranch doesn't apply because there was no original branch to analyze. At least this much must be implemented, else tail merging needs to be disabled.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 287 of file ARMBaseInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), AFI, llvm::BuildMI(), llvm::SmallVectorImpl< T >::empty(), llvm::MachineFunction::getInfo(), llvm::MachineBasicBlock::getParent(), llvm::DebugLoc::getUnknownLoc(), llvm::ARMFunctionInfo::isThumb2Function(), llvm::ARMFunctionInfo::isThumbFunction(), and llvm::SmallVectorImpl< T >::size().
| bool ARMBaseInstrInfo::ReverseBranchCondition | ( | SmallVectorImpl< MachineOperand > & | Cond | ) | const [virtual] |
ReverseBranchCondition - Reverses the branch condition of the specified condition list, returning false on success and true if it cannot be reversed.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 321 of file ARMBaseInstrInfo.cpp.
References llvm::ARMCC::getOppositeCondition().
| bool llvm::ARMBaseInstrInfo::isPredicated | ( | const MachineInstr * | MI | ) | const [inline, virtual] |
isPredicated - Returns true if the instruction is already predicated.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 191 of file ARMBaseInstrInfo.h.
References llvm::ARMCC::AL, llvm::MachineInstr::findFirstPredOperandIdx(), llvm::MachineOperand::getImm(), and llvm::MachineInstr::getOperand().
| ARMCC::CondCodes llvm::ARMBaseInstrInfo::getPredicate | ( | const MachineInstr * | MI | ) | const [inline] |
Definition at line 196 of file ARMBaseInstrInfo.h.
References llvm::ARMCC::AL, llvm::MachineInstr::findFirstPredOperandIdx(), llvm::MachineOperand::getImm(), and llvm::MachineInstr::getOperand().
Referenced by getPredicate().
| bool ARMBaseInstrInfo::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.
Reimplemented from llvm::TargetInstrInfoImpl.
Definition at line 328 of file ARMBaseInstrInfo.cpp.
References llvm::MachineInstr::addOperand(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), llvm::MachineInstr::findFirstPredOperandIdx(), llvm::getMatchingCondBranchOpcode(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::isUncondBranchOpcode(), llvm::MachineInstr::setDesc(), llvm::MachineOperand::setImm(), and llvm::MachineOperand::setReg().
| bool ARMBaseInstrInfo::SubsumesPredicate | ( | const SmallVectorImpl< MachineOperand > & | Pred1, | |
| const SmallVectorImpl< MachineOperand > & | Pred2 | |||
| ) | const [virtual] |
SubsumesPredicate - Returns true if the first specified predicate subsumes the second, e.g. GE subsumes GT.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 349 of file ARMBaseInstrInfo.cpp.
References llvm::ARMCC::AL, llvm::ARMCC::EQ, llvm::ARMCC::GE, llvm::ARMCC::GT, llvm::ARMCC::HI, llvm::ARMCC::HS, llvm::ARMCC::LE, llvm::ARMCC::LO, llvm::ARMCC::LS, llvm::ARMCC::LT, and llvm::SmallVectorImpl< T >::size().
| bool ARMBaseInstrInfo::DefinesPredicate | ( | MachineInstr * | MI, | |
| std::vector< MachineOperand > & | Pred | |||
| ) | const [virtual] |
DefinesPredicate - If the specified instruction defines any predicate or condition code register(s) used for predication, returns true as well as the definition predicate(s) by reference.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 375 of file ARMBaseInstrInfo.cpp.
References llvm::MachineInstr::getDesc(), llvm::TargetInstrDesc::getImplicitDefs(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::TargetInstrDesc::hasOptionalDef(), and llvm::MachineOperand::isReg().
| unsigned ARMBaseInstrInfo::GetInstSizeInBytes | ( | const MachineInstr * | MI | ) | const [virtual] |
GetInstSize - Returns the size of the specified MachineInstr.
GetInstSize - Return the size of the specified MachineInstr.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 405 of file ARMBaseInstrInfo.cpp.
References llvm::TargetInstrInfo::DBG_LABEL, llvm::TargetInstrInfo::DECLARE, llvm::TargetInstrInfo::EH_LABEL, llvm::MachineInstr::getDesc(), llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::TargetInstrInfo::getInlineAsmLength(), llvm::MachineFunction::getJumpTableInfo(), llvm::MachineJumpTableInfo::getJumpTables(), getNumJTEntries(), llvm::TargetInstrDesc::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getSymbolName(), llvm::MachineFunction::getTarget(), llvm::TargetMachine::getTargetAsmInfo(), llvm::TargetInstrInfo::IMPLICIT_DEF, llvm::ISD::INLINEASM, llvm::MachineInstr::isLabel(), llvm::TargetInstrDesc::isPredicable(), JT, JTI, llvm_unreachable, MBB, MF, llvm::ARMII::Size2Bytes, llvm::ARMII::Size4Bytes, llvm::ARMII::Size8Bytes, llvm::ARMII::SizeMask, llvm::ARMII::SizeShift, llvm::ARMII::SizeSpecial, TAI, and llvm::TargetInstrDesc::TSFlags.
| bool ARMBaseInstrInfo::isMoveInstr | ( | const MachineInstr & | MI, | |
| unsigned & | SrcReg, | |||
| unsigned & | DstReg, | |||
| unsigned & | SrcSubIdx, | |||
| unsigned & | DstSubIdx | |||
| ) | const [virtual] |
Return true if the instruction is a register to register move and return the source and dest operands and their sub-register indices by reference.
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 494 of file ARMBaseInstrInfo.cpp.
References llvm::MachineInstr::getDesc(), llvm::TargetInstrDesc::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and llvm::MachineOperand::isReg().
| unsigned ARMBaseInstrInfo::isLoadFromStackSlot | ( | const 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 529 of file ARMBaseInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), and llvm::MachineOperand::isReg().
| unsigned ARMBaseInstrInfo::isStoreToStackSlot | ( | const 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 568 of file ARMBaseInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), and llvm::MachineOperand::isReg().
| bool ARMBaseInstrInfo::copyRegToReg | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock::iterator | MI, | |||
| unsigned | DestReg, | |||
| unsigned | SrcReg, | |||
| const TargetRegisterClass * | DestRC, | |||
| const TargetRegisterClass * | SrcRC | |||
| ) | const [virtual] |
copyRegToReg - Emit instructions to copy between a pair of registers. It returns false if the target does not how to copy between the specified registers.
Reimplemented from llvm::TargetInstrInfo.
Reimplemented in llvm::Thumb1InstrInfo, and llvm::Thumb2InstrInfo.
Definition at line 607 of file ARMBaseInstrInfo.cpp.
References llvm::AddDefaultCC(), llvm::AddDefaultPred(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), and llvm::DebugLoc::getUnknownLoc().
Referenced by llvm::Thumb2InstrInfo::copyRegToReg().
| void ARMBaseInstrInfo::storeRegToStackSlot | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock::iterator | MI, | |||
| unsigned | SrcReg, | |||
| bool | isKill, | |||
| int | FrameIndex, | |||
| const TargetRegisterClass * | RC | |||
| ) | const [virtual] |
storeRegToStackSlot - Store the specified register of the given register class to the specified stack frame index. The store instruction is to be added to the given machine basic block before the specified machine instruction. If isKill is true, the register operand is the last use and must be marked kill.
Reimplemented from llvm::TargetInstrInfo.
Reimplemented in llvm::Thumb1InstrInfo, and llvm::Thumb2InstrInfo.
Definition at line 646 of file ARMBaseInstrInfo.cpp.
References llvm::AddDefaultPred(), llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::getKillRegState(), and llvm::DebugLoc::getUnknownLoc().
Referenced by llvm::Thumb2InstrInfo::storeRegToStackSlot().
| void ARMBaseInstrInfo::loadRegFromStackSlot | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock::iterator | MI, | |||
| unsigned | DestReg, | |||
| int | FrameIndex, | |||
| const TargetRegisterClass * | RC | |||
| ) | const [virtual] |
loadRegFromStackSlot - Load the specified register of the given register class from the specified stack frame index. The load instruction is to be added to the given machine basic block before the specified machine instruction.
Reimplemented from llvm::TargetInstrInfo.
Reimplemented in llvm::Thumb1InstrInfo, and llvm::Thumb2InstrInfo.
Definition at line 673 of file ARMBaseInstrInfo.cpp.
References llvm::AddDefaultPred(), llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), and llvm::DebugLoc::getUnknownLoc().
Referenced by llvm::Thumb2InstrInfo::loadRegFromStackSlot().
| bool ARMBaseInstrInfo::canFoldMemoryOperand | ( | const MachineInstr * | MI, | |
| const SmallVectorImpl< unsigned > & | Ops | |||
| ) | const [virtual] |
canFoldMemoryOperand - Returns true for the specified load / store if folding is possible.
Reimplemented from llvm::TargetInstrInfo.
Reimplemented in llvm::Thumb1InstrInfo.
Definition at line 820 of file ARMBaseInstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDead(), and llvm::SmallVectorImpl< T >::size().
| MachineInstr * ARMBaseInstrInfo::foldMemoryOperandImpl | ( | MachineFunction & | MF, | |
| MachineInstr * | MI, | |||
| const SmallVectorImpl< unsigned > & | Ops, | |||
| int | FrameIndex | |||
| ) | const [virtual] |
foldMemoryOperandImpl - Target-dependent implementation for foldMemoryOperand. Target-independent code in foldMemoryOperand will take care of adding a MachineMemOperand to the newly created instruction.
Reimplemented from llvm::TargetInstrInfo.
Reimplemented in llvm::Thumb1InstrInfo.
Definition at line 696 of file ARMBaseInstrInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::ARMCC::AL, llvm::BuildMI(), llvm::RegState::Define, llvm::getDeadRegState(), llvm::MachineInstr::getDebugLoc(), llvm::MachineOperand::getImm(), llvm::getKillRegState(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::getUndefRegState(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isUndef(), Pred, and llvm::SmallVectorImpl< T >::size().
| MachineInstr * ARMBaseInstrInfo::foldMemoryOperandImpl | ( | MachineFunction & | MF, | |
| MachineInstr * | MI, | |||
| const SmallVectorImpl< unsigned > & | Ops, | |||
| MachineInstr * | LoadMI | |||
| ) | const [virtual] |
foldMemoryOperandImpl - Target-dependent implementation for foldMemoryOperand. Target-independent code in foldMemoryOperand will take care of adding a MachineMemOperand to the newly created instruction.
Reimplemented from llvm::TargetInstrInfo.
Reimplemented in llvm::Thumb1InstrInfo.
Definition at line 811 of file ARMBaseInstrInfo.cpp.