28#include "llvm/IR/IntrinsicsHexagon.h"
38#define DEBUG_TYPE "hexagon-subtarget"
40#define GET_SUBTARGETINFO_CTOR
41#define GET_SUBTARGETINFO_TARGET_DESC
42#include "HexagonGenSubtargetInfo.inc"
52 cl::desc(
"Enable the scheduler to generate .cur"));
56 cl::desc(
"Disable Hexagon MI Scheduling"));
60 cl::desc(
"If present, forces/disables the use of long calls"));
64 cl::desc(
"Consider calls to be predicable"));
74 cl::desc(
"Enable checking for cache bank conflicts"));
82 TLInfo(TM, *this), InstrItins(getInstrItineraryForCPU(CPUString)) {
86 assert(InstrItins.Itineraries !=
nullptr &&
"InstrItins not initialized");
97 UseHVX128BOps =
false;
100 UseLongCalls =
false;
109 return F ==
"+hvx-qfloat" ||
F ==
"-hvx-qfloat";
114 if (
F.starts_with(
"+hvxv"))
120 if (
F.starts_with(
"+hvx") ||
F ==
"-hvx")
121 return F.take_front(4);
126 bool AddQFloat =
false;
132 }
else if (HvxVer ==
"+hvx") {
141 std::string FeatureString = Features.
getString();
149 static_assert(Hexagon::R27 - Hexagon::R16 == 11,
150 "Callee-saved R16-R27 are assumed to be consecutive");
151 SCSPReg = Hexagon::R18;
152 bool SCSRegSelected =
false;
153 for (
unsigned Reg = Hexagon::R16; Reg <= Hexagon::R27; ++Reg) {
154 if (!SCSPointerRegister[Reg])
158 "Only one shadow call stack pointer register may be selected");
160 SCSRegSelected =
true;
164 UseHVXFloatingPoint = UseHVXIEEEFPOps || UseHVXQFloatOps;
166 if (UseHVXQFloatOps && UseHVXIEEEFPOps && UseHVXFloatingPoint)
168 dbgs() <<
"Behavior is undefined for simultaneous qfloat and ieee hvx codegen...");
184 setFeatureBits(FeatureBits.
reset(Hexagon::FeatureDuplex));
196 static const struct {
197 const RTLIB::Libcall
Op;
198 const RTLIB::LibcallImpl Impl;
200 {RTLIB::SDIV_I32, RTLIB::impl___hexagon_divsi3},
201 {RTLIB::SDIV_I64, RTLIB::impl___hexagon_divdi3},
202 {RTLIB::UDIV_I32, RTLIB::impl___hexagon_udivsi3},
203 {RTLIB::UDIV_I64, RTLIB::impl___hexagon_udivdi3},
204 {RTLIB::SREM_I32, RTLIB::impl___hexagon_modsi3},
205 {RTLIB::SREM_I64, RTLIB::impl___hexagon_moddi3},
206 {RTLIB::UREM_I32, RTLIB::impl___hexagon_umodsi3},
207 {RTLIB::UREM_I64, RTLIB::impl___hexagon_umoddi3},
208 {RTLIB::ADD_F64, RTLIB::impl___hexagon_adddf3},
209 {RTLIB::SUB_F64, RTLIB::impl___hexagon_subdf3},
210 {RTLIB::MUL_F64, RTLIB::impl___hexagon_muldf3},
211 {RTLIB::DIV_F64, RTLIB::impl___hexagon_divdf3},
212 {RTLIB::DIV_F32, RTLIB::impl___hexagon_divsf3},
214 for (
const auto &LC : LibraryCalls)
215 Info.setLibcallImpl(LC.Op, LC.Impl);
222 Ty = Ty.getVectorElementType();
223 if (IncludeBool && Ty == MVT::i1)
235 if (!IncludeBool &&
ElemTy == MVT::i1)
242 if (IncludeBool &&
ElemTy == MVT::i1) {
245 for (
MVT T : ElemTypes)
246 if (NumElems *
T.getSizeInBits() == 8 * HwLen)
252 if (VecWidth != 8 * HwLen && VecWidth != 16 * HwLen)
271 if (!Ty.getVectorElementType().isSimple())
274 auto isHvxTy = [
this, IncludeBool](
MVT SimpleTy) {
283 MVT ElemTy = Ty.getVectorElementType().getSimpleVT();
284 unsigned VecLen =
PowerOf2Ceil(Ty.getVectorNumElements());
287 if (SimpleTy.
isValid() && isHvxTy(SimpleTy))
299 Ty = Ty.getVectorElementType();
315 if (VecWidth != 8 * HwLen && VecWidth != 16 * HwLen)
330 if (!Ty.getVectorElementType().isSimple())
333 auto isHLXTy = [
this](
MVT SimpleTy) {
342 MVT ElemTy = Ty.getVectorElementType().getSimpleVT();
343 unsigned VecLen =
PowerOf2Ceil(Ty.getVectorNumElements());
346 if (SimpleTy.
isValid() && isHLXTy(SimpleTy))
360 if (
D.getKind() ==
SDep::Output &&
D.getReg() == Hexagon::USR_OVF)
362 for (
auto &E : Erase)
375 bool IsLoadMI1 = MI1.
mayLoad();
376 if (!QII->isHVXVec(MI1) || !(IsStoreMI1 || IsLoadMI1))
382 if (!QII->isHVXVec(MI2))
388 for (
SDep &PI :
SI.getSUnit()->Preds) {
389 if (PI.getSUnit() != &SU || PI.getKind() !=
SDep::Order)
392 SI.getSUnit()->setDepthDirty();
414 SUnit *
A =
nullptr, *W =
nullptr;
417 if (HII.isHMXActivateInstr(*
MI)) {
418 assert(
A ==
nullptr &&
"Unexpected activation instruction");
422 }
else if (HII.isHMXWeightInstr(*
MI)) {
423 assert(W ==
nullptr &&
"Unexpected weight instruction");
434 assert(
A ==
nullptr &&
"Unmatched activation instruction");
435 assert(W ==
nullptr &&
"Unmatched weight instruction");
441 for (
SDep &
D : FirstSU->Succs) {
442 if (
D.getSUnit() == SecondSU) {
444 FirstSU->setHeightDirty();
449 if (
D.getSUnit() == FirstSU) {
457 assert(Entry->getDepth() == 0);
474 if (!
First.count(&SU))
476 SUnit *FirstSU = &SU;
493bool HexagonSubtarget::CallMutation::shouldTFRICallBind(
495 const SUnit &Inst2)
const {
507 SUnit* LastSequentialCall =
nullptr;
518 for (
unsigned su = 0, e = DAG->
SUnits.size(); su != e; ++su) {
520 if (DAG->
SUnits[su].getInstr()->isCall())
521 LastSequentialCall = &DAG->
SUnits[su];
523 else if (DAG->
SUnits[su].getInstr()->isCompare() && LastSequentialCall)
527 shouldTFRICallBind(HII, DAG->
SUnits[su], DAG->
SUnits[su+1]))
545 if (
MI->isCopy() &&
MI->getOperand(1).getReg().isPhysical()) {
547 VRegHoldingReg[
MI->getOperand(0).getReg()] =
MI->getOperand(1).getReg();
548 LastVRegUse.
erase(
MI->getOperand(1).getReg());
553 if (MO.isUse() && !
MI->isCopy() &&
554 VRegHoldingReg.
count(MO.getReg())) {
556 LastVRegUse[VRegHoldingReg[MO.getReg()]] = &DAG->
SUnits[su];
557 }
else if (MO.isDef() && MO.getReg().isPhysical()) {
560 if (
auto It = LastVRegUse.
find(*AI); It != LastVRegUse.
end()) {
561 if (It->second != &DAG->
SUnits[su])
565 LastVRegUse.
erase(It);
603 unsigned BasePos = 1;
608 unsigned OffsetPos = BasePos + 1;
612 if (!ShiftOp.
isImm())
647 if (A0.Sym == A1.Sym)
653 const Align BankPeriod(32);
654 auto HasKnownBankBits = [&](
const GlobalValue *Sym) {
655 return !Sym || Sym->getPointerAlignment(
DL) >= BankPeriod;
657 return HasKnownBankBits(A0.Sym) && HasKnownBankBits(A1.Sym);
667 bool IgnoreSameLine) {
670 std::optional<BankAddr> A0 =
getBankAddr(MI0, HII);
672 if (!A0 || A0->Size == 0 || A0->Size >= 32)
674 std::optional<BankAddr> A1 =
getBankAddr(MI1, HII);
675 if (!A1 || A1->Size == 0 || A1->Size >= 32 || A0->Base != A1->Base ||
676 A0->Shift != A1->Shift ||
682 if (IgnoreSameLine && A0->Sym == A1->Sym &&
683 (A0->Offset & ~int64_t(31)) == (A1->Offset & ~int64_t(31)))
703 bool HasDoubleWord = A0->Size == 8 || A1->Size == 8;
704 int64_t BankMask = HasDoubleWord ? 0x18 : 0x1C;
705 return ((A0->Offset ^ A1->Offset) & BankMask) == 0;
717 for (
unsigned i = 0, e = DAG->
SUnits.size(); i != e; ++i) {
722 for (
unsigned j = i+1, m = std::min(i+32, e); j != m; ++j) {
741 if (!HST.useHLXOps())
744 auto setLatency = [](
SUnit &From,
SUnit &To) {
748 for (
SDep &Dep : To.Preds)
783 if (!Src->isInstr() || !Dst->isInstr())
794 isBestZeroLatency(Src, Dst, QII, ExclSrc, ExclDst)) {
811 std::optional<unsigned> DLatency;
812 for (
const auto &DDep : Dst->Succs) {
815 for (
unsigned OpNum = 0; OpNum < DDst->
getNumOperands(); OpNum++) {
826 std::optional<unsigned>
Latency =
827 InstrInfo.getOperandLatency(&InstrItins, *SrcInst, 0, *DDst, UseIdx);
836 DLatency = std::nullopt;
847 isBestZeroLatency(Src, Dst, QII, ExclSrc, ExclDst)) {
858 std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations)
const {
859 Mutations.push_back(std::make_unique<UsrOverflowMutation>());
860 Mutations.push_back(std::make_unique<HVXMemLatencyMutation>());
861 Mutations.push_back(std::make_unique<HMXActivateWeightMutation>());
862 Mutations.push_back(std::make_unique<BankConflictMutation>());
863 Mutations.push_back(std::make_unique<HLXPseudoMutation>());
867 std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations)
const {
868 Mutations.push_back(std::make_unique<UsrOverflowMutation>());
869 Mutations.push_back(std::make_unique<HVXMemLatencyMutation>());
870 Mutations.push_back(std::make_unique<HMXActivateWeightMutation>());
874void HexagonSubtarget::anchor() {}
901void HexagonSubtarget::restoreLatency(
SUnit *Src,
SUnit *Dst)
const {
903 for (
auto &
I : Src->Succs) {
904 if (!
I.isAssignedRegDep() ||
I.getSUnit() != Dst)
908 for (
unsigned OpNum = 0; OpNum < SrcI->
getNumOperands(); OpNum++) {
910 bool IsSameOrSubReg =
false;
914 IsSameOrSubReg = (MOReg == DepR);
918 if (MO.
isDef() && IsSameOrSubReg)
922 assert(DefIdx >= 0 &&
"Def Reg not found in Src MI");
923 MachineInstr *DstI = Dst->getInstr();
925 for (
unsigned OpNum = 0; OpNum < DstI->
getNumOperands(); OpNum++) {
926 const MachineOperand &MO = DstI->
getOperand(OpNum);
928 std::optional<unsigned>
Latency = InstrInfo.getOperandLatency(
929 &InstrItins, *SrcI, DefIdx, *DstI, OpNum);
935 bool IsArtificial =
I.isArtificial();
943 auto F =
find(Dst->Preds,
T);
945 F->setLatency(
I.getLatency());
950void HexagonSubtarget::changeLatency(SUnit *Src, SUnit *Dst,
unsigned Lat)
952 for (
auto &
I : Src->Succs) {
953 if (!
I.isAssignedRegDep() ||
I.getSUnit() != Dst)
960 auto F =
find(Dst->Preds,
T);
969 if (
I.isAssignedRegDep() &&
I.getLatency() == 0 &&
970 !
I.getSUnit()->getInstr()->isPseudo())
979bool HexagonSubtarget::isBestZeroLatency(
980 SUnit *Src, SUnit *Dst,
const HexagonInstrInfo *
TII,
981 SmallPtrSet<SUnit *, 4> &ExclSrc, SmallPtrSet<SUnit *, 4> &ExclDst)
const {
982 MachineInstr &SrcInst = *Src->getInstr();
983 MachineInstr &DstInst = *Dst->getInstr();
986 if (Dst->isBoundaryNode())
992 if (!
TII->isToBeScheduledASAP(SrcInst, DstInst) &&
993 !
TII->canExecuteInBundle(SrcInst, DstInst))
1003 SUnit *Best =
nullptr;
1004 SUnit *DstBest =
nullptr;
1006 if (SrcBest ==
nullptr || Src->NodeNum >= SrcBest->
NodeNum) {
1009 if (DstBest ==
nullptr || Dst->NodeNum <= DstBest->
NodeNum)
1017 if ((Src == SrcBest && Dst == DstBest ) ||
1018 (SrcBest ==
nullptr && Dst == DstBest) ||
1019 (Src == SrcBest && Dst ==
nullptr))
1024 if (SrcBest !=
nullptr) {
1026 changeLatency(SrcBest, Dst, 1);
1028 restoreLatency(SrcBest, Dst);
1030 if (DstBest !=
nullptr) {
1032 changeLatency(Src, DstBest, 1);
1034 restoreLatency(Src, DstBest);
1039 if (SrcBest && DstBest)
1042 changeLatency(SrcBest, DstBest, 0);
1047 for (
auto &
I : DstBest->
Preds)
1048 if (ExclSrc.
count(
I.getSUnit()) == 0 &&
1049 isBestZeroLatency(
I.getSUnit(), DstBest,
TII, ExclSrc, ExclDst))
1050 changeLatency(
I.getSUnit(), DstBest, 0);
1051 }
else if (SrcBest) {
1055 for (
auto &
I : SrcBest->
Succs)
1056 if (ExclDst.
count(
I.getSUnit()) == 0 &&
1057 isBestZeroLatency(SrcBest,
I.getSUnit(),
TII, ExclSrc, ExclDst))
1058 changeLatency(SrcBest,
I.getSUnit(), 0);
1084 static Scalar ScalarInts[] = {
1085#define GET_SCALAR_INTRINSICS
1087#undef GET_SCALAR_INTRINSICS
1090 static Hvx HvxInts[] = {
1091#define GET_HVX_INTRINSICS
1093#undef GET_HVX_INTRINSICS
1096 const auto CmpOpcode = [](
auto A,
auto B) {
return A.Opcode <
B.Opcode; };
1097 [[maybe_unused]]
static bool SortedScalar =
1099 [[maybe_unused]]
static bool SortedHvx =
1102 auto [BS, ES] = std::make_pair(std::begin(ScalarInts), std::end(ScalarInts));
1103 auto [BH, EH] = std::make_pair(std::begin(HvxInts), std::end(HvxInts));
1105 auto FoundScalar = std::lower_bound(BS, ES, Scalar{
Opc, 0}, CmpOpcode);
1106 if (FoundScalar != ES && FoundScalar->Opcode ==
Opc)
1107 return FoundScalar->IntId;
1109 auto FoundHvx = std::lower_bound(BH, EH, Hvx{
Opc, 0, 0}, CmpOpcode);
1110 if (FoundHvx != EH && FoundHvx->Opcode ==
Opc) {
1113 return FoundHvx->Int64Id;
1115 return FoundHvx->Int128Id;
1118 std::string
error =
"Invalid opcode (" + std::to_string(
Opc) +
")";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
const AArch64InstrInfo & TII
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static cl::opt< bool > DisableHexagonMISched("disable-hexagon-misched", cl::Hidden, cl::desc("Disable Hexagon MI Scheduling"))
static cl::opt< bool > EnableDotCurSched("enable-cur-sched", cl::Hidden, cl::init(true), cl::desc("Enable the scheduler to generate .cur"))
static cl::opt< bool > EnableCheckBankConflict("hexagon-check-bank-conflict", cl::Hidden, cl::init(true), cl::desc("Enable checking for cache bank conflicts"))
static cl::opt< bool > OverrideLongCalls("hexagon-long-calls", cl::Hidden, cl::desc("If present, forces/disables the use of long calls"))
static cl::opt< bool > SchedPredsCloser("sched-preds-closer", cl::Hidden, cl::init(true))
static cl::opt< bool > SchedRetvalOptimization("sched-retval-optimization", cl::Hidden, cl::init(true))
static cl::opt< bool > EnableTCLatencySched("enable-tc-latency-sched", cl::Hidden, cl::init(false))
static bool haveComparableSyms(const BankAddr &A0, const BankAddr &A1, const DataLayout &DL)
static cl::opt< bool > EnableBSBSched("enable-bsb-sched", cl::Hidden, cl::init(true))
static std::optional< BankAddr > getBankAddr(const MachineInstr &MI, const HexagonInstrInfo &HII)
static SUnit * getZeroLatency(SUnit *N, SmallVector< SDep, 4 > &Deps)
If the SUnit has a zero latency edge, return the other SUnit.
static cl::opt< bool > EnablePredicatedCalls("hexagon-pred-calls", cl::Hidden, cl::desc("Consider calls to be predicable"))
std::pair< Instruction::BinaryOps, Value * > OffsetOp
Find all possible pairs (BinOp, RHS) that BinOp V, RHS can be simplified.
Register const TargetRegisterInfo * TRI
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
A parsed version of the target data layout string in and methods for querying it.
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
iterator find(const_arg_type_t< KeyT > Val)
bool erase(const KeyT &Val)
ValueT lookup(const_arg_type_t< KeyT > Val) const
Return the entry for the specified key, or a default constructed value if no such entry exists.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Implements a dense probed hash-table based set.
Container class for subtarget features.
constexpr FeatureBitset & reset(unsigned I)
bool isTmpLoadPseudo(const MachineInstr &MI) const
bool isHLXVec(const MachineInstr &MI) const
bool isPredicated(const MachineInstr &MI) const override
Returns true if the instruction is already predicated.
unsigned getAddrMode(const MachineInstr &MI) const
bool canExecuteInBundle(const MachineInstr &First, const MachineInstr &Second) const
Can these instructions execute at the same time in a bundle.
unsigned getMemAccessSize(const MachineInstr &MI) const
bool isPostIncrement(const MachineInstr &MI) const override
Return true for post-incremented instructions.
bool isMemOp(const MachineInstr &MI) const
bool isNewStorePseudo(const MachineInstr &MI) const
bool isHVXVec(const MachineInstr &MI) const
bool isToBeScheduledASAP(const MachineInstr &MI1, const MachineInstr &MI2) const
uint64_t getType(const MachineInstr &MI) const
Hexagon::ArchEnum HexagonArchVersion
void adjustSchedDependency(SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx, SDep &Dep, const TargetSchedModel *SchedModel) const override
Perform target specific adjustments to the latency of a schedule dependency.
bool usePredicatedCalls() const
bool isTypeForHLX(Type *VecTy) const
const HexagonInstrInfo * getInstrInfo() const override
unsigned getHLXVectorLength() const
const HexagonRegisterInfo * getRegisterInfo() const override
void getSMSMutations(std::vector< std::unique_ptr< ScheduleDAGMutation > > &Mutations) const override
HexagonSubtarget(const Triple &TT, StringRef CPU, StringRef FS, const TargetMachine &TM)
bool isHVXVectorType(EVT VecTy, bool IncludeBool=false) const
ArrayRef< MVT > getHLXElementTypes() const
void getPostRAMutations(std::vector< std::unique_ptr< ScheduleDAGMutation > > &Mutations) const override
const HexagonTargetLowering * getTargetLowering() const override
bool UseBSBScheduling
True if the target should use Back-Skip-Back scheduling.
unsigned getL1PrefetchDistance() const
ArrayRef< MVT > getHVXElementTypes() const
bool useHVXFloatingPoint() const
bool enableSubRegLiveness() const override
unsigned getVectorLength() const
void initLibcallLoweringInfo(LibcallLoweringInfo &Info) const override
bool isHLXElementType(MVT Ty) const
int updateLatency(MachineInstr &SrcInst, MachineInstr &DstInst, bool IsArtificial, int Latency) const
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool useHVXV68Ops() const
unsigned getL1CacheLineSize() const
bool isTypeForHVX(Type *VecTy, bool IncludeBool=false) const
Intrinsic::ID getIntrinsicId(unsigned Opc) const
HexagonSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
static bool mayHaveBankConflict(const MachineInstr &MI0, const MachineInstr &MI1, const HexagonInstrInfo &HII, bool IgnoreSameLine=true)
bool enableMachineScheduler() const override
bool isHLXVectorType(EVT VecTy) const
bool useBSBScheduling() const
bool isHVXElementType(MVT Ty, bool IncludeBool=false) const
bool useAA() const override
Enable use of alias analysis during code generation (during MI scheduling, DAGCombine,...
LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
Tracks which library functions to use for a particular subtarget or function.
MCRegAliasIterator enumerates all registers aliasing Reg.
static MVT getVectorVT(MVT VT, unsigned NumElements)
MVT getVectorElementType() const
bool isValid() const
Return true if this is a valid simple valuetype.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
unsigned getNumOperands() const
Retuns the total number of operands.
bool mayLoad(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly read memory.
bool isRegSequence() const
LLVM_ABI const MachineFunction * getMF() const
Return the function that contains the basic block that this instruction belongs to.
bool mayStore(QueryType Type=AnyInBundle) const
Return true if this instruction could possibly modify memory.
const MachineOperand & getOperand(unsigned i) const
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
Register getReg() const
getReg - Returns the register number.
Represent a mutable reference to an array (0 or more elements consecutively in memory),...
MutableArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
Kind getKind() const
Returns an enum value representing the kind of the dependence.
@ Output
A register output-dependence (aka WAW).
@ Order
Any other ordering dependency.
@ Data
Regular data dependence (aka true-dependence).
void setLatency(unsigned Lat)
Sets the latency for this edge.
@ Barrier
An unknown scheduling barrier.
@ Artificial
Arbitrary strong DAG edge (no real dependence).
unsigned getLatency() const
Returns the latency value for this edge, which roughly means the minimum number of cycles that must e...
bool isArtificial() const
Tests if this is an Order dependence that is marked as "artificial", meaning it isn't necessary for c...
Scheduling unit. This is a node in the scheduling DAG.
bool isInstr() const
Returns true if this SUnit refers to a machine instruction as opposed to an SDNode.
unsigned NodeNum
Entry # of node in the node vector.
LLVM_ABI void setHeightDirty()
Sets a flag in this node to indicate that its stored Height value will require recomputation the next...
LLVM_ABI void removePred(const SDep &D)
Removes the specified edge as a pred of the current node if it exists.
unsigned getDepth() const
Returns the depth of this node, which is the length of the maximum path up to any node which has no p...
SmallVector< SDep, 4 > Succs
All sunit successors.
LLVM_ABI void setDepthDirty()
Sets a flag in this node to indicate that its stored Depth value will require recomputation the next ...
SmallVector< SDep, 4 > Preds
All sunit predecessors.
LLVM_ABI bool addPred(const SDep &D, bool Required=true)
Adds the specified edge as a pred of the current node if not already.
MachineInstr * getInstr() const
Returns the representative MachineInstr for this SUnit.
A ScheduleDAG for scheduling lists of MachineInstr.
bool addEdge(SUnit *SuccSU, const SDep &PredDep)
Add a DAG edge to the given SU with the given predecessor dependence data.
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
const TargetInstrInfo * TII
Target instruction information.
std::vector< SUnit > SUnits
The scheduling units.
MachineFunction & MF
Machine function.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
bool consumeInteger(unsigned Radix, T &Result)
Parse the current string as an integer of the specified radix.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
Manages the enabling and disabling of subtarget specific features.
const std::vector< std::string > & getFeatures() const
Returns the vector of individual subtarget features.
LLVM_ABI std::string getString() const
Returns features as a string.
LLVM_ABI void AddFeature(StringRef String, bool Enable=true)
Adds Features.
Primary interface to the complete machine description for the target machine.
Provide an instruction scheduling machine model to CodeGen passes.
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
Triple - Helper class for working with autoconf configuration names.
The instances of the Type class are immutable: once they are created, they are never changed.
bool isVectorTy() const
True if this is an instance of VectorType.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isIntegerTy() const
True if this is an instance of IntegerType.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void addArchSubtarget(MCSubtargetInfo const *STI, StringRef FS)
FeatureBitset completeHVXFeatures(const FeatureBitset &FB)
std::optional< Hexagon::ArchEnum > getCpu(StringRef CPU)
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
uint64_t PowerOf2Ceil(uint64_t A)
Returns the power of two which is greater than or equal to the given value.
auto reverse(ContainerTy &&C)
void sort(IteratorTy Start, IteratorTy End)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
DWARFExpression::Operation Op
auto count_if(R &&Range, UnaryPredicate P)
Wrapper function around std::count_if to count the number of times an element satisfying a given pred...
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
cl::opt< bool > HexagonDisableDuplex
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
static LLVM_ABI EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
bool isVector() const
Return true if this is a vector value type.
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
void apply(ScheduleDAGInstrs *DAG) override
void apply(ScheduleDAGInstrs *DAG) override
void apply(ScheduleDAGInstrs *DAG) override
void apply(ScheduleDAGInstrs *DAG) override
void apply(ScheduleDAGInstrs *DAG) override
void apply(ScheduleDAGInstrs *DAG) override