13#ifndef LLVM_LIB_TARGET_ARM_ARMBASEINSTRINFO_H
14#define LLVM_LIB_TARGET_ARM_ARMBASEINSTRINFO_H
29#include "llvm/IR/IntrinsicsARM.h"
34#define GET_INSTRINFO_HEADER
35#include "ARMGenInstrInfo.inc"
39class ARMBaseRegisterInfo;
51 unsigned LoadImmOpc,
unsigned LoadOpc)
const;
109 unsigned OpIdx2)
const override;
113 std::optional<DestSourcePair>
118 std::optional<ParamLoadedValue>
136 return &ARM::GPRRegClass;
157 bool AllowModify =
false)
const override;
159 int *BytesRemoved =
nullptr)
const override;
163 int *BytesAdded =
nullptr)
const override;
178 int PIdx =
MI.findFirstPredOperandIdx();
190 bool SkipDead)
const override;
205 if (
MI.getOpcode() == ARM::tTBB_JT ||
MI.getOpcode() == ARM::tTBH_JT)
206 return InstSizeVerifyMode::NoVerify;
207 return InstSizeVerifyMode::AllowOverEstimate;
211 int &FrameIndex)
const override;
213 int &FrameIndex)
const override;
215 int &FrameIndex)
const override;
217 int &FrameIndex)
const override;
228 bool KillSrc,
bool RenamableDest =
false,
229 bool RenamableSrc =
false)
const override;
256 unsigned SubIdx,
RegState State)
const;
267 int64_t &Offset2)
const override;
278 int64_t Offset1, int64_t Offset2,
279 unsigned NumLoads)
const override;
286 unsigned NumCycles,
unsigned ExtraPredCycles,
291 unsigned NumF,
unsigned ExtraF,
296 return NumCycles == 1;
300 unsigned NumInsts)
const override;
311 Register &SrcReg2, int64_t &CmpMask,
312 int64_t &CmpValue)
const override;
319 Register SrcReg2, int64_t CmpMask, int64_t CmpValue,
324 bool)
const override;
338 unsigned UseIdx)
const override;
340 SDNode *DefNode,
unsigned DefIdx,
342 unsigned UseIdx)
const override;
345 std::pair<uint16_t, uint16_t>
358 std::pair<unsigned, unsigned>
367 bool OutlineFromLinkOnceODRs)
const override;
368 std::optional<std::unique_ptr<outliner::OutlinedFunction>>
371 std::vector<outliner::Candidate> &RepeatedSequenceLocs,
372 unsigned MinRepeats)
const override;
374 Function &
F, std::vector<outliner::Candidate> &Candidates)
const override;
377 unsigned Flags)
const override;
379 unsigned &Flags)
const override;
391 return MI->getOpcode() == ARM::t2LoopEndDec ||
392 MI->getOpcode() == ARM::t2DoLoopStartTP ||
393 MI->getOpcode() == ARM::t2WhileLoopStartLR ||
394 MI->getOpcode() == ARM::t2WhileLoopStartTP;
399 std::unique_ptr<TargetInstrInfo::PipelinerLoopInfo>
412 bool CFI,
bool Auth)
const;
435 unsigned DefClass,
unsigned DefIdx,
436 unsigned DefAlign)
const;
439 unsigned DefClass,
unsigned DefIdx,
440 unsigned DefAlign)
const;
443 unsigned UseClass,
unsigned UseIdx,
444 unsigned UseAlign)
const;
447 unsigned UseClass,
unsigned UseIdx,
448 unsigned UseAlign)
const;
451 unsigned DefIdx,
unsigned DefAlign,
454 unsigned UseAlign)
const;
456 std::optional<unsigned> getOperandLatencyImpl(
458 unsigned DefIdx,
const MCInstrDesc &DefMCID,
unsigned DefAdj,
460 unsigned UseIdx,
const MCInstrDesc &UseMCID,
unsigned UseAdj)
const;
462 unsigned getPredicationCost(
const MachineInstr &
MI)
const override;
466 unsigned *PredCost =
nullptr)
const override;
475 unsigned UseIdx)
const override;
478 unsigned DefIdx)
const override;
493 bool isReMaterializableImpl(
const MachineInstr &
MI)
const override;
510 return MLxEntryMap.count(Opcode);
517 unsigned &AddSubOpc,
bool &NegAcc,
518 bool &HasLane)
const;
524 return MLxHazardOpcodes.count(Opcode);
541 return MI.getOperand(3).getReg();
552 unsigned PredReg = 0) {
574 return Opc == ARM::B ||
Opc == ARM::tB ||
Opc == ARM::t2B;
581 return Opc == ARM::MVE_VPTv16i8 ||
Opc == ARM::MVE_VPTv16u8 ||
582 Opc == ARM::MVE_VPTv16s8 ||
Opc == ARM::MVE_VPTv8i16 ||
583 Opc == ARM::MVE_VPTv8u16 ||
Opc == ARM::MVE_VPTv8s16 ||
584 Opc == ARM::MVE_VPTv4i32 ||
Opc == ARM::MVE_VPTv4u32 ||
585 Opc == ARM::MVE_VPTv4s32 ||
Opc == ARM::MVE_VPTv4f32 ||
586 Opc == ARM::MVE_VPTv8f16 ||
Opc == ARM::MVE_VPTv16i8r ||
587 Opc == ARM::MVE_VPTv16u8r ||
Opc == ARM::MVE_VPTv16s8r ||
588 Opc == ARM::MVE_VPTv8i16r ||
Opc == ARM::MVE_VPTv8u16r ||
589 Opc == ARM::MVE_VPTv8s16r ||
Opc == ARM::MVE_VPTv4i32r ||
590 Opc == ARM::MVE_VPTv4u32r ||
Opc == ARM::MVE_VPTv4s32r ||
591 Opc == ARM::MVE_VPTv4f32r ||
Opc == ARM::MVE_VPTv8f16r ||
592 Opc == ARM::MVE_VPST;
600 case ARM::MVE_VCMPf32:
601 return ARM::MVE_VPTv4f32;
602 case ARM::MVE_VCMPf16:
603 return ARM::MVE_VPTv8f16;
604 case ARM::MVE_VCMPi8:
605 return ARM::MVE_VPTv16i8;
606 case ARM::MVE_VCMPi16:
607 return ARM::MVE_VPTv8i16;
608 case ARM::MVE_VCMPi32:
609 return ARM::MVE_VPTv4i32;
610 case ARM::MVE_VCMPu8:
611 return ARM::MVE_VPTv16u8;
612 case ARM::MVE_VCMPu16:
613 return ARM::MVE_VPTv8u16;
614 case ARM::MVE_VCMPu32:
615 return ARM::MVE_VPTv4u32;
616 case ARM::MVE_VCMPs8:
617 return ARM::MVE_VPTv16s8;
618 case ARM::MVE_VCMPs16:
619 return ARM::MVE_VPTv8s16;
620 case ARM::MVE_VCMPs32:
621 return ARM::MVE_VPTv4s32;
623 case ARM::MVE_VCMPf32r:
624 return ARM::MVE_VPTv4f32r;
625 case ARM::MVE_VCMPf16r:
626 return ARM::MVE_VPTv8f16r;
627 case ARM::MVE_VCMPi8r:
628 return ARM::MVE_VPTv16i8r;
629 case ARM::MVE_VCMPi16r:
630 return ARM::MVE_VPTv8i16r;
631 case ARM::MVE_VCMPi32r:
632 return ARM::MVE_VPTv4i32r;
633 case ARM::MVE_VCMPu8r:
634 return ARM::MVE_VPTv16u8r;
635 case ARM::MVE_VCMPu16r:
636 return ARM::MVE_VPTv8u16r;
637 case ARM::MVE_VCMPu32r:
638 return ARM::MVE_VPTv4u32r;
639 case ARM::MVE_VCMPs8r:
640 return ARM::MVE_VPTv16s8r;
641 case ARM::MVE_VCMPs16r:
642 return ARM::MVE_VPTv8s16r;
643 case ARM::MVE_VCMPs32r:
644 return ARM::MVE_VPTv4s32r;
650 return Opc == ARM::Bcc ||
Opc == ARM::tBcc ||
Opc == ARM::t2Bcc;
654 return Opc == ARM::BR_JTr ||
Opc == ARM::BR_JTm_i12 ||
655 Opc == ARM::BR_JTm_rs ||
Opc == ARM::BR_JTadd ||
Opc == ARM::tBR_JTr ||
661 return Opc == ARM::BX ||
Opc == ARM::MOVPCRX ||
Opc == ARM::tBRIND;
665 int Opc =
MI.getOpcode();
671 case ARM::BLX_pred_noip:
673 case ARM::BMOVPCRX_CALL:
674 case ARM::TCRETURNri:
675 case ARM::TCRETURNrinotr12:
679 case ARM::tBLXr_noip:
681 case ARM::tBLXNS_CALL:
689 case ARM::BMOVPCB_CALL:
692 case ARM::TCRETURNdi:
702 case ARM::tBL_PUSHLR:
703 case ARM::tTAILJMPdND:
714 int opc =
MI.getOpcode();
720 return Opc == ARM::SpeculationBarrierISBDSBEndBB ||
721 Opc == ARM::SpeculationBarrierSBEndBB ||
722 Opc == ARM::t2SpeculationBarrierISBDSBEndBB ||
723 Opc == ARM::t2SpeculationBarrierSBEndBB;
727 return Opc == ARM::tPOP_RET ||
Opc == ARM::LDMIA_RET ||
728 Opc == ARM::t2LDMIA_RET ||
Opc == ARM::tPOP ||
Opc == ARM::LDMIA_UPD ||
729 Opc == ARM::t2LDMIA_UPD ||
Opc == ARM::VLDMDIA_UPD;
733 return Opc == ARM::tPUSH ||
Opc == ARM::t2STMDB_UPD ||
734 Opc == ARM::STMDB_UPD ||
Opc == ARM::VSTMDDB_UPD;
738 return Opc == ARM::SUBri ||
739 Opc == ARM::tSUBi3 ||
Opc == ARM::tSUBi8 ||
740 Opc == ARM::tSUBSi3 ||
Opc == ARM::tSUBSi8 ||
741 Opc == ARM::t2SUBri ||
Opc == ARM::t2SUBri12 ||
Opc == ARM::t2SUBSri;
745 return Opc == ARM::MOVr ||
Opc == ARM::tMOVr ||
Opc == ARM::t2MOVr;
758 if (featureBits[ARM::HasV8Ops] && (Num & 0xE) != 0xE)
763 if (featureBits[ARM::HasV8_1MMainlineOps] &&
764 ((Num & 0xE) == 0x8 || (Num & 0xE) == 0xE))
771 unsigned Opc =
MI.getOpcode();
773 case ARM::SEH_StackAlloc:
774 case ARM::SEH_SaveRegs:
775 case ARM::SEH_SaveRegs_Ret:
776 case ARM::SEH_SaveSP:
777 case ARM::SEH_SaveFRegs:
778 case ARM::SEH_SaveLR:
780 case ARM::SEH_Nop_Ret:
781 case ARM::SEH_PrologEnd:
782 case ARM::SEH_EpilogStart:
783 case ARM::SEH_EpilogEnd:
810 const ARMBaseInstrInfo &
TII,
unsigned MIFlags = 0);
817 const ARMBaseInstrInfo &
TII,
unsigned MIFlags = 0);
822 const TargetInstrInfo &
TII,
823 const ARMBaseRegisterInfo &MRI,
824 unsigned MIFlags = 0);
841 const ARMBaseInstrInfo &
TII);
845 const ARMBaseInstrInfo &
TII,
846 const TargetRegisterInfo *
TRI);
851 const TargetRegisterInfo *
TRI);
856 const TargetRegisterInfo *
TRI);
869 const ARMSubtarget *Subtarget,
870 bool ForCodesize =
false);
876 const ARMSubtarget *Subtarget,
877 bool ForCodesize =
false);
884 switch (
MI.getOpcode()) {
901 return Scale *
MI.getOperand(ImmOp).getImm();
912 return std::abs(
Imm) < ((1 << 7) * 1);
914 return std::abs(
Imm) < ((1 << 7) * 2) &&
Imm % 2 == 0;
916 return std::abs(
Imm) < ((1 << 7) * 4) &&
Imm % 4 == 0;
918 return std::abs(
Imm) < ((1 << 8) * 1);
920 return Imm >= 0 &&
Imm < ((1 << 8) * 1);
922 return Imm < 0 && -
Imm < ((1 << 8) * 1);
924 return std::abs(
Imm) < ((1 << 8) * 4) &&
Imm % 4 == 0;
926 return Imm >= 0 &&
Imm < ((1 << 12) * 1);
928 return std::abs(
Imm) < ((1 << 12) * 1);
936 if (IntInst ==
nullptr)
939 return (IntrinsicID == Intrinsic::masked_gather ||
940 IntrinsicID == Intrinsic::arm_mve_vldr_gather_base ||
941 IntrinsicID == Intrinsic::arm_mve_vldr_gather_base_predicated ||
942 IntrinsicID == Intrinsic::arm_mve_vldr_gather_base_wb ||
943 IntrinsicID == Intrinsic::arm_mve_vldr_gather_base_wb_predicated ||
944 IntrinsicID == Intrinsic::arm_mve_vldr_gather_offset ||
945 IntrinsicID == Intrinsic::arm_mve_vldr_gather_offset_predicated);
950 if (IntInst ==
nullptr)
953 return (IntrinsicID == Intrinsic::masked_scatter ||
954 IntrinsicID == Intrinsic::arm_mve_vstr_scatter_base ||
955 IntrinsicID == Intrinsic::arm_mve_vstr_scatter_base_predicated ||
956 IntrinsicID == Intrinsic::arm_mve_vstr_scatter_base_wb ||
957 IntrinsicID == Intrinsic::arm_mve_vstr_scatter_base_wb_predicated ||
958 IntrinsicID == Intrinsic::arm_mve_vstr_scatter_offset ||
959 IntrinsicID == Intrinsic::arm_mve_vstr_scatter_offset_predicated);
964 if (IntInst ==
nullptr)
976 switch (
MI->getOpcode()) {
981 case ARM::MVE_SQRSHR:
982 case ARM::MVE_UQRSHL:
988 case ARM::MVE_SQRSHRL:
989 case ARM::MVE_SQSHLL:
990 case ARM::MVE_SRSHRL:
991 case ARM::MVE_UQRSHLL:
992 case ARM::MVE_UQSHLL:
993 case ARM::MVE_URSHRL:
MachineInstrBuilder & UseMI
MachineInstrBuilder MachineInstrBuilder & DefMI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
This file defines the DenseMap class.
const HexagonInstrInfo * TII
TargetInstrInfo::RegSubRegPair RegSubRegPair
Register const TargetRegisterInfo * TRI
Promote Memory to Register
uint64_t IntrinsicInst * II
PowerPC TLS Dynamic Call Fixup
TargetInstrInfo::RegSubRegPairAndIdx RegSubRegPairAndIdx
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
bool isDead(const MachineInstr &MI, const MachineRegisterInfo &MRI)
This file defines the SmallSet class.
static void expandLoadStackGuard(MachineInstrBuilder &MIB, const TargetInstrInfo &TII)
bool isUnspillableTerminatorImpl(const MachineInstr *MI) const override
static bool isCPSRDefined(const MachineInstr &MI)
bool optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg, Register SrcReg2, int64_t CmpMask, int64_t CmpValue, const MachineRegisterInfo *MRI) const override
optimizeCompareInstr - Convert the instruction to set the zero flag so that we can remove a "comparis...
bool reverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const override
ScheduleHazardRecognizer * CreateTargetHazardRecognizer(const TargetSubtargetInfo *STI, const ScheduleDAG *DAG) const override
InstSizeVerifyMode getInstSizeVerifyMode(const MachineInstr &MI) const override
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
bool foldImmediate(MachineInstr &UseMI, MachineInstr &DefMI, Register Reg, MachineRegisterInfo *MRI) const override
foldImmediate - 'Reg' is known to be defined by a move immediate instruction, try to fold the immedia...
bool canCauseFpMLxStall(unsigned Opcode) const
canCauseFpMLxStall - Return true if an instruction of the specified opcode will cause stalls when sch...
std::pair< unsigned, unsigned > decomposeMachineOperandsTargetFlags(unsigned TF) const override
bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, unsigned ExtraPredCycles, BranchProbability Probability) const override
bool ClobbersPredicate(MachineInstr &MI, std::vector< MachineOperand > &Pred, bool SkipDead) const override
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register DestReg, int FrameIndex, const TargetRegisterClass *RC, Register VReg, unsigned SubReg=0, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
void copyFromCPSR(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, MCRegister DestReg, bool KillSrc, const ARMSubtarget &Subtarget) const
unsigned getNumMicroOps(const InstrItineraryData *ItinData, const MachineInstr &MI) const override
virtual unsigned getUnindexedOpcode(unsigned Opc) const =0
std::optional< RegImmPair > isAddImmediate(const MachineInstr &MI, Register Reg) const override
unsigned getPartialRegUpdateClearance(const MachineInstr &, unsigned, const TargetRegisterInfo *) const override
unsigned getNumLDMAddresses(const MachineInstr &MI) const
Get the number of addresses by LDM or VLDM or zero for unknown.
bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, BranchProbability Probability) const override
MachineInstr * optimizeSelect(MachineInstr &MI, SmallPtrSetImpl< MachineInstr * > &SeenMIs, bool) const override
bool produceSameValue(const MachineInstr &MI0, const MachineInstr &MI1, const MachineRegisterInfo *MRI) const override
void setExecutionDomain(MachineInstr &MI, unsigned Domain) const override
ArrayRef< std::pair< unsigned, const char * > > getSerializableBitmaskMachineOperandTargetFlags() const override
ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData *II, const ScheduleDAG *DAG) const override
std::unique_ptr< TargetInstrInfo::PipelinerLoopInfo > analyzeLoopForPipelining(MachineBasicBlock *LoopBB) const override
Analyze loop L, which must be a single-basic-block loop, and if the conditions can be understood enou...
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
GetInstSize - Returns the size of the specified MachineInstr.
void copyToCPSR(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, MCRegister SrcReg, bool KillSrc, const ARMSubtarget &Subtarget) const
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
void mergeOutliningCandidateAttributes(Function &F, std::vector< outliner::Candidate > &Candidates) const override
const MachineInstrBuilder & AddDReg(MachineInstrBuilder &MIB, unsigned Reg, unsigned SubIdx, RegState State) const
ARMCC::CondCodes getPredicate(const MachineInstr &MI) const
bool isFunctionSafeToOutlineFrom(MachineFunction &MF, bool OutlineFromLinkOnceODRs) const override
ARM supports the MachineOutliner.
bool shouldOutlineFromFunctionByDefault(MachineFunction &MF) const override
Enable outlining by default at -Oz.
std::optional< DestSourcePair > isCopyInstrImpl(const MachineInstr &MI) const override
If the specific machine instruction is an instruction that moves/copies value from one register to an...
MachineInstr & duplicate(MachineBasicBlock &MBB, MachineBasicBlock::iterator InsertBefore, const MachineInstr &Orig) const override
ScheduleHazardRecognizer * CreateTargetMIHazardRecognizer(const InstrItineraryData *II, const ScheduleDAGMI *DAG) const override
MachineBasicBlock::iterator insertOutlinedCall(Module &M, MachineBasicBlock &MBB, MachineBasicBlock::iterator &It, MachineFunction &MF, outliner::Candidate &C) const override
std::string createMIROperandComment(const MachineInstr &MI, const MachineOperand &Op, unsigned OpIdx, const TargetRegisterInfo *TRI) const override
bool isPredicated(const MachineInstr &MI) const override
bool isSchedulingBoundary(const MachineInstr &MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const override
void expandLoadStackGuardBase(MachineBasicBlock::iterator MI, unsigned LoadImmOpc, unsigned LoadOpc) const
bool isPredicable(const MachineInstr &MI) const override
isPredicable - Return true if the specified instruction can be predicated.
unsigned getFramePred(const MachineInstr &MI) const
Returns predicate register associated with the given frame instruction.
Register isLoadFromStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override
std::optional< ParamLoadedValue > describeLoadedValue(const MachineInstr &MI, Register Reg) const override
Specialization of TargetInstrInfo::describeLoadedValue, used to enhance debug entry value description...
std::optional< std::unique_ptr< outliner::OutlinedFunction > > getOutliningCandidateInfo(const MachineModuleInfo &MMI, std::vector< outliner::Candidate > &RepeatedSequenceLocs, unsigned MinRepeats) const override
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
unsigned extraSizeToPredicateInstructions(const MachineFunction &MF, unsigned NumInsts) const override
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
const ARMBaseRegisterInfo & getRegisterInfo() const
bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, int64_t &Offset1, int64_t &Offset2) const override
areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to determine if two loads are lo...
std::optional< unsigned > getOperandLatency(const InstrItineraryData *ItinData, const MachineInstr &DefMI, unsigned DefIdx, const MachineInstr &UseMI, unsigned UseIdx) const override
const TargetRegisterClass * getInlineAsmMemoryOperandRegClass(InlineAsm::ConstraintCode C) const override
bool getRegSequenceLikeInputs(const MachineInstr &MI, unsigned DefIdx, SmallVectorImpl< RegSubRegPairAndIdx > &InputRegs) const override
Build the equivalent inputs of a REG_SEQUENCE for the given MI and DefIdx.
unsigned predictBranchSizeForIfCvt(MachineInstr &MI) const override
bool getInsertSubregLikeInputs(const MachineInstr &MI, unsigned DefIdx, RegSubRegPair &BaseReg, RegSubRegPairAndIdx &InsertedReg) const override
Build the equivalent inputs of a INSERT_SUBREG for the given MI and DefIdx.
bool expandPostRAPseudo(MachineInstr &MI) const override
outliner::InstrType getOutliningTypeImpl(const MachineModuleInfo &MMI, MachineBasicBlock::iterator &MIT, unsigned Flags) const override
bool SubsumesPredicate(ArrayRef< MachineOperand > Pred1, ArrayRef< MachineOperand > Pred2) const override
bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, int64_t Offset1, int64_t Offset2, unsigned NumLoads) const override
shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to determine (in conjunction w...
bool PredicateInstruction(MachineInstr &MI, ArrayRef< MachineOperand > Pred) const override
std::pair< uint16_t, uint16_t > getExecutionDomain(const MachineInstr &MI) const override
VFP/NEON execution domains.
bool isProfitableToUnpredicate(MachineBasicBlock &TMBB, MachineBasicBlock &FMBB) const override
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, Register SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, Register VReg, MachineInstr::MIFlag Flags=MachineInstr::NoFlags) const override
bool isFpMLxInstruction(unsigned Opcode) const
isFpMLxInstruction - Return true if the specified opcode is a fp MLA / MLS instruction.
bool isSwiftFastImmShift(const MachineInstr *MI) const
Returns true if the instruction has a shift by immediate that can be executed in one cycle less.
void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, unsigned SubIdx, const MachineInstr &Orig, LaneBitmask UsedLanes=LaneBitmask::getAll()) const override
ARMBaseInstrInfo(const ARMSubtarget &STI, const ARMBaseRegisterInfo &TRI)
ArrayRef< std::pair< unsigned, const char * > > getSerializableDirectMachineOperandTargetFlags() const override
Register isStoreToStackSlotPostFE(const MachineInstr &MI, int &FrameIndex) const override
bool analyzeCompare(const MachineInstr &MI, Register &SrcReg, Register &SrcReg2, int64_t &CmpMask, int64_t &CmpValue) const override
analyzeCompare - For a comparison instruction, return the source registers in SrcReg and SrcReg2 if h...
Register isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override
void breakPartialRegDependency(MachineInstr &, unsigned, const TargetRegisterInfo *TRI) const override
bool isMBBSafeToOutlineFrom(MachineBasicBlock &MBB, unsigned &Flags) const override
void buildOutlinedFrame(MachineBasicBlock &MBB, MachineFunction &MF, const outliner::OutlinedFunction &OF) const override
Register isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override
const ARMSubtarget & getSubtarget() const
MachineInstr * commuteInstructionImpl(MachineInstr &MI, bool NewMI, unsigned OpIdx1, unsigned OpIdx2) const override
Commutes the operands in the given instruction.
bool getExtractSubregLikeInputs(const MachineInstr &MI, unsigned DefIdx, RegSubRegPairAndIdx &InputReg) const override
Build the equivalent inputs of a EXTRACT_SUBREG for the given MI and DefIdx.
bool shouldSink(const MachineInstr &MI) const override
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Container class for subtarget features.
Itinerary data supplied by a subtarget to be used by a target.
A wrapper class for inspecting calls to intrinsic functions.
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
Describe properties that are true of each instruction in the target description file.
Wrapper class representing physical registers. Should be passed by value.
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
This class contains meta information specific to a module.
MachineOperand class - Representation of each machine instruction operand.
static MachineOperand CreateImm(int64_t Val)
static MachineOperand CreateReg(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
A Module instance is used to store all the information related to an LLVM module.
Wrapper class representing virtual and physical registers.
Represents one node in the SelectionDAG.
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
HazardRecognizer - This determines whether or not an instruction can be issued this cycle,...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Represent a constant reference to a string, i.e.
TargetInstrInfo - Interface to description of machine instruction set.
const TargetRegisterInfo & getRegisterInfo() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Provide an instruction scheduling machine model to CodeGen passes.
TargetSubtargetInfo - Generic base class for all target subtargets.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
InstrType
Represents how an instruction should be mapped by the outliner.
This is an optimization pass for GlobalISel generic memory operations.
static bool isIndirectCall(const MachineInstr &MI)
MachineInstr * findCMPToFoldIntoCBZ(MachineInstr *Br, const TargetRegisterInfo *TRI)
Search backwards from a tBcc to find a tCMPi8 against 0, meaning we can convert them to a tCBZ or tCB...
static bool isCondBranchOpcode(int Opc)
bool HasLowerConstantMaterializationCost(unsigned Val1, unsigned Val2, const ARMSubtarget *Subtarget, bool ForCodesize=false)
Returns true if Val1 has a lower Constant Materialization Cost than Val2.
static bool isPushOpcode(int Opc)
void addPredicatedMveVpredNOp(MachineInstrBuilder &MIB, unsigned Cond)
RegState
Flags to represent properties of register accesses.
unsigned getBLXpredOpcode(const MachineFunction &MF)
static bool isIndirectBranchOpcode(int Opc)
static bool isVPTOpcode(int Opc)
bool isLegalAddressImm(unsigned Opcode, int Imm, const TargetInstrInfo *TII)
bool rewriteT2FrameIndex(MachineInstr &MI, unsigned FrameRegIdx, Register FrameReg, int &Offset, const ARMBaseInstrInfo &TII, const TargetRegisterInfo *TRI)
bool registerDefinedBetween(unsigned Reg, MachineBasicBlock::iterator From, MachineBasicBlock::iterator To, const TargetRegisterInfo *TRI)
Return true if Reg is defd between From and To.
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
static bool isMovRegOpcode(int Opc)
bool isGather(IntrinsicInst *IntInst)
static bool isSEHInstruction(const MachineInstr &MI)
static bool isSubImmOpcode(int Opc)
bool isGatherScatter(IntrinsicInst *IntInst)
bool tryFoldSPUpdateIntoPushPop(const ARMSubtarget &Subtarget, MachineFunction &MF, MachineInstr *MI, unsigned NumBytes)
Tries to add registers to the reglist of a given base-updating push/pop instruction to adjust the sta...
static bool isJumpTableBranchOpcode(int Opc)
bool isMVEVectorInstruction(const MachineInstr *MI)
static bool isPopOpcode(int Opc)
void addPredicatedMveVpredROp(MachineInstrBuilder &MIB, unsigned Cond, unsigned Inactive)
static bool isValidCoprocessorNumber(unsigned Num, const FeatureBitset &featureBits)
isValidCoprocessorNumber - decide whether an explicit coprocessor number is legal in generic instruct...
void addUnpredicatedMveVpredROp(MachineInstrBuilder &MIB, Register DestReg)
unsigned ConstantMaterializationCost(unsigned Val, const ARMSubtarget *Subtarget, bool ForCodesize=false)
Returns the number of instructions required to materialize the given constant in a register,...
bool rewriteARMFrameIndex(MachineInstr &MI, unsigned FrameRegIdx, Register FrameReg, int &Offset, const ARMBaseInstrInfo &TII)
rewriteARMFrameIndex / rewriteT2FrameIndex - Rewrite MI to access 'Offset' bytes from the FP.
static bool isIndirectControlFlowNotComingBack(const MachineInstr &MI)
void emitThumbRegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, Register DestReg, Register BaseReg, int NumBytes, const TargetInstrInfo &TII, const ARMBaseRegisterInfo &MRI, unsigned MIFlags=0)
emitThumbRegPlusImmediate - Emits a series of instructions to materialize a destreg = basereg + immed...
ARMCC::CondCodes getInstrPredicate(const MachineInstr &MI, Register &PredReg)
getInstrPredicate - If instruction is predicated, returns its predicate condition,...
unsigned getMatchingCondBranchOpcode(unsigned Opc)
DWARFExpression::Operation Op
static bool isUncondBranchOpcode(int Opc)
bool isScatter(IntrinsicInst *IntInst)
static MachineOperand t1CondCodeOp(bool isDead=false)
Get the operand corresponding to the conditional code result for Thumb1.
static unsigned VCMPOpcodeToVPT(unsigned Opcode)
static MachineOperand condCodeOp(unsigned CCReg=0)
Get the operand corresponding to the conditional code result.
unsigned gettBLXrOpcode(const MachineFunction &MF)
int getAddSubImmediate(MachineInstr &MI)
static bool isSpeculationBarrierEndBBOpcode(int Opc)
unsigned getBLXOpcode(const MachineFunction &MF)
void addUnpredicatedMveVpredNOp(MachineInstrBuilder &MIB)
void emitARMRegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, Register DestReg, Register BaseReg, int NumBytes, ARMCC::CondCodes Pred, Register PredReg, const ARMBaseInstrInfo &TII, unsigned MIFlags=0)
emitARMRegPlusImmediate / emitT2RegPlusImmediate - Emits a series of instructions to materializea des...
unsigned convertAddSubFlagsOpcode(unsigned OldOpc)
Map pseudo instructions that imply an 'S' bit onto real opcodes.
void emitT2RegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, Register DestReg, Register BaseReg, int NumBytes, ARMCC::CondCodes Pred, Register PredReg, const ARMBaseInstrInfo &TII, unsigned MIFlags=0)
MCRegisterClass TargetRegisterClass
static constexpr LaneBitmask getAll()
An individual sequence of instructions to be replaced with a call to an outlined function.
The information necessary to create an outlined function for some class of candidate.