LLVM API Documentation
#include <SPUInstrInfo.h>
Definition at line 23 of file SPUInstrInfo.h.
| SPUInstrInfo::SPUInstrInfo | ( | SPUTargetMachine & | tm | ) | [explicit] |
Definition at line 51 of file SPUInstrInfo.cpp.
| MachineInstr * SPUInstrInfo::foldMemoryOperandImpl | ( | MachineFunction & | MF, | |
| MachineInstr * | MI, | |||
| const SmallVectorImpl< unsigned > & | Ops, | |||
| int | FrameIndex | |||
| ) | const [protected, virtual] |
foldMemoryOperand - SPU, like PPC, can only fold spills into copy instructions, turning them into load/store instructions.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 390 of file SPUInstrInfo.cpp.
References llvm::addFrameReference(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::RegState::Define, llvm::getDeadRegState(), llvm::MachineInstr::getDebugLoc(), llvm::getKillRegState(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::getUndefRegState(), llvm::Attribute::InReg, llvm::MachineOperand::isDead(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isUndef(), llvm::SPUFrameInfo::maxFrameOffset(), and llvm::SmallVectorImpl< T >::size().
| virtual MachineInstr* llvm::SPUInstrInfo::foldMemoryOperandImpl | ( | MachineFunction & | MF, | |
| MachineInstr * | MI, | |||
| const SmallVectorImpl< unsigned > & | Ops, | |||
| MachineInstr * | LoadMI | |||
| ) | const [inline, protected, 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.
Definition at line 32 of file SPUInstrInfo.h.
| virtual const SPURegisterInfo& llvm::SPUInstrInfo::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 46 of file SPUInstrInfo.h.
Referenced by llvm::SPUTargetMachine::getRegisterInfo().
| bool SPUInstrInfo::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.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 58 of file SPUInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isImm(), and llvm::MachineOperand::isReg().
| unsigned SPUInstrInfo::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 202 of file SPUInstrInfo.cpp.
References llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFI(), and llvm::MachineOperand::isImm().
| unsigned SPUInstrInfo::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 228 of file SPUInstrInfo.cpp.
References llvm::MachineOperand::getIndex(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFI(), and llvm::MachineOperand::isImm().
| bool SPUInstrInfo::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.
Definition at line 254 of file SPUInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), and llvm::DebugLoc::getUnknownLoc().
| void SPUInstrInfo::storeRegToStackSlot | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock::iterator | MBBI, | |||
| unsigned | SrcReg, | |||
| bool | isKill, | |||
| int | FrameIndex, | |||
| const TargetRegisterClass * | RC | |||
| ) | const [virtual] |
Store a register to a stack slot, based on its register class.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 293 of file SPUInstrInfo.cpp.
References llvm::addFrameReference(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::getKillRegState(), llvm::DebugLoc::getUnknownLoc(), llvm_unreachable, and llvm::SPUFrameInfo::maxFrameOffset().
| void SPUInstrInfo::loadRegFromStackSlot | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock::iterator | MBBI, | |||
| unsigned | DestReg, | |||
| int | FrameIndex, | |||
| const TargetRegisterClass * | RC | |||
| ) | const [virtual] |
Load a register from a stack slot, based on its register class.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 327 of file SPUInstrInfo.cpp.
References llvm::addFrameReference(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::DebugLoc::getUnknownLoc(), llvm_unreachable, and llvm::SPUFrameInfo::maxFrameOffset().
| bool SPUInstrInfo::canFoldMemoryOperand | ( | const MachineInstr * | MI, | |
| const SmallVectorImpl< unsigned > & | Ops | |||
| ) | const [virtual] |
Return true if the specified load or store can be folded.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 361 of file SPUInstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and llvm::SmallVectorImpl< T >::size().
| bool SPUInstrInfo::BlockHasNoFallThrough | ( | const MachineBasicBlock & | MBB | ) | const [virtual] |
Return true if the specified block does not fall through.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 584 of file SPUInstrInfo.cpp.
References llvm::MachineBasicBlock::back(), llvm::MachineBasicBlock::empty(), and isUncondBranch().
| bool SPUInstrInfo::ReverseBranchCondition | ( | SmallVectorImpl< MachineOperand > & | Cond | ) | const [virtual] |
Reverses a branch's condition, returning false on success.
The incoming opcode
The reversed condition opcode
Reimplemented from llvm::TargetInstrInfo.
Definition at line 589 of file SPUInstrInfo.cpp.
| bool SPUInstrInfo::AnalyzeBranch | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock *& | TBB, | |||
| MachineBasicBlock *& | FBB, | |||
| SmallVectorImpl< MachineOperand > & | Cond, | |||
| bool | AllowModify | |||
| ) | const [virtual] |
Branch analysis.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 447 of file SPUInstrInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::cerr(), llvm::MachineOperand::CreateImm(), DEBUG, llvm::MachineInstr::dump(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), isCondBranch(), isUncondBranch(), llvm::TargetInstrInfo::isUnpredicatedTerminator(), and llvm::SmallVectorImpl< T >::push_back().
| unsigned SPUInstrInfo::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 511 of file SPUInstrInfo.cpp.
References llvm::MachineBasicBlock::begin(), llvm::cerr(), DEBUG, llvm::MachineBasicBlock::end(), isCondBranch(), and isUncondBranch().
| unsigned SPUInstrInfo::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 539 of file SPUInstrInfo.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::ISD::BR, llvm::BuildMI(), llvm::cerr(), DEBUG, llvm::SmallVectorImpl< T >::empty(), llvm::DebugLoc::getUnknownLoc(), and llvm::SmallVectorImpl< T >::size().