13 #ifndef LLVM_LIB_TARGET_X86_X86INSTRINFO_H 14 #define LLVM_LIB_TARGET_X86_X86INSTRINFO_H 23 #define GET_INSTRINFO_HEADER 24 #include "X86GenInstrInfo.inc" 27 class MachineInstrBuilder;
28 class X86RegisterInfo;
43 unsigned getSETOpc(
bool HasMemoryOperand =
false);
46 unsigned getCMovOpcode(
unsigned RegBytes,
bool HasMemoryOperand =
false);
136 virtual void anchor();
142 bool AllowModify)
const;
183 bool isCoalescableExtInstr(
const MachineInstr &MI,
unsigned &SrcReg,
184 unsigned &DstReg,
unsigned &SubIdx)
const override;
190 unsigned &MemBytes)
const override;
194 unsigned isLoadFromStackSlotPostFE(
const MachineInstr &MI,
195 int &FrameIndex)
const override;
198 int &FrameIndex)
const override;
201 unsigned &MemBytes)
const override;
205 unsigned isStoreToStackSlotPostFE(
const MachineInstr &MI,
206 int &FrameIndex)
const override;
208 bool isReallyTriviallyReMaterializable(
const MachineInstr &MI,
211 unsigned DestReg,
unsigned SubIdx,
224 unsigned LEAOpcode,
bool AllowSP,
Register &NewSrc,
257 bool findCommutedOpIndices(
const MachineInstr &MI,
unsigned &SrcOpIdx1,
258 unsigned &SrcOpIdx2)
const override;
276 getFMA3OpcodeToCommuteOperands(
const MachineInstr &MI,
unsigned SrcOpIdx1,
281 bool isUnpredicatedTerminator(
const MachineInstr &MI)
const override;
282 bool isUnconditionalTailCall(
const MachineInstr &MI)
const override;
292 bool AllowModify)
const override;
300 bool AllowModify =
false)
const override;
303 int *BytesRemoved =
nullptr)
const override;
307 int *BytesAdded =
nullptr)
const override;
309 unsigned,
unsigned,
int &,
int &,
int &)
const override;
311 const DebugLoc &DL,
unsigned DstReg,
313 unsigned FalseReg)
const override;
316 bool KillSrc)
const override;
319 bool isKill,
int FrameIndex,
328 bool expandPostRAPseudo(
MachineInstr &MI)
const override;
360 bool UnfoldLoad,
bool UnfoldStore,
373 getOpcodeAfterMemoryUnfold(
unsigned Opc,
bool UnfoldLoad,
bool UnfoldStore,
374 unsigned *LoadRegIndex =
nullptr)
const override;
381 bool areLoadsFromSameBasePtr(
SDNode *Load1,
SDNode *Load2, int64_t &Offset1,
382 int64_t &Offset2)
const override;
392 bool shouldScheduleLoadsNear(
SDNode *Load1,
SDNode *Load2, int64_t Offset1,
394 unsigned NumLoads)
const override;
396 void getNoop(
MCInst &NopInst)
const override;
425 std::pair<uint16_t, uint16_t>
426 getExecutionDomain(
const MachineInstr &MI)
const override;
430 void setExecutionDomain(
MachineInstr &MI,
unsigned Domain)
const override;
432 bool setExecutionDomainCustom(
MachineInstr &MI,
unsigned Domain)
const;
435 getPartialRegUpdateClearance(
const MachineInstr &MI,
unsigned OpNum,
437 unsigned getUndefRegClearance(
const MachineInstr &MI,
unsigned &OpNum,
439 void breakPartialRegDependency(
MachineInstr &MI,
unsigned OpNum,
446 unsigned Size,
unsigned Alignment,
447 bool AllowCommute)
const;
449 bool isHighLatencyDef(
int opc)
const override;
455 unsigned UseIdx)
const override;
459 bool isAssociativeAndCommutative(
const MachineInstr &Inst)
const override;
472 bool analyzeCompare(
const MachineInstr &MI,
unsigned &SrcReg,
473 unsigned &SrcReg2,
int &CmpMask,
474 int &CmpValue)
const override;
479 bool optimizeCompareInstr(
MachineInstr &CmpInstr,
unsigned SrcReg,
480 unsigned SrcReg2,
int CmpMask,
int CmpValue,
492 unsigned &FoldAsLoadDefReg,
495 std::pair<unsigned, unsigned>
496 decomposeMachineOperandsTargetFlags(
unsigned TF)
const override;
499 getSerializableDirectMachineOperandTargetFlags()
const override;
502 std::vector<outliner::Candidate> &RepeatedSequenceLocs)
const override;
505 bool OutlineFromLinkOnceODRs)
const override;
518 #define GET_INSTRINFO_HELPER_DECLS 519 #include "X86GenInstrInfo.inc" 541 unsigned CommuteOpIdx1,
542 unsigned CommuteOpIdx2)
const override;
554 MachineInstr *convertToThreeAddressWithLEA(
unsigned MIOpc,
558 bool Is8BitOp)
const;
566 unsigned Size,
unsigned Align)
const;
571 int &FrameIndex)
const;
590 bool findThreeSrcCommutedOpIndices(
const MachineInstr &MI,
593 bool IsIntrinsic =
false)
const;
void setFrameAdjustment(MachineInstr &I, int64_t V) const
Sets the stack pointer adjustment made inside the frame made up by this instruction.
static bool isScale(const MachineOperand &MO)
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "...
Wrapper class representing physical registers. Should be passed by value.
This class represents lattice values for constants.
LivenessQueryResult computeRegisterLiveness(const TargetRegisterInfo *TRI, unsigned Reg, const_iterator Before, unsigned Neighborhood=10) const
Return whether (physical) register Reg has been defined and not killed as of just before Before...
A Module instance is used to store all the information related to an LLVM module. ...
This class is used to group {132, 213, 231} forms of FMA opcodes together.
CondCode getCondFromCMov(const MachineInstr &MI)
Return condition code of a CMov opcode.
AddrNumOperands - Total number of operands in a memory reference.
unsigned const TargetRegisterInfo * TRI
bool isCPI() const
isCPI - Tests if this is a MO_ConstantPoolIndex operand.
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
An individual sequence of instructions to be replaced with a call to an outlined function.
Represents a predicate at the MachineFunction level.
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
Provide an instruction scheduling machine model to CodeGen passes.
unsigned getNumOperands() const
Retuns the total number of operands.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
static bool isGlobalStubReference(unsigned char TargetFlag)
isGlobalStubReference - Return true if the specified TargetFlag operand is a reference to a stub for ...
unsigned getSwappedVPCMPImm(unsigned Imm)
Get the VPCMP immediate if the opcodes are swapped.
static bool isMem(const MachineInstr &MI, unsigned Op)
static bool isGlobalRelativeToPICBase(unsigned char TargetFlag)
isGlobalRelativeToPICBase - Return true if the specified global value reference is relative to a 32-b...
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
unsigned getSwappedVPCOMImm(unsigned Imm)
Get the VPCOM immediate if the opcodes are swapped.
unsigned getSwappedVCMPImm(unsigned Imm)
Get the VCMP immediate if the opcodes are swapped.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
static bool isLeaMem(const MachineInstr &MI, unsigned Op)
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
Instances of this class represent a single low-level machine instruction.
BasicBlockListType::iterator iterator
unsigned getCMovOpcode(unsigned RegBytes, bool HasMemoryOperand=false)
Return a cmov opcode for the given register size in bytes, and operand type.
std::pair< CondCode, bool > getX86ConditionCode(CmpInst::Predicate Predicate)
Return a pair of condition code for the given predicate and whether the instruction operands should b...
unsigned const MachineRegisterInfo * MRI
InstrType
Represents how an instruction should be mapped by the outliner.
MO_TLVP - On a symbol operand this indicates that the immediate is some TLS offset.
MachineInstrBuilder & UseMI
The information necessary to create an outlined function for some class of candidate.
static bool hasLockPrefix(const MachineInstr &MI)
unsigned getVPCMPImmForCond(ISD::CondCode CC)
Get the VPCMP immediate for the given condition.
Register is known to be fully dead.
CondCode getCondFromSETCC(const MachineInstr &MI)
Return condition code of a SETCC opcode.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
void setImm(int64_t immVal)
bool useMachineCombiner() const override
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This struct is a compact representation of a valid (non-zero power of two) alignment.
CondCode getCondFromBranch(const MachineInstr &MI)
bool isJTI() const
isJTI - Tests if this is a MO_JumpTableIndex operand.
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
MachineOperand class - Representation of each machine instruction operand.
AddrSegmentReg - The operand # of the segment in the memory operand.
CondCode GetOppositeBranchCondition(CondCode CC)
GetOppositeBranchCondition - Return the inverse of the specified cond, e.g.
MachineInstrBuilder MachineInstrBuilder & DefMI
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
int64_t getFrameAdjustment(const MachineInstr &I) const
Returns the stack pointer adjustment that happens inside the frame setup..destroy sequence (e...
const X86RegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Represents one node in the SelectionDAG.
bool isSubregFoldable() const override
Check whether the target can fold a load that feeds a subreg operand (or a subreg operand that feeds ...
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
unsigned getSETOpc(bool HasMemoryOperand=false)
Return a setcc opcode based on whether it has a memory operand.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isSafeToClobberEFLAGS(MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const
isSafeToClobberEFLAGS - Return true if it's safe insert an instruction tha would clobber the EFLAGS c...
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
const MachineOperand & getOperand(unsigned i) const
Wrapper class representing virtual and physical registers.
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...