LLVM API Documentation
#include "X86InstrInfo.h"#include "X86.h"#include "X86GenInstrInfo.inc"#include "X86InstrBuilder.h"#include "X86MachineFunctionInfo.h"#include "X86Subtarget.h"#include "X86TargetMachine.h"#include "llvm/GlobalVariable.h"#include "llvm/DerivedTypes.h"#include "llvm/LLVMContext.h"#include "llvm/ADT/STLExtras.h"#include "llvm/CodeGen/MachineConstantPool.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/LiveVariables.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetOptions.h"#include "llvm/Target/TargetAsmInfo.h"
Go to the source code of this file.
| static bool CanRematLoadWithDispOperand | ( | const MachineOperand & | MO, | |
| X86TargetMachine & | TM | |||
| ) | [static] |
CanRematLoadWithDispOperand - Return true if a load with the specified operand is a candidate for remat: for this to be true we need to know that the load will always return the same value, even if moved.
Definition at line 790 of file X86InstrInfo.cpp.
References llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getTargetFlags(), GV, llvm::MachineOperand::isCPI(), llvm::MachineOperand::isGlobal(), and llvm::isGlobalStubReference().
Referenced by llvm::X86InstrInfo::isReallyTriviallyReMaterializable().
| static MachineInstr* FuseInst | ( | MachineFunction & | MF, | |
| unsigned | Opcode, | |||
| unsigned | OpNo, | |||
| const SmallVectorImpl< MachineOperand > & | MOs, | |||
| MachineInstr * | MI, | |||
| const TargetInstrInfo & | TII | |||
| ) | [static] |
Definition at line 2125 of file X86InstrInfo.cpp.
References llvm::addOffset(), llvm::MachineInstrBuilder::addOperand(), llvm::MachineFunction::CreateMachineInstr(), llvm::TargetInstrInfo::get(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::isReg(), and llvm::SmallVectorImpl< T >::size().
| static MachineInstr* FuseTwoAddrInst | ( | MachineFunction & | MF, | |
| unsigned | Opcode, | |||
| const SmallVectorImpl< MachineOperand > & | MOs, | |||
| MachineInstr * | MI, | |||
| const TargetInstrInfo & | TII | |||
| ) | [static] |
Definition at line 2098 of file X86InstrInfo.cpp.
References llvm::addOffset(), llvm::MachineInstrBuilder::addOperand(), llvm::MachineFunction::CreateMachineInstr(), llvm::TargetInstrInfo::get(), llvm::MachineInstr::getDebugLoc(), llvm::MachineInstr::getDesc(), llvm::MachineInstr::getNumOperands(), llvm::TargetInstrDesc::getNumOperands(), llvm::MachineInstr::getOperand(), and llvm::SmallVectorImpl< T >::size().
| static X86::CondCode GetCondFromBranchOpc | ( | unsigned | BrOpc | ) | [static] |
Definition at line 1434 of file X86InstrInfo.cpp.
References llvm::X86::COND_A, llvm::X86::COND_AE, llvm::X86::COND_B, llvm::X86::COND_BE, llvm::X86::COND_E, llvm::X86::COND_G, llvm::X86::COND_GE, llvm::X86::COND_INVALID, llvm::X86::COND_L, llvm::X86::COND_LE, llvm::X86::COND_NE, llvm::X86::COND_NO, llvm::X86::COND_NP, llvm::X86::COND_NS, llvm::X86::COND_O, llvm::X86::COND_P, and llvm::X86::COND_S.
| static unsigned getDisplacementFieldSize | ( | const MachineOperand * | RelocOp | ) | [static] |
Definition at line 2800 of file X86InstrInfo.cpp.
References llvm::MachineOperand::isCPI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isJTI(), llvm_unreachable, sizeConstant(), sizeConstPoolAddress(), sizeGlobalAddress(), and sizeJumpTableAddress().
Referenced by getMemModRMByteSize().
| static unsigned GetInstSizeWithDesc | ( | const MachineInstr & | MI, | |
| const TargetInstrDesc * | Desc, | |||
| bool | IsPIC, | |||
| bool | Is64BitMode | |||
| ) | [static] |
Definition at line 2897 of file X86InstrInfo.cpp.
References llvm::X86II::AddRegFrm, llvm::X86II::AdSize, llvm::X86II::D8, llvm::X86II::D9, llvm::X86II::DA, llvm::X86II::DB, llvm::TargetInstrInfo::DBG_LABEL, llvm::X86II::DC, llvm::X86II::DD, llvm::X86II::DE, llvm::TargetInstrInfo::DECLARE, llvm::X86InstrInfo::determineREX(), llvm::X86II::DF, llvm::TargetInstrInfo::EH_LABEL, llvm::X86II::FormMask, llvm::X86II::FS, llvm::TargetInstrInfo::getInlineAsmLength(), llvm::TargetMachine::getInstrInfo(), getMemModRMByteSize(), llvm::TargetInstrDesc::getNumOperands(), llvm::TargetInstrDesc::getOpcode(), llvm::MachineInstr::getOperand(), llvm::TargetInstrDesc::getOperandConstraint(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getSymbolName(), llvm::MachineFunction::getTarget(), llvm::TargetMachine::getTargetAsmInfo(), llvm::X86II::GS, llvm::TargetInstrInfo::IMPLICIT_DEF, llvm::TargetInstrInfo::INLINEASM, llvm::MachineOperand::isCPI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isJTI(), llvm::MachineOperand::isMBB(), llvm::MachineOperand::isSymbol(), llvm::TargetInstrDesc::isVariadic(), llvm::llvm_report_error(), llvm_unreachable, llvm::X86II::LOCK, llvm::X86II::MRM0m, llvm::X86II::MRM0r, llvm::X86II::MRM1m, llvm::X86II::MRM1r, llvm::X86II::MRM2m, llvm::X86II::MRM2r, llvm::X86II::MRM3m, llvm::X86II::MRM3r, llvm::X86II::MRM4m, llvm::X86II::MRM4r, llvm::X86II::MRM5m, llvm::X86II::MRM5r, llvm::X86II::MRM6m, llvm::X86II::MRM6r, llvm::X86II::MRM7m, llvm::X86II::MRM7r, llvm::X86II::MRMDestMem, llvm::X86II::MRMDestReg, llvm::X86II::MRMInitReg, llvm::X86II::MRMSrcMem, llvm::X86II::MRMSrcReg, llvm::X86II::Op0Mask, llvm::TargetInstrDesc::Opcode, llvm::X86II::OpSize, llvm::X86II::Pseudo, llvm::X86II::RawFrm, llvm::X86II::REP, llvm::X86II::SegOvrMask, sizeConstant(), sizeConstPoolAddress(), sizeExternalSymbolAddress(), sizeGlobalAddress(), sizeJumpTableAddress(), llvm::X86InstrInfo::sizeOfImm(), sizePCRelativeBlockAddress(), sizeRegModRMByte(), llvm::raw_string_ostream::str(), llvm::X86II::T8, llvm::X86II::TA, llvm::X86II::TB, llvm::X86II::TF, llvm::TOI::TIED_TO, TII, llvm::TargetInstrDesc::TSFlags, llvm::X86AddrNumOperands, llvm::X86II::XD, and llvm::X86II::XS.
Referenced by llvm::X86InstrInfo::GetInstSizeInBytes().
| static unsigned getLoadRegOpcode | ( | unsigned | DestReg, | |
| const TargetRegisterClass * | RC, | |||
| bool | isStackAligned, | |||
| const TargetMachine & | TM | |||
| ) | [static] |
Definition at line 1940 of file X86InstrInfo.cpp.
References llvm::TargetMachine::getSubtarget(), isHReg(), and llvm_unreachable.
Referenced by llvm::X86InstrInfo::loadRegFromAddr(), llvm::X86InstrInfo::loadRegFromStackSlot(), and llvm::X86InstrInfo::unfoldMemoryOperand().
| static unsigned getMemModRMByteSize | ( | const MachineInstr & | MI, | |
| unsigned | Op, | |||
| bool | IsPIC, | |||
| bool | Is64BitMode | |||
| ) | [static] |
Definition at line 2821 of file X86InstrInfo.cpp.
References Base, BaseReg, llvm::N86::EBP, llvm::N86::ESP, getDisplacementFieldSize(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::X86RegisterInfo::getX86RegNum(), IndexReg, llvm::MachineOperand::isCPI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isJTI(), and sizeSIBByte().
Referenced by GetInstSizeWithDesc().
| static unsigned getStoreRegOpcode | ( | unsigned | SrcReg, | |
| const TargetRegisterClass * | RC, | |||
| bool | isStackAligned, | |||
| TargetMachine & | TM | |||
| ) | [static] |
Definition at line 1847 of file X86InstrInfo.cpp.
References llvm::TargetMachine::getSubtarget(), isHReg(), and llvm_unreachable.
Referenced by llvm::X86InstrInfo::storeRegToAddr(), llvm::X86InstrInfo::storeRegToStackSlot(), and llvm::X86InstrInfo::unfoldMemoryOperand().
| static bool hasLiveCondCodeDef | ( | MachineInstr * | MI | ) | [static] |
hasLiveCondCodeDef - True if MI has a condition code def, e.g. EFLAGS, that is not marked dead.
Definition at line 1002 of file X86InstrInfo.cpp.
References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isDef(), and llvm::MachineOperand::isReg().
Referenced by llvm::X86InstrInfo::convertToThreeAddress().
| static bool isBrAnalysisUnpredicatedTerminator | ( | const MachineInstr * | MI, | |
| const X86InstrInfo & | TII | |||
| ) | [static] |
Definition at line 1515 of file X86InstrInfo.cpp.
References llvm::MachineInstr::getOpcode(), and llvm::X86InstrInfo::isUnpredicatedTerminator().
Referenced by llvm::X86InstrInfo::AnalyzeBranch().
isHReg - Test if the given register is a physical h register.
Definition at line 1680 of file X86InstrInfo.cpp.
Referenced by llvm::X86InstrInfo::copyRegToReg(), getLoadRegOpcode(), and getStoreRegOpcode().
| static bool isSafeToClobberEFLAGS | ( | MachineBasicBlock & | MBB, | |
| MachineBasicBlock::iterator | I | |||
| ) | [static] |
isSafeToClobberEFLAGS - Return true if it's safe insert an instruction that would clobber the EFLAGS condition register. Note the result may be conservative. If it cannot definitely determine the safety after visiting two instructions it assumes it's not safe.
Definition at line 882 of file X86InstrInfo.cpp.
References llvm::MachineBasicBlock::end(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::isUse().
Referenced by llvm::X86InstrInfo::reMaterialize().
| static MachineInstr* MakeM0Inst | ( | const TargetInstrInfo & | TII, | |
| unsigned | Opcode, | |||
| const SmallVectorImpl< MachineOperand > & | MOs, | |||
| MachineInstr * | MI | |||
| ) | [static] |
Definition at line 2149 of file X86InstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::addOffset(), llvm::MachineInstrBuilder::addOperand(), llvm::BuildMI(), llvm::TargetInstrInfo::get(), llvm::MachineInstr::getDebugLoc(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), MF, and llvm::SmallVectorImpl< T >::size().
| static bool regIsPICBase | ( | unsigned | BaseReg, | |
| const MachineRegisterInfo & | MRI | |||
| ) | [static] |
regIsPICBase - Return true if register is PIC base (i.e.g defined by X86::MOVPC32r.
Definition at line 774 of file X86InstrInfo.cpp.
References llvm::MachineRegisterInfo::def_begin(), llvm::MachineRegisterInfo::def_end(), E, and llvm::MachineInstr::getOpcode().
Referenced by llvm::X86InstrInfo::isReallyTriviallyReMaterializable().
Definition at line 2788 of file X86InstrInfo.cpp.
Referenced by getDisplacementFieldSize(), and GetInstSizeWithDesc().
sizeConstPoolAddress - Give the size of the emission of this constant pool address
Definition at line 2770 of file X86InstrInfo.cpp.
Referenced by getDisplacementFieldSize(), and GetInstSizeWithDesc().
sizeExternalSymbolAddress - Give the size of the emission of this external symbol
Definition at line 2777 of file X86InstrInfo.cpp.
Referenced by GetInstSizeWithDesc().
sizeGlobalAddress - Give the size of the emission of this global address
Definition at line 2763 of file X86InstrInfo.cpp.
Referenced by getDisplacementFieldSize(), and GetInstSizeWithDesc().
sizeJumpTableAddress - Give the size of the emission of this jump table address
Definition at line 2784 of file X86InstrInfo.cpp.
Referenced by getDisplacementFieldSize(), and GetInstSizeWithDesc().
| static unsigned sizePCRelativeBlockAddress | ( | ) | [static] |
sizePCRelativeBlockAddress - This method returns the size of a PC relative block address instruction
Definition at line 2757 of file X86InstrInfo.cpp.
Referenced by GetInstSizeWithDesc().
| static unsigned sizeRegModRMByte | ( | ) | [static] |
| static unsigned sizeSIBByte | ( | ) | [static] |
cl::opt<bool> PrintFailedFusing("print-failed-fuse-candidates", cl::desc("Print instructions that the allocator wants to"" fuse, but the X86 backend currently can't"), cl::Hidden) [static] |
cl::opt<bool> ReMatPICStubLoad("remat-pic-stub-load", cl::desc("Re-materialize load from stub in PIC mode"), cl::init(false), cl::Hidden) [static] |
Referenced by llvm::X86InstrInfo::isReallyTriviallyReMaterializable().