LLVM API Documentation
#include <X86InstrInfo.h>
Inheritance diagram for llvm::X86InstrInfo:
Public Member Functions | |
X86InstrInfo (X86TargetMachine &tm) | |
virtual const MRegisterInfo & | getRegisterInfo () const |
bool | isMoveInstr (const MachineInstr &MI, unsigned &sourceReg, unsigned &destReg) const |
unsigned | isLoadFromStackSlot (MachineInstr *MI, int &FrameIndex) const |
unsigned | isStoreToStackSlot (MachineInstr *MI, int &FrameIndex) const |
virtual MachineInstr * | convertToThreeAddress (MachineInstr *TA) const |
virtual MachineInstr * | commuteInstruction (MachineInstr *MI) const |
virtual void | insertGoto (MachineBasicBlock &MBB, MachineBasicBlock &TMBB) const |
virtual MachineBasicBlock::iterator | reverseBranchCondition (MachineBasicBlock::iterator MI) const |
unsigned char | getBaseOpcodeFor (unsigned Opcode) const |
Definition at line 171 of file X86InstrInfo.h.
X86InstrInfo::X86InstrInfo | ( | X86TargetMachine & | tm | ) |
Definition at line 23 of file X86InstrInfo.cpp.
virtual const MRegisterInfo& llvm::X86InstrInfo::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 181 of file X86InstrInfo.h.
Referenced by llvm::X86TargetMachine::getRegisterInfo().
bool X86InstrInfo::isMoveInstr | ( | const MachineInstr & | MI, | |
unsigned & | sourceReg, | |||
unsigned & | destReg | |||
) | const [virtual] |
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 29 of file X86InstrInfo.cpp.
References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isRegister(), and MI.
unsigned X86InstrInfo::isLoadFromStackSlot | ( | 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 53 of file X86InstrInfo.cpp.
References llvm::MachineOperand::getFrameIndex(), llvm::MachineOperand::getImmedValue(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFrameIndex(), llvm::MachineOperand::isImmediate(), llvm::MachineOperand::isRegister(), and MI.
unsigned X86InstrInfo::isStoreToStackSlot | ( | 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 80 of file X86InstrInfo.cpp.
References llvm::MachineOperand::getFrameIndex(), llvm::MachineOperand::getImmedValue(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isFrameIndex(), llvm::MachineOperand::isImmediate(), llvm::MachineOperand::isRegister(), and MI.
MachineInstr * X86InstrInfo::convertToThreeAddress | ( | MachineInstr * | TA | ) | 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 a true three-address instruction 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 new instruction.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 118 of file X86InstrInfo.cpp.
References A, llvm::addFullAddress(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::addRegOffset(), llvm::addRegReg(), B, llvm::BuildMI(), C, Dest, llvm::MachineOperand::getImmedValue(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getSubtarget(), llvm::X86AddressMode::IndexReg, llvm::MachineOperand::isImmediate(), M, MI, llvm::X86AddressMode::Scale, Src, and Subtarget.
MachineInstr * X86InstrInfo::commuteInstruction | ( | MachineInstr * | MI | ) | const [virtual] |
commuteInstruction - We have a few instructions that must be hacked on to commute them.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 208 of file X86InstrInfo.cpp.
References A, llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), B, llvm::BuildMI(), C, llvm::TargetInstrInfo::commuteInstruction(), llvm::MachineOperand::getImmedValue(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and MI.
void X86InstrInfo::insertGoto | ( | MachineBasicBlock & | MBB, | |
MachineBasicBlock & | TMBB | |||
) | const [virtual] |
Insert a goto (unconditional branch) sequence to TMBB, at the end of MBB
Reimplemented from llvm::TargetInstrInfo.
Definition at line 235 of file X86InstrInfo.cpp.
References llvm::BuildMI(), llvm::MachineBasicBlock::end(), and MBB.
MachineBasicBlock::iterator X86InstrInfo::reverseBranchCondition | ( | MachineBasicBlock::iterator | MI | ) | const [virtual] |
Reverses the branch condition of the MachineInstr pointed by MI. The instruction is replaced and the new MI is returned.
Reimplemented from llvm::TargetInstrInfo.
Definition at line 241 of file X86InstrInfo.cpp.
References llvm::BuildMI(), llvm::MachineBasicBlock::erase(), llvm::MachineBasicBlock::getParent(), llvm::TargetInstrInfo::isBranch(), and MBB.
unsigned char llvm::X86InstrInfo::getBaseOpcodeFor | ( | unsigned | Opcode | ) | const [inline] |
Definition at line 222 of file X86InstrInfo.h.
References llvm::TargetInstrInfo::get(), llvm::X86II::OpcodeShift, and llvm::TargetInstrDescriptor::TSFlags.