33#define DEBUG_TYPE "si-pre-emit-peephole"
37class SIPreEmitPeephole {
101 auto *MLIWrapper = getAnalysisIfAvailable<MachineLoopInfoWrapperPass>();
103 return SIPreEmitPeephole().run(MF, MLI);
110 "SI peephole optimizations",
false,
false)
112char SIPreEmitPeepholeLegacy::ID = 0;
116void SIPreEmitPeephole::updateMLIBeforeRemovingEdge(
127 unsigned BackEdgeCount = 0;
129 if (Loop->contains(Pred))
133 if (BackEdgeCount > 1)
140 if (MLI->getLoopFor(BB) == Loop)
141 MLI->changeLoopFor(BB, ParentLoop);
146 MachineLoop *Child = Loop->removeChildLoop(std::prev(Loop->end()));
148 ParentLoop->addChildLoop(Child);
150 MLI->addTopLevelLoop(Child);
161bool SIPreEmitPeephole::optimizeVccBranch(
MachineInstr &
MI)
const {
181 MachineBasicBlock &
MBB = *
MI.getParent();
183 const bool IsWave32 =
ST.isWave32();
184 const unsigned CondReg =
TRI->getVCC();
185 const unsigned ExecReg = IsWave32 ? AMDGPU::EXEC_LO : AMDGPU::EXEC;
186 const unsigned And = IsWave32 ? AMDGPU::S_AND_B32 : AMDGPU::S_AND_B64;
187 const unsigned AndN2 = IsWave32 ? AMDGPU::S_ANDN2_B32 : AMDGPU::S_ANDN2_B64;
188 const unsigned Mov = IsWave32 ? AMDGPU::S_MOV_B32 : AMDGPU::S_MOV_B64;
192 bool ReadsCond =
false;
193 unsigned Threshold = 5;
194 for (++
A;
A !=
E; ++
A) {
197 if (
A->modifiesRegister(ExecReg,
TRI))
199 if (
A->modifiesRegister(CondReg,
TRI)) {
200 if (!
A->definesRegister(CondReg,
TRI) ||
201 (
A->getOpcode() !=
And &&
A->getOpcode() != AndN2))
205 ReadsCond |=
A->readsRegister(CondReg,
TRI);
210 MachineOperand &Op1 =
A->getOperand(1);
211 MachineOperand &Op2 =
A->getOperand(2);
213 Op2.
getReg() == ExecReg) {
214 TII->commuteInstruction(*
A);
222 int64_t MaskValue = 0;
226 auto M = std::next(
A);
227 bool ReadsSreg =
false;
228 bool ModifiesExec =
false;
229 for (;
M !=
E; ++
M) {
230 if (
M->definesRegister(SReg,
TRI))
232 if (
M->modifiesRegister(SReg,
TRI))
234 ReadsSreg |=
M->readsRegister(SReg,
TRI);
235 ModifiesExec |=
M->modifiesRegister(ExecReg,
TRI);
244 if (
A->getOpcode() ==
And && SReg == CondReg && !ModifiesExec &&
245 TII->isVOPC(*M) &&
A->allImplicitDefsAreDead()) {
246 A->eraseFromParent();
250 if (!
M->isMoveImmediate() || !
M->getOperand(1).isImm() ||
251 (
M->getOperand(1).getImm() != -1 &&
M->getOperand(1).getImm() != 0))
253 MaskValue =
M->getOperand(1).getImm();
256 if (!ReadsSreg && Op2.
isKill()) {
257 A->getOperand(2).ChangeToImmediate(MaskValue);
258 M->eraseFromParent();
260 }
else if (Op2.
isImm()) {
267 assert(MaskValue == 0 || MaskValue == -1);
268 if (
A->getOpcode() == AndN2)
269 MaskValue = ~MaskValue;
271 if (!ReadsCond &&
A->registerDefIsDead(AMDGPU::SCC,
nullptr)) {
272 if (!
MI.killsRegister(CondReg,
TRI)) {
274 if (MaskValue == 0) {
275 BuildMI(*
A->getParent(), *
A,
A->getDebugLoc(),
TII->get(Mov), CondReg)
278 BuildMI(*
A->getParent(), *
A,
A->getDebugLoc(),
TII->get(Mov), CondReg)
283 A->eraseFromParent();
286 bool IsVCCZ =
MI.getOpcode() == AMDGPU::S_CBRANCH_VCCZ;
287 if (SReg == ExecReg) {
290 MI.eraseFromParent();
293 MI.setDesc(
TII->get(AMDGPU::S_BRANCH));
294 }
else if (IsVCCZ && MaskValue == 0) {
297 MachineBasicBlock *Parent =
MI.getParent();
298 SmallVector<MachineInstr *, 4>
ToRemove;
305 Found =
Term.isIdenticalTo(
MI);
308 assert(Found &&
"conditional branch is not terminator");
310 MachineOperand &Dst = BranchMI->getOperand(0);
311 assert(Dst.isMBB() &&
"destination is not basic block");
312 updateMLIBeforeRemovingEdge(Parent, Dst.getMBB());
314 BranchMI->eraseFromParent();
318 updateMLIBeforeRemovingEdge(Parent, Succ);
323 MI.setDesc(
TII->get(AMDGPU::S_BRANCH));
324 }
else if (!IsVCCZ && MaskValue == 0) {
326 MachineOperand &Dst =
MI.getOperand(0);
327 assert(Dst.isMBB() &&
"destination is not basic block");
328 MachineBasicBlock *Parent =
MI.getParent();
329 updateMLIBeforeRemovingEdge(Parent, Dst.getMBB());
331 MI.eraseFromParent();
333 }
else if (MaskValue == -1) {
336 TII->get(IsVCCZ ? AMDGPU::S_CBRANCH_EXECZ : AMDGPU::S_CBRANCH_EXECNZ));
339 MI.removeOperand(
MI.findRegisterUseOperandIdx(CondReg,
TRI,
false ));
345bool SIPreEmitPeephole::optimizeSetGPR(MachineInstr &
First,
346 MachineInstr &
MI)
const {
347 MachineBasicBlock &
MBB = *
MI.getParent();
349 const MachineRegisterInfo &MRI = MF.
getRegInfo();
350 MachineOperand *Idx =
TII->getNamedOperand(
MI, AMDGPU::OpName::src0);
352 SmallVector<MachineInstr *, 4>
ToRemove;
360 E =
MI.getIterator();
362 if (
I->isBundle() ||
I->isDebugInstr())
364 switch (
I->getOpcode()) {
365 case AMDGPU::S_SET_GPR_IDX_MODE:
367 case AMDGPU::S_SET_GPR_IDX_OFF:
372 if (
I->modifiesRegister(AMDGPU::M0,
TRI))
374 if (IdxReg &&
I->modifiesRegister(IdxReg,
TRI))
376 if (
llvm::any_of(
I->operands(), [&MRI,
this](
const MachineOperand &MO) {
377 return MO.isReg() && TRI->isVectorRegister(MRI, MO.getReg());
381 if (!IdxOn || !(
I->getOpcode() == AMDGPU::V_MOV_B32_indirect_write ||
382 I->getOpcode() == AMDGPU::V_MOV_B32_indirect_read))
388 MI.eraseFromBundle();
390 RI->eraseFromBundle();
394bool SIPreEmitPeephole::getBlockDestinations(
395 MachineBasicBlock &SrcMBB, MachineBasicBlock *&TrueMBB,
396 MachineBasicBlock *&FalseMBB, SmallVectorImpl<MachineOperand> &
Cond) {
407class BranchWeightCostModel {
408 const SIInstrInfo &
TII;
409 const TargetSchedModel &SchedModel;
410 BranchProbability BranchProb;
411 static constexpr uint64_t BranchNotTakenCost = 1;
412 uint64_t BranchTakenCost;
413 uint64_t ThenCyclesCost = 0;
416 BranchWeightCostModel(
const SIInstrInfo &
TII,
const MachineInstr &Branch,
417 const MachineBasicBlock &Succ)
418 :
TII(
TII), SchedModel(
TII.getSchedModel()) {
419 const MachineBasicBlock &Head = *
Branch.getParent();
426 BranchTakenCost = SchedModel.computeInstrLatency(&Branch);
430 if (
TII.isWaitcnt(
MI.getOpcode()))
433 ThenCyclesCost += SchedModel.computeInstrLatency(&
MI);
445 return (Denominator - Numerator) * ThenCyclesCost <=
446 ((Denominator - Numerator) * BranchTakenCost +
447 Numerator * BranchNotTakenCost);
451bool SIPreEmitPeephole::mustRetainExeczBranch(
452 const MachineInstr &Branch,
const MachineBasicBlock &From,
453 const MachineBasicBlock &To)
const {
455 BranchWeightCostModel CostModel{*
TII,
Branch, From};
460 const MachineBasicBlock &
MBB = *
MBBI;
462 for (
const MachineInstr &
MI :
MBB) {
466 if (
MI.isConditionalBranch())
469 if (
MI.isUnconditionalBranch() &&
473 if (
MI.isMetaInstruction())
476 if (
TII->hasUnwantedEffectsWhenEXECEmpty(
MI))
479 if (!CostModel.isProfitable(
MI))
489bool SIPreEmitPeephole::removeExeczBranch(MachineInstr &
MI,
490 MachineBasicBlock &SrcMBB) {
492 if (!
TII->getSchedModel().hasInstrSchedModel())
495 MachineBasicBlock *TrueMBB =
nullptr;
496 MachineBasicBlock *FalseMBB =
nullptr;
499 if (!getBlockDestinations(SrcMBB, TrueMBB, FalseMBB,
Cond))
507 if (mustRetainExeczBranch(
MI, *FalseMBB, *TrueMBB))
511 MI.eraseFromParent();
517bool SIPreEmitPeephole::canUnpackingClobberRegister(
const MachineInstr &
MI) {
527 Register UnpackedDstReg =
TRI->getSubReg(DstReg, AMDGPU::sub0);
529 const MachineOperand *Src0MO =
TII->getNamedOperand(
MI, AMDGPU::OpName::src0);
530 if (Src0MO && Src0MO->
isReg()) {
533 TII->getNamedOperand(
MI, AMDGPU::OpName::src0_modifiers)->getImm();
535 ?
TRI->getSubReg(SrcReg0, AMDGPU::sub1)
536 :
TRI->getSubReg(SrcReg0, AMDGPU::sub0);
539 if (
TRI->regsOverlap(UnpackedDstReg, HiSrc0Reg))
543 const MachineOperand *Src1MO =
TII->getNamedOperand(
MI, AMDGPU::OpName::src1);
544 if (Src1MO && Src1MO->
isReg()) {
547 TII->getNamedOperand(
MI, AMDGPU::OpName::src1_modifiers)->getImm();
549 ?
TRI->getSubReg(SrcReg1, AMDGPU::sub1)
550 :
TRI->getSubReg(SrcReg1, AMDGPU::sub0);
551 if (
TRI->regsOverlap(UnpackedDstReg, HiSrc1Reg))
558 const MachineOperand *Src2MO =
559 TII->getNamedOperand(
MI, AMDGPU::OpName::src2);
560 if (Src2MO && Src2MO->
isReg()) {
563 TII->getNamedOperand(
MI, AMDGPU::OpName::src2_modifiers)->getImm();
565 ?
TRI->getSubReg(SrcReg2, AMDGPU::sub1)
566 :
TRI->getSubReg(SrcReg2, AMDGPU::sub0);
567 if (
TRI->regsOverlap(UnpackedDstReg, HiSrc2Reg))
574uint32_t SIPreEmitPeephole::mapToUnpackedOpcode(MachineInstr &
I) {
575 unsigned Opcode =
I.getOpcode();
580 case AMDGPU::V_PK_ADD_F32:
581 case AMDGPU::V_PK_ADD_F32_gfx1250:
582 return AMDGPU::V_ADD_F32_e64;
583 case AMDGPU::V_PK_MUL_F32:
584 case AMDGPU::V_PK_MUL_F32_gfx1250:
585 return AMDGPU::V_MUL_F32_e64;
586 case AMDGPU::V_PK_FMA_F32:
587 case AMDGPU::V_PK_FMA_F32_gfx1250:
588 return AMDGPU::V_FMA_F32_e64;
590 return std::numeric_limits<uint32_t>::max();
595void SIPreEmitPeephole::addOperandAndMods(MachineInstrBuilder &NewMI,
596 unsigned SrcMods,
bool IsHiBits,
597 const MachineOperand &SrcMO) {
598 unsigned NewSrcMods = 0;
610 if (SrcMods & NegModifier)
621 Register UnpackedSrcReg = (SrcMods & OpSelModifier)
622 ?
TRI->getSubReg(SrcMO.
getReg(), AMDGPU::sub1)
623 :
TRI->getSubReg(SrcMO.
getReg(), AMDGPU::sub0);
625 MachineOperand UnpackedSrcMO =
642 bool KillState =
true;
643 if ((OpSel == OpSelHi) && !IsHiBits)
647 NewMI.
add(UnpackedSrcMO);
650void SIPreEmitPeephole::collectUnpackingCandidates(
651 MachineInstr &BeginMI, SetVector<MachineInstr *> &InstrsToUnpack,
652 uint16_t NumMFMACycles) {
655 int TotalCyclesBetweenCandidates = 0;
656 auto SchedModel =
TII->getSchedModel();
661 uint32_t UnpackedOpCode = mapToUnpackedOpcode(Instr);
663 !(UnpackedOpCode == std::numeric_limits<uint32_t>::max());
664 if (
Instr.isMetaInstruction())
666 if ((
Instr.isTerminator()) ||
667 (
TII->isNeverCoissue(Instr) && !IsUnpackable) ||
669 Instr.modifiesRegister(AMDGPU::EXEC,
TRI)))
672 const MCSchedClassDesc *InstrSchedClassDesc =
676 TotalCyclesBetweenCandidates +=
Latency;
678 if (TotalCyclesBetweenCandidates >= NumMFMACycles - 1)
685 for (
const MachineOperand &InstrMO :
Instr.operands()) {
686 if (!InstrMO.isReg() || !InstrMO.getReg().isValid())
688 if (
TRI->regsOverlap(MFMADef, InstrMO.getReg()))
694 if (canUnpackingClobberRegister(Instr))
699 TotalCyclesBetweenCandidates -=
Latency;
701 TotalCyclesBetweenCandidates += 2;
703 if (TotalCyclesBetweenCandidates < NumMFMACycles - 1)
704 InstrsToUnpack.
insert(&Instr);
708void SIPreEmitPeephole::performF32Unpacking(MachineInstr &
I) {
709 const MachineOperand &DstOp =
I.getOperand(0);
711 uint32_t UnpackedOpcode = mapToUnpackedOpcode(
I);
712 assert(UnpackedOpcode != std::numeric_limits<uint32_t>::max() &&
713 "Unsupported Opcode");
715 MachineInstrBuilder Op0LOp1L =
716 createUnpackedMI(
I, UnpackedOpcode,
false);
717 MachineOperand LoDstOp = Op0LOp1L->
getOperand(0);
721 MachineInstrBuilder Op0HOp1H =
722 createUnpackedMI(
I, UnpackedOpcode,
true);
723 MachineOperand HiDstOp = Op0HOp1H->
getOperand(0);
725 uint32_t
IFlags =
I.getFlags();
734MachineInstrBuilder SIPreEmitPeephole::createUnpackedMI(MachineInstr &
I,
735 uint32_t UnpackedOpcode,
739 const MachineOperand *SrcMO0 =
TII->getNamedOperand(
I, AMDGPU::OpName::src0);
740 const MachineOperand *SrcMO1 =
TII->getNamedOperand(
I, AMDGPU::OpName::src1);
741 Register DstReg =
I.getOperand(0).getReg();
742 unsigned OpCode =
I.getOpcode();
743 Register UnpackedDstReg = IsHiBits ?
TRI->getSubReg(DstReg, AMDGPU::sub1)
744 :
TRI->getSubReg(DstReg, AMDGPU::sub0);
746 int64_t ClampVal =
TII->getNamedOperand(
I, AMDGPU::OpName::clamp)->getImm();
748 TII->getNamedOperand(
I, AMDGPU::OpName::src0_modifiers)->getImm();
750 TII->getNamedOperand(
I, AMDGPU::OpName::src1_modifiers)->getImm();
753 NewMI.
addDef(UnpackedDstReg);
754 addOperandAndMods(NewMI, Src0Mods, IsHiBits, *SrcMO0);
755 addOperandAndMods(NewMI, Src1Mods, IsHiBits, *SrcMO1);
758 const MachineOperand *SrcMO2 =
759 TII->getNamedOperand(
I, AMDGPU::OpName::src2);
761 TII->getNamedOperand(
I, AMDGPU::OpName::src2_modifiers)->getImm();
762 addOperandAndMods(NewMI, Src2Mods, IsHiBits, *SrcMO2);
775 SIPreEmitPeephole Impl;
777 if (Impl.run(MF, MLI)) {
788 TII = ST.getInstrInfo();
789 TRI = &
TII->getRegisterInfo();
798 if (TermI !=
MBB.end()) {
800 switch (
MI.getOpcode()) {
801 case AMDGPU::S_CBRANCH_VCCZ:
802 case AMDGPU::S_CBRANCH_VCCNZ:
805 case AMDGPU::S_CBRANCH_EXECZ:
811 if (!
ST.hasVGPRIndexMode())
814 MachineInstr *SetGPRMI =
nullptr;
815 const unsigned Threshold = 20;
823 if (
Count == Threshold)
828 if (
MI.getOpcode() != AMDGPU::S_SET_GPR_IDX_ON)
837 if (optimizeSetGPR(*SetGPRMI,
MI))
848 if (!
ST.hasGFX940Insts())
850 for (MachineBasicBlock &
MBB : MF) {
853 auto SchedModel =
TII->getSchedModel();
854 SetVector<MachineInstr *> InstrsToUnpack;
858 const MCSchedClassDesc *SchedClassDesc =
860 uint16_t NumMFMACycles =
862 collectUnpackingCandidates(
MI, InstrsToUnpack, NumMFMACycles);
864 for (MachineInstr *
MI : InstrsToUnpack) {
865 performF32Unpacking(*
MI);
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides AMDGPU specific target descriptions.
ReachingDefInfo InstSet & ToRemove
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
AMD GCN specific subclass of TargetSubtarget.
const HexagonInstrInfo * TII
Register const TargetRegisterInfo * TRI
Promote Memory to Register
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
const SmallVectorImpl< MachineOperand > & Cond
This file implements a set that has insertion order iteration characteristics.
static bool isProfitable(const StableFunctionMap::StableFunctionEntries &SFS)
PassT::Result * getCachedResult(IRUnitT &IR) const
Get the cached result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addUsedIfAvailable()
Add the specified Pass class to the set of analyses used by this pass.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static uint32_t getDenominator()
static constexpr BranchProbability getZero()
uint32_t getNumerator() const
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
Analyze the branching code at the end of MBB, returning true if it cannot be understood (e....
bool contains(const LoopT *L) const
Return true if the specified loop is contained within this loop.
bool isInnermost() const
Return true if the loop does not contain any (natural) loops.
BlockT * getHeader() const
iterator_range< block_iterator > blocks() const
LoopT * getParentLoop() const
Return the parent loop if it exists or nullptr for top level loops.
LoopT * removeChildLoop(iterator I)
This removes the specified child from being a subloop of this loop.
Represents a single loop in the control flow graph.
LLVM_ABI MachineBasicBlock * getFallThrough(bool JumpToFallThrough=true)
Return the fallthrough block if the block can implicitly transfer control to the block after it by fa...
LLVM_ABI BranchProbability getSuccProbability(const_succ_iterator Succ) const
Return probability of the edge from this block to MBB.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
LLVM_ABI void removeSuccessor(MachineBasicBlock *Succ, bool NormalizeSuccProbs=false)
Remove successor from the successors list of this MachineBasicBlock.
Instructions::iterator instr_iterator
MachineInstrBundleIterator< MachineInstr, true > reverse_iterator
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
iterator_range< iterator > terminators()
iterator_range< succ_iterator > successors()
iterator_range< pred_iterator > predecessors()
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
void RenumberBlocks(MachineBasicBlock *MBBFrom=nullptr)
RenumberBlocks - This discards all of the MachineBasicBlock numbers and recomputes them.
BasicBlockListType::const_iterator const_iterator
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & add(const MachineOperand &MO) const
const MachineInstrBuilder & addDef(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a virtual register definition operand.
Representation of each machine instruction.
const MachineBasicBlock * getParent() const
void setFlags(unsigned flags)
const MachineOperand & getOperand(unsigned i) const
Analysis pass that exposes the MachineLoopInfo for a machine function.
MachineOperand class - Representation of each machine instruction operand.
LLVM_ABI void setIsRenamable(bool Val=true)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
void setIsKill(bool Val=true)
LLVM_ABI bool isRenamable() const
isRenamable - Returns true if this register may be renamed, i.e.
void setIsUndef(bool Val=true)
Register getReg() const
getReg - Returns the register number.
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)
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
static bool isMFMA(const MachineInstr &MI)
static bool modifiesModeRegister(const MachineInstr &MI)
Return true if the instruction modifies the mode register.q.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
A vector that has set insertion semantics.
bool insert(const value_type &X)
Insert a new element into the SetVector.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
LLVM_ABI const MCSchedClassDesc * resolveSchedClass(const MachineInstr *MI) const
Return the MCSchedClassDesc for this instruction.
ProcResIter getWriteProcResBegin(const MCSchedClassDesc *SC) const
self_iterator getIterator()
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_READONLY bool hasNamedOperand(uint64_t Opcode, OpName NamedIdx)
NodeAddr< InstrNode * > Instr
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.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
char & SIPreEmitPeepholeID
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
@ And
Bitwise or logical AND of integers.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
uint16_t ReleaseAtCycle
Cycle at which the resource will be released by an instruction, relatively to the cycle in which the ...