14 #ifndef LLVM_LIB_TARGET_X86_X86INSTRINFO_H 15 #define LLVM_LIB_TARGET_X86_X86INSTRINFO_H 24 #define GET_INSTRINFO_HEADER 25 #include "X86GenInstrInfo.inc" 28 class MachineInstrBuilder;
29 class X86RegisterInfo;
85 bool HasMemoryOperand =
false);
114 switch (TargetFlag) {
130 switch (TargetFlag) {
171 virtual void anchor();
177 bool AllowModify)
const;
218 bool isCoalescableExtInstr(
const MachineInstr &MI,
unsigned &SrcReg,
219 unsigned &DstReg,
unsigned &SubIdx)
const override;
225 unsigned &MemBytes)
const override;
229 unsigned isLoadFromStackSlotPostFE(
const MachineInstr &MI,
230 int &FrameIndex)
const override;
233 int &FrameIndex)
const override;
236 unsigned &MemBytes)
const override;
240 unsigned isStoreToStackSlotPostFE(
const MachineInstr &MI,
241 int &FrameIndex)
const override;
243 bool isReallyTriviallyReMaterializable(
const MachineInstr &MI,
246 unsigned DestReg,
unsigned SubIdx,
259 unsigned LEAOpcode,
bool AllowSP,
unsigned &NewSrc,
292 bool findCommutedOpIndices(
MachineInstr &MI,
unsigned &SrcOpIdx1,
293 unsigned &SrcOpIdx2)
const override;
311 getFMA3OpcodeToCommuteOperands(
const MachineInstr &MI,
unsigned SrcOpIdx1,
316 bool isUnpredicatedTerminator(
const MachineInstr &MI)
const override;
317 bool isUnconditionalTailCall(
const MachineInstr &MI)
const override;
327 bool AllowModify)
const override;
329 bool getMemOpBaseRegImmOfs(
MachineInstr &LdSt,
unsigned &BaseReg,
334 bool AllowModify =
false)
const override;
337 int *BytesRemoved =
nullptr)
const override;
341 int *BytesAdded =
nullptr)
const override;
343 unsigned,
unsigned,
int &,
int &,
int &)
const override;
345 const DebugLoc &DL,
unsigned DstReg,
347 unsigned FalseReg)
const override;
349 const DebugLoc &DL,
unsigned DestReg,
unsigned SrcReg,
350 bool KillSrc)
const override;
355 bool isKill,
int FrameIndex,
378 bool expandPostRAPseudo(
MachineInstr &MI)
const override;
409 bool UnfoldLoad,
bool UnfoldStore,
422 getOpcodeAfterMemoryUnfold(
unsigned Opc,
bool UnfoldLoad,
bool UnfoldStore,
423 unsigned *LoadRegIndex =
nullptr)
const override;
430 bool areLoadsFromSameBasePtr(
SDNode *Load1,
SDNode *Load2, int64_t &Offset1,
431 int64_t &Offset2)
const override;
441 bool shouldScheduleLoadsNear(
SDNode *Load1,
SDNode *Load2, int64_t Offset1,
443 unsigned NumLoads)
const override;
445 void getNoop(
MCInst &NopInst)
const override;
471 std::pair<uint16_t, uint16_t>
472 getExecutionDomain(
const MachineInstr &MI)
const override;
474 uint16_t getExecutionDomainCustom(
const MachineInstr &MI)
const;
476 void setExecutionDomain(
MachineInstr &MI,
unsigned Domain)
const override;
478 bool setExecutionDomainCustom(
MachineInstr &MI,
unsigned Domain)
const;
481 getPartialRegUpdateClearance(
const MachineInstr &MI,
unsigned OpNum,
483 unsigned getUndefRegClearance(
const MachineInstr &MI,
unsigned &OpNum,
485 void breakPartialRegDependency(
MachineInstr &MI,
unsigned OpNum,
492 unsigned Size,
unsigned Alignment,
493 bool AllowCommute)
const;
495 bool isHighLatencyDef(
int opc)
const override;
501 unsigned UseIdx)
const override;
505 bool isAssociativeAndCommutative(
const MachineInstr &Inst)
const override;
518 bool analyzeCompare(
const MachineInstr &MI,
unsigned &SrcReg,
519 unsigned &SrcReg2,
int &CmpMask,
520 int &CmpValue)
const override;
525 bool optimizeCompareInstr(
MachineInstr &CmpInstr,
unsigned SrcReg,
526 unsigned SrcReg2,
int CmpMask,
int CmpValue,
538 unsigned &FoldAsLoadDefReg,
541 std::pair<unsigned, unsigned>
542 decomposeMachineOperandsTargetFlags(
unsigned TF)
const override;
545 getSerializableDirectMachineOperandTargetFlags()
const override;
548 std::vector<outliner::Candidate> &RepeatedSequenceLocs)
const override;
551 bool OutlineFromLinkOnceODRs)
const override;
577 unsigned CommuteOpIdx1,
578 unsigned CommuteOpIdx2)
const override;
581 MachineInstr *convertToThreeAddressWithLEA(
unsigned MIOpc,
592 unsigned Size,
unsigned Align)
const;
597 int &FrameIndex)
const;
616 bool findThreeSrcCommutedOpIndices(
const MachineInstr &MI,
619 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.
unsigned GetCondBranchFromCond(CondCode CC)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
static bool isScale(const MachineOperand &MO)
AddrNumOperands - Total number of operands in a memory reference.
Compute iterated dominance frontiers using a linear time algorithm.
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 getCondFromCMovOpc(unsigned Opc)
Return condition code of a CMov opcode.
CondCode getCondFromSETOpc(unsigned Opc)
Return condition code of a SET opcode.
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...
A description of a memory reference used in the backend.
Provide an instruction scheduling machine model to CodeGen passes.
unsigned getNumOperands() const
Access to explicit operands of the instruction.
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 ...
CondCode getCondFromBranchOpc(unsigned Opc)
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...
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.
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.
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.
unsigned getVPCMPImmForCond(ISD::CondCode CC)
Get the VPCMP immediate for the given condition.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
void setImm(int64_t immVal)
bool useMachineCombiner() const override
unsigned getSETFromCond(CondCode CC, bool HasMemoryOperand=false)
Return a set opcode for the given condition and whether it has a memory operand.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
static bool isUndef(ArrayRef< int > Mask)
Iterator for intrusive lists based on ilist_node.
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.
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.
unsigned getCMovFromCond(CondCode CC, unsigned RegBytes, bool HasMemoryOperand=false)
Return a cmov opcode for the given condition, register size in bytes, and operand type...
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.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
AddrSegmentReg - The operand # of the segment in the memory operand.
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
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...