91#define DEBUG_TYPE "shrink-wrap"
94STATISTIC(NumCandidates,
"Number of shrink-wrapping candidates");
96 "Number of shrink-wrapping candidates dropped because of frequency");
107class ShrinkWrapImpl {
138 unsigned FrameSetupOpcode = ~0u;
141 unsigned FrameDestroyOpcode = ~0u;
152 mutable SetOfRegs CurrentCSRs;
168 bool StackAddressUsed)
const;
170 const SetOfRegs &getCurrentCSRs(
RegScavenger *RS)
const {
171 if (CurrentCSRs.empty()) {
180 CurrentCSRs.insert((
unsigned)
Reg);
190 void updateSaveRestorePoints(MachineBasicBlock &
MBB, RegScavenger *RS);
194 bool performShrinkWrapping(
195 const ReversePostOrderTraversal<MachineBasicBlock *> &RPOT,
211 bool checkIfRestoreSplittable(
212 const MachineBasicBlock *CurRestore,
213 const DenseSet<const MachineBasicBlock *> &ReachableByDirty,
214 SmallVectorImpl<MachineBasicBlock *> &DirtyPreds,
215 SmallVectorImpl<MachineBasicBlock *> &CleanPreds,
216 const TargetInstrInfo *
TII, RegScavenger *RS);
222 EntryFreq = MBFI->getEntryFreq();
225 FrameSetupOpcode =
TII.getCallFrameSetupOpcode();
226 FrameDestroyOpcode =
TII.getCallFrameDestroyOpcode();
237 bool ArePointsInteresting()
const {
return Save != Entry && Save && Restore; }
240 ShrinkWrapImpl(
const RegisterClassInfo *RCI, MachineDominatorTree *MDT,
241 MachinePostDominatorTree *MPDT,
242 MachineBlockFrequencyInfo *MBFI, MachineLoopInfo *MLI,
243 MachineOptimizationRemarkEmitter *ORE)
244 : RCI(RCI), MDT(MDT), MPDT(MPDT), MBFI(MBFI), MLI(MLI), ORE(ORE) {}
256 ShrinkWrapLegacy() : MachineFunctionPass(ID) {}
258 void getAnalysisUsage(AnalysisUsage &AU)
const override {
260 AU.
addRequired<MachineBlockFrequencyInfoWrapperPass>();
262 AU.
addRequired<MachinePostDominatorTreeWrapperPass>();
264 AU.
addRequired<MachineOptimizationRemarkEmitterPass>();
265 AU.
addRequired<MachineRegisterClassInfoWrapperPass>();
269 MachineFunctionProperties getRequiredProperties()
const override {
270 return MachineFunctionProperties().setNoVRegs();
273 StringRef getPassName()
const override {
return "Shrink Wrapping analysis"; }
282char ShrinkWrapLegacy::ID = 0;
298 bool StackAddressUsed)
const {
306 if (
Op->getValue()) {
311 return !Arg->hasPassPointeeByValueCopyAttr();
316 return PSV->isJumpTable() || PSV->isConstantPool();
321 if (StackAddressUsed &&
MI.mayLoadOrStore() &&
322 (
MI.isCall() ||
MI.hasUnmodeledSideEffects() ||
MI.memoperands_empty() ||
323 !
all_of(
MI.memoperands(), IsKnownNonStackPtr)))
326 if (
MI.getOpcode() == FrameSetupOpcode ||
327 MI.getOpcode() == FrameDestroyOpcode) {
328 LLVM_DEBUG(dbgs() <<
"Frame instruction: " << MI <<
'\n');
334 bool UseOrDefCSR = false;
337 if (!MO.isDef() && !MO.readsReg())
339 Register PhysReg = MO.getReg();
342 assert(PhysReg.isPhysical() &&
"Unallocated register?!");
355 UseOrDefCSR = (!MI.isCall() && PhysReg == SP) ||
356 RCI->getLastCalleeSavedAlias(PhysReg) ||
358 TRI->isNonallocatableRegisterCalleeSave(PhysReg)) ||
359 TRI->isVirtualFrameRegister(PhysReg);
360 }
else if (MO.isRegMask()) {
362 for (unsigned Reg : getCurrentCSRs(RS)) {
363 if (MO.clobbersPhysReg(Reg)) {
370 if (UseOrDefCSR || (MO.isFI() && !
MI.isDebugValue())) {
371 LLVM_DEBUG(dbgs() <<
"Use or define CSR(" << UseOrDefCSR <<
") or FI("
372 << MO.isFI() <<
"): " << MI <<
'\n');
380template <
typename ListOfBBs,
typename DominanceAnalysis>
382 DominanceAnalysis &Dom,
bool Strict =
true) {
383 if (BBs.begin() == BBs.end())
396 return !
TII.analyzeBranch(Entry,
TBB, FBB,
Cond);
407 if (ReachableByDirty.
count(PredBB))
417 while (!Worklist.
empty()) {
419 if (!Visited.
insert(SuccMBB).second)
444 while (!Worklist.
empty()) {
446 if (CleanBB == SavePoint)
472 TII->insertUnconditionalBranch(*BBToUpdate, NMBB,
DL);
497 if (BB->getFallThrough(
false) ==
MBB)
498 MBBFallthrough.
insert(BB);
513 SuccBB->ReplaceUsesOfBlockWith(
MBB, NMBB);
538 if (BB->getFallThrough(
false) == NMBB)
539 NMBBFallthrough.
insert(BB);
543 SuccBB->ReplaceUsesOfBlockWith(NMBB,
MBB);
555bool ShrinkWrapImpl::checkIfRestoreSplittable(
561 for (
const MachineInstr &
MI : *CurRestore)
562 if (useOrDefCSROrFI(
MI, RS,
true))
565 for (MachineBasicBlock *PredBB : CurRestore->predecessors()) {
569 if (ReachableByDirty.
count(PredBB))
575 return !(CleanPreds.
empty() || DirtyPreds.
empty());
578bool ShrinkWrapImpl::postShrinkWrapping(
bool HasCandidate,
MachineFunction &MF,
583 MachineBasicBlock *InitSave =
nullptr;
584 MachineBasicBlock *InitRestore =
nullptr;
588 InitRestore = Restore;
590 InitRestore =
nullptr;
591 InitSave = &MF.
front();
592 for (MachineBasicBlock &
MBB : MF) {
604 if (!InitSave || !InitRestore || InitRestore == InitSave ||
605 !MDT->
dominates(InitSave, InitRestore) ||
611 for (MachineBasicBlock &
MBB : MF)
615 DenseSet<const MachineBasicBlock *> DirtyBBs;
616 for (MachineBasicBlock &
MBB : MF) {
623 for (
const MachineInstr &
MI :
MBB)
624 if (useOrDefCSROrFI(
MI, RS,
true)) {
631 DenseSet<const MachineBasicBlock *> ReachableByDirty;
634 const TargetInstrInfo *
TII = MF.getSubtarget().getInstrInfo();
637 if (!checkIfRestoreSplittable(InitRestore, ReachableByDirty, DirtyPreds,
638 CleanPreds,
TII, RS))
642 MachineBasicBlock *NewSave =
645 while (NewSave && (
hasDirtyPred(ReachableByDirty, *NewSave) ||
646 EntryFreq < MBFI->getBlockFreq(NewSave) ||
654 if (ReachablePreds.
empty())
661 const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering();
662 if (!NewSave || NewSave == InitSave ||
669 MachineBasicBlock *NewRestore =
680 Restore = NewRestore;
686 "Incorrect save or restore point due to dominance relations");
688 "Unexpected save or restore point in a loop");
691 "Incorrect save or restore point based on block frequency");
695void ShrinkWrapImpl::updateSaveRestorePoints(MachineBasicBlock &
MBB,
717 if (Restore == &
MBB) {
719 if (!useOrDefCSROrFI(Terminator, RS,
true))
735 dbgs() <<
"Restore point needs to be spanned on several blocks\n");
746 bool SaveDominatesRestore =
false;
747 bool RestorePostDominatesSave =
false;
749 (!(SaveDominatesRestore = MDT->
dominates(Save, Restore)) ||
750 !(RestorePostDominatesSave = MPDT->
dominates(Restore, Save)) ||
770 if (!SaveDominatesRestore) {
775 if (!RestorePostDominatesSave)
793 SmallVector<MachineBasicBlock*, 4> ExitBlocks;
797 MachineBasicBlock *IPdom = Restore;
798 for (MachineBasicBlock *LoopExitBB: ExitBlocks) {
799 IPdom =
FindIDom<>(*IPdom, LoopExitBB->successors(), *MPDT);
830bool ShrinkWrapImpl::performShrinkWrapping(
831 const ReversePostOrderTraversal<MachineBasicBlock *> &RPOT,
833 for (MachineBasicBlock *
MBB : RPOT) {
838 "EH Funclets are not supported yet.",
847 updateSaveRestorePoints(*
MBB, RS);
848 if (!ArePointsInteresting()) {
849 LLVM_DEBUG(
dbgs() <<
"EHPad/inlineasm_br prevents shrink-wrapping\n");
855 bool StackAddressUsed =
false;
862 if (StackAddressUsedBlockInfo.
test(
Pred->getNumber())) {
863 StackAddressUsed =
true;
868 for (
const MachineInstr &
MI : *
MBB) {
869 if (useOrDefCSROrFI(
MI, RS, StackAddressUsed)) {
872 updateSaveRestorePoints(*
MBB, RS);
875 if (!ArePointsInteresting()) {
881 StackAddressUsed =
true;
885 StackAddressUsedBlockInfo[
MBB->
getNumber()] = StackAddressUsed;
887 if (!ArePointsInteresting()) {
891 assert(!Save && !Restore &&
"We miss a shrink-wrap opportunity?!");
899 const TargetFrameLowering *TFI =
902 LLVM_DEBUG(
dbgs() <<
"Shrink wrap candidates (#, Name, Freq):\nSave: "
908 bool IsSaveCheap, TargetCanUseSaveAsPrologue =
false;
909 if (((IsSaveCheap = EntryFreq >= MBFI->
getBlockFreq(Save)) &&
915 dbgs() <<
"New points are too expensive or invalid for the target\n");
916 MachineBasicBlock *NewBB;
917 if (!IsSaveCheap || !TargetCanUseSaveAsPrologue) {
929 updateSaveRestorePoints(*NewBB, RS);
930 }
while (Save && Restore);
932 if (!ArePointsInteresting()) {
933 ++NumCandidatesDropped;
944 ReversePostOrderTraversal<MachineBasicBlock *> RPOT(&*MF.
begin());
953 "Irreducible CFGs are not supported yet.",
958 std::unique_ptr<RegScavenger>
RS(
959 TRI->requiresRegisterScavenging(MF) ?
new RegScavenger() :
nullptr);
967 bool HasCandidate = performShrinkWrapping(RPOT,
RS.get());
968 StackAddressUsedBlockInfo.
clear();
969 Changed = postShrinkWrapping(HasCandidate, MF,
RS.get());
972 if (!ArePointsInteresting())
994 !ShrinkWrapImpl::isShrinkWrapEnabled(MF))
997 const RegisterClassInfo *RCI =
998 &getAnalysis<MachineRegisterClassInfoWrapperPass>().getRCI();
999 MachineDominatorTree *MDT =
1000 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
1001 MachinePostDominatorTree *MPDT =
1002 &getAnalysis<MachinePostDominatorTreeWrapperPass>().getPostDomTree();
1003 MachineBlockFrequencyInfo *MBFI =
1004 &getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI();
1005 MachineLoopInfo *MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
1006 MachineOptimizationRemarkEmitter *ORE =
1007 &getAnalysis<MachineOptimizationRemarkEmitterPass>().getORE();
1009 return ShrinkWrapImpl(RCI, MDT, MPDT, MBFI, MLI, ORE).run(MF);
1015 if (MF.
empty() || !ShrinkWrapImpl::isShrinkWrapEnabled(MF))
1029 ShrinkWrapImpl(&RCI, &MDT, &MPDT, &MBFI, &MLI, &ORE).
run(MF);
1046 !(MF.
getFunction().hasFnAttribute(Attribute::SanitizeAddress) ||
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
const AArch64Subtarget & Subtarget
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the simple types necessary to represent the attributes associated with functions a...
This file implements the BitVector class.
const HexagonInstrInfo * TII
Register const TargetRegisterInfo * TRI
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
This file builds on the ADT/GraphTraits.h file to build a generic graph post order iterator.
SmallVector< MachineOperand, 4 > Cond
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
This file declares the machine register scavenger class.
This file implements a set that has insertion order iteration characteristics.
static void markAllReachable(DenseSet< const MachineBasicBlock * > &Visited, const MachineBasicBlock &MBB)
Derives the list of all the basic blocks reachable from MBB.
static void updateTerminator(MachineBasicBlock *BBToUpdate, MachineBasicBlock *NMBB, const TargetInstrInfo *TII)
This function updates the branches post restore point split.
static MachineBasicBlock * tryToSplitRestore(MachineBasicBlock *MBB, ArrayRef< MachineBasicBlock * > DirtyPreds, const TargetInstrInfo *TII)
This function splits the restore point and returns new restore point/BB.
static bool hasDirtyPred(const DenseSet< const MachineBasicBlock * > &ReachableByDirty, const MachineBasicBlock &MBB)
Determines if any predecessor of MBB is on the path from block that has use or def of CSRs/FI to MBB.
static bool giveUpWithRemarks(MachineOptimizationRemarkEmitter *ORE, StringRef RemarkName, StringRef RemarkMessage, const DiagnosticLocation &Loc, const MachineBasicBlock *MBB)
static void rollbackRestoreSplit(MachineFunction &MF, MachineBasicBlock *NMBB, MachineBasicBlock *MBB, ArrayRef< MachineBasicBlock * > DirtyPreds, const TargetInstrInfo *TII)
This function undoes the restore point split done earlier.
static bool isAnalyzableBB(const TargetInstrInfo &TII, MachineBasicBlock &Entry)
static bool isSaveReachableThroughClean(const MachineBasicBlock *SavePoint, ArrayRef< MachineBasicBlock * > CleanPreds)
static void collectBlocksReachableByDirty(const DenseSet< const MachineBasicBlock * > &DirtyBBs, DenseSet< const MachineBasicBlock * > &ReachableByDirty)
Collect blocks reachable by use or def of CSRs/FI.
static MachineBasicBlock * FindIDom(MachineBasicBlock &Block, ListOfBBs BBs, DominanceAnalysis &Dom, bool Strict=true)
Helper function to find the immediate (post) dominator.
This file defines the SmallVector class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
This file describes how to lower LLVM code to machine code.
const AArch64InstrInfo * getInstrInfo() const override
const AArch64TargetLowering * getTargetLowering() const override
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool test(unsigned Idx) const
Returns true if bit Idx is set.
int find_first() const
Returns the index of the first set bit, -1 if none of the bits are set.
void resize(unsigned N, bool t=false)
Grow or shrink the bitvector.
void clear()
Removes all bits from the bitvector.
int find_next(unsigned Prev) const
Returns the index of the next set bit following the "Prev" bit.
uint64_t getFrequency() const
Returns the frequency as a fixpoint number scaled by the entry frequency.
Implements a dense probed hash-table based set.
NodeT * findNearestCommonDominator(NodeT *A, NodeT *B) const
Find nearest common dominator basic block for basic block A and B.
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
bool isReachableFromEntry(const NodeT *A) const
isReachableFromEntry - Return true if A is dominated by the entry block of the function containing it...
DomTreeNodeBase< NodeT > * getNode(const NodeT *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
DISubprogram * getSubprogram() const
Get the attached subprogram.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
void getExitingBlocks(SmallVectorImpl< BlockT * > &ExitingBlocks) const
Return all blocks inside the loop that have successors outside of the loop.
unsigned getLoopDepth(const BlockT *BB) const
Return the loop nesting level of the specified block.
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
An RAII based helper class to modify MachineFunctionProperties when running pass.
bool isInlineAsmBrIndirectTarget() const
Returns true if this is the indirect dest of an INLINEASM_BR.
unsigned pred_size() const
bool isEHPad() const
Returns true if the block is a landing pad.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
succ_iterator succ_begin()
bool isEHFuncletEntry() const
Returns true if this is the entry block of an EH funclet.
bool isReturnBlock() const
Convenience function that returns true if the block ends in a return instruction.
LLVM_ABI void addSuccessor(MachineBasicBlock *Succ, BranchProbability Prob=BranchProbability::getUnknown())
Add Succ as a successor of this MachineBasicBlock.
LLVM_ABI void removeSuccessor(MachineBasicBlock *Succ, bool NormalizeSuccProbs=false)
Remove successor from the successors list of this MachineBasicBlock.
pred_iterator pred_begin()
LLVM_ABI bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB will be emitted immediately after this block, such that if this bloc...
LLVM_ABI void eraseFromParent()
This method unlinks 'this' from the containing function and deletes it.
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
LLVM_ABI instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
iterator_range< iterator > terminators()
LLVM_ABI DebugLoc findBranchDebugLoc()
Find and return the merged DebugLoc of the branch instructions of the block.
iterator_range< succ_iterator > successors()
iterator_range< pred_iterator > predecessors()
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
LLVM_ABI BlockFrequency getBlockFreq(const MachineBasicBlock *MBB) const
getblockFreq - Return block frequency.
Analysis pass which computes a MachineDominatorTree.
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
bool dominates(const MachineInstr *A, const MachineInstr *B) const
void setSavePoints(SaveRestorePoints NewSavePoints)
void setRestorePoints(SaveRestorePoints NewRestorePoints)
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.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Function & getFunction()
Return the LLVM function that this machine code represents.
bool usesWindowsUnwindInfo() const
True if this function describes its unwind information with Windows SEH unwind opcodes (....
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
const MachineBasicBlock & front() const
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *BB=nullptr, std::optional< UniqueBBID > BBID=std::nullopt)
CreateMachineInstr - Allocate a new MachineInstr.
void insert(iterator MBBI, MachineBasicBlock *MBB)
Representation of each machine instruction.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Analysis pass that exposes the MachineLoopInfo for a machine function.
A description of a memory reference used in the backend.
MachineOperand class - Representation of each machine instruction operand.
MachinePostDominatorTree - an analysis pass wrapper for DominatorTree used to compute the post-domina...
LLVM_ABI MachineBasicBlock * findNearestCommonDominator(ArrayRef< MachineBasicBlock * > Blocks) const
Returns the nearest common dominator of the given blocks.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Special value supplied for machine level alias analysis.
Wrapper class representing virtual and physical registers.
LLVM_ABI PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
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.
A SetVector that performs no allocations if smaller than a certain size.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
LLVM_NO_SANITIZE_CFI_UNRELATED_CAST iterator begin()
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.
Information about stack frame layout on the target.
virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
virtual bool enableShrinkWrapping(const MachineFunction &MF) const
Returns true if the target will correctly handle shrink wrapping.
virtual bool canUseAsEpilogue(const MachineBasicBlock &MBB) const
Check whether or not the given MBB can be used as a epilogue for the target.
virtual bool canUseAsPrologue(const MachineBasicBlock &MBB) const
Check whether or not the given MBB can be used as a prologue for the target.
TargetInstrInfo - Interface to description of machine instruction set.
Register getStackPointerRegisterToSaveRestore() const
If a physical register, this specifies the register that llvm.savestack/llvm.restorestack should save...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetFrameLowering * getFrameLowering() const
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
LLVM Value Representation.
std::pair< iterator, bool > insert(const ValueT &V)
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
initializer< Ty > init(const Ty &Val)
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI char & ShrinkWrapID
ShrinkWrap pass. Look for the best place to insert save and restore.
bool containsIrreducibleCFG(RPOTraversalT &RPOTraversal, const LoopInfoT &LI)
Return true if the control flow in RPOTraversal is irreducible.
DenseMap< MachineBasicBlock *, std::vector< CalleeSavedInfo > > SaveRestorePoints
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...
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...
iterator_range(Container &&) -> iterator_range< llvm::detail::IterOfRange< Container > >
DWARFExpression::Operation Op
LLVM_ABI Printable printBlockFreq(const BlockFrequencyInfo &BFI, BlockFrequency Freq)
Print the block frequency Freq relative to the current functions entry frequency.
LLVM_ABI void getUnderlyingObjects(const Value *V, SmallVectorImpl< const Value * > &Objects, const LoopInfo *LI=nullptr, unsigned MaxLookup=MaxLookupSearchDepth)
This method is similar to getUnderlyingObject except that it can look through phi and select instruct...
LLVM_ABI Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
const CodeGenOptions & getCodeGenOptions(const LLVMContext &C)
Pair of physical register and lane mask.