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) {
131 switch (TargetFlag) {
172 virtual void anchor();
178 bool AllowModify)
const;
219 bool isCoalescableExtInstr(
const MachineInstr &MI,
unsigned &SrcReg,
220 unsigned &DstReg,
unsigned &SubIdx)
const override;
226 unsigned &MemBytes)
const override;
230 unsigned isLoadFromStackSlotPostFE(
const MachineInstr &MI,
231 int &FrameIndex)
const override;
234 int &FrameIndex)
const override;
237 unsigned &MemBytes)
const override;
241 unsigned isStoreToStackSlotPostFE(
const MachineInstr &MI,
242 int &FrameIndex)
const override;
244 bool isReallyTriviallyReMaterializable(
const MachineInstr &MI,
247 unsigned DestReg,
unsigned SubIdx,
260 unsigned LEAOpcode,
bool AllowSP,
unsigned &NewSrc,
293 bool findCommutedOpIndices(
MachineInstr &MI,
unsigned &SrcOpIdx1,
294 unsigned &SrcOpIdx2)
const override;
312 getFMA3OpcodeToCommuteOperands(
const MachineInstr &MI,
unsigned SrcOpIdx1,
317 bool isUnpredicatedTerminator(
const MachineInstr &MI)
const override;
318 bool isUnconditionalTailCall(
const MachineInstr &MI)
const override;
328 bool AllowModify)
const override;
335 bool AllowModify =
false)
const override;
338 int *BytesRemoved =
nullptr)
const override;
342 int *BytesAdded =
nullptr)
const override;
344 unsigned,
unsigned,
int &,
int &,
int &)
const override;
346 const DebugLoc &DL,
unsigned DstReg,
348 unsigned FalseReg)
const override;
350 const DebugLoc &DL,
unsigned DestReg,
unsigned SrcReg,
351 bool KillSrc)
const override;
354 bool isKill,
int FrameIndex,
375 bool expandPostRAPseudo(
MachineInstr &MI)
const override;
406 bool UnfoldLoad,
bool UnfoldStore,
419 getOpcodeAfterMemoryUnfold(
unsigned Opc,
bool UnfoldLoad,
bool UnfoldStore,
420 unsigned *LoadRegIndex =
nullptr)
const override;
427 bool areLoadsFromSameBasePtr(
SDNode *Load1,
SDNode *Load2, int64_t &Offset1,
428 int64_t &Offset2)
const override;
438 bool shouldScheduleLoadsNear(
SDNode *Load1,
SDNode *Load2, int64_t Offset1,
440 unsigned NumLoads)
const override;
442 void getNoop(
MCInst &NopInst)
const override;
468 std::pair<uint16_t, uint16_t>
469 getExecutionDomain(
const MachineInstr &MI)
const override;
471 uint16_t getExecutionDomainCustom(
const MachineInstr &MI)
const;
473 void setExecutionDomain(
MachineInstr &MI,
unsigned Domain)
const override;
475 bool setExecutionDomainCustom(
MachineInstr &MI,
unsigned Domain)
const;
478 getPartialRegUpdateClearance(
const MachineInstr &MI,
unsigned OpNum,
480 unsigned getUndefRegClearance(
const MachineInstr &MI,
unsigned &OpNum,
482 void breakPartialRegDependency(
MachineInstr &MI,
unsigned OpNum,
489 unsigned Size,
unsigned Alignment,
490 bool AllowCommute)
const;
492 bool isHighLatencyDef(
int opc)
const override;
498 unsigned UseIdx)
const override;
502 bool isAssociativeAndCommutative(
const MachineInstr &Inst)
const override;
515 bool analyzeCompare(
const MachineInstr &MI,
unsigned &SrcReg,
516 unsigned &SrcReg2,
int &CmpMask,
517 int &CmpValue)
const override;
522 bool optimizeCompareInstr(
MachineInstr &CmpInstr,
unsigned SrcReg,
523 unsigned SrcReg2,
int CmpMask,
int CmpValue,
535 unsigned &FoldAsLoadDefReg,
538 std::pair<unsigned, unsigned>
539 decomposeMachineOperandsTargetFlags(
unsigned TF)
const override;
542 getSerializableDirectMachineOperandTargetFlags()
const override;
545 std::vector<outliner::Candidate> &RepeatedSequenceLocs)
const override;
548 bool OutlineFromLinkOnceODRs)
const override;
561 #define GET_INSTRINFO_HELPER_DECLS 562 #include "X86GenInstrInfo.inc" 576 MachineInstr *commuteInstructionImpl(MachineInstr &MI,
bool NewMI,
577 unsigned CommuteOpIdx1,
578 unsigned CommuteOpIdx2)
const override;
583 bool isCopyInstrImpl(
const MachineInstr &MI,
const MachineOperand *&
Source,
584 const MachineOperand *&Destination)
const override;
590 MachineInstr *convertToThreeAddressWithLEA(
unsigned MIOpc,
593 LiveVariables *LV)
const;
597 MachineInstr *foldMemoryOperandCustom(MachineFunction &MF, MachineInstr &MI,
599 ArrayRef<MachineOperand> MOs,
601 unsigned Size,
unsigned Align)
const;
605 bool isFrameOperand(
const MachineInstr &MI,
unsigned int Op,
606 int &FrameIndex)
const;
625 bool findThreeSrcCommutedOpIndices(
const MachineInstr &MI,
628 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)
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "...
This class represents lattice values for constants.
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.
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 ...
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.
BasicBlockListType::iterator iterator
MachineInstrBundleIterator< MachineInstr > iterator
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...
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())
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
AddrSegmentReg - The operand # of the segment in the memory operand.
const MachineOperand & getOperand(unsigned i) const
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...