Go to the documentation of this file.
27 #include "llvm/Config/llvm-config.h"
50 #ifdef EXPENSIVE_CHECKS
70 return all_of(
I->operands(), [
this](
Value *V) { return isLoopInvariant(V); });
88 if (
I->mayReadFromMemory())
102 for (
Value *Operand :
I->operands())
107 I->moveBefore(InsertPt);
117 I->dropUnknownNonDebugMetadata();
145 assert(Incoming && Backedge &&
"expected non-null incoming and backedges");
152 BasicBlock *Incoming =
nullptr, *Backedge =
nullptr;
165 if (
ConstantInt *CI = dyn_cast<ConstantInt>(Inc->getOperand(1)))
175 if (
BranchInst *BI = dyn_cast_or_null<BranchInst>(Latch->getTerminator()))
176 if (BI->isConditional())
177 return dyn_cast<ICmpInst>(BI->getCondition());
191 if (Op0 == &IndVar || Op0 == &StepInst)
194 if (Op1 == &IndVar || Op1 == &StepInst)
209 if (!InitialIVValue || !StepInst)
215 Value *StepValue =
nullptr;
216 if (SE.
getSCEV(StepInstOp1) == Step)
217 StepValue = StepInstOp1;
218 else if (SE.
getSCEV(StepInstOp0) == Step)
219 StepValue = StepInstOp0;
225 return LoopBounds(L, *InitialIVValue, *StepInst, StepValue, *FinalIVValue,
233 assert(Latch &&
"Expecting valid latch");
240 "Expecting the latch compare instruction to be a CmpInst");
248 if (LatchCmpInst->
getOperand(0) == &getFinalIVValue())
253 if (LatchCmpInst->
getOperand(0) == &getStepInst() ||
254 LatchCmpInst->
getOperand(1) == &getStepInst())
262 if (
D == Direction::Increasing)
265 if (
D == Direction::Decreasing)
275 dyn_cast<SCEVAddRecExpr>(SE.getSCEV(&getStepInst())))
276 if (
const SCEV *StepRecur = StepAddRecExpr->getStepRecurrence(SE)) {
277 if (SE.isKnownPositive(StepRecur))
278 return Direction::Increasing;
279 if (SE.isKnownNegative(StepRecur))
280 return Direction::Decreasing;
298 assert(Header &&
"Expected a valid loop header");
317 if (StepInst == LatchCmpOp0 || StepInst == LatchCmpOp1)
324 if (&IndVar == LatchCmpOp0 || &IndVar == LatchCmpOp1)
371 "Expecting a loop with valid preheader and latch");
384 if (!ExitFromLatchSucc)
400 return (GuardOtherSucc == ExitFromLatchSucc) ? GuardBI :
nullptr;
416 if (!Step || !Step->
isOne())
429 if (
I.getType()->isTokenTy())
432 for (
const Use &U :
I.uses()) {
433 const Instruction *UI = cast<Instruction>(U.getUser());
439 if (
const PHINode *
P = dyn_cast<PHINode>(UI))
440 UserBB =
P->getIncomingBlock(U);
484 if (isa<IndirectBrInst>(
BB->getTerminator()) ||
485 isa<CallBrInst>(
BB->getTerminator()))
489 if (
auto *CB = dyn_cast<CallBase>(&
I))
490 if (CB->cannotDuplicate())
511 else if (MD != LoopID)
522 "Loop ID needs at least one operand");
524 "Loop ID should refer to itself");
529 BB->getTerminator()->setMetadata(LLVMContext::MD_loop, LoopID);
539 Context, LoopID, {
"llvm.loop.unroll."}, {DisableUnrollMD});
562 if (!DesiredLoopIdMetadata)
565 MDNode *ParallelAccesses =
568 ParallelAccessGroups;
569 if (ParallelAccesses) {
571 MDNode *AccGroup = cast<MDNode>(MD.get());
573 "List item must be an access group");
574 ParallelAccessGroups.
insert(AccGroup);
585 if (!
I.mayReadOrWriteMemory())
588 if (
MDNode *AccessGroup =
I.getMetadata(LLVMContext::MD_access_group)) {
589 auto ContainsAccessGroup = [&ParallelAccessGroups](
MDNode *AG) ->
bool {
590 if (AG->getNumOperands() == 0) {
592 return ParallelAccessGroups.
count(AG);
595 for (
const MDOperand &AccessListItem : AG->operands()) {
596 MDNode *AccGroup = cast<MDNode>(AccessListItem.get());
598 "List item must be an access group");
599 if (ParallelAccessGroups.
count(AccGroup))
605 if (ContainsAccessGroup(AccessGroup))
614 I.getMetadata(LLVMContext::MD_mem_parallel_loop_access);
635 for (
unsigned i = 1, ie = LoopID->getNumOperands();
i < ie; ++
i) {
636 if (
DILocation *L = dyn_cast<DILocation>(LoopID->getOperand(
i))) {
650 if (
DebugLoc DL = PHeadBB->getTerminator()->getDebugLoc())
656 return LocRange(HeadBB->getTerminator()->getDebugLoc());
661 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
676 class UnloopUpdater {
694 : Unloop(*UL), LI(LInfo),
DFS(UL), FoundIB(
false) {}
696 void updateBlockParents();
698 void removeBlocksFromAncestors();
700 void updateSubloopParents();
709 void UnloopUpdater::updateBlockParents() {
710 if (Unloop.getNumBlocks()) {
716 Loop *L = LI->getLoopFor(POI);
717 Loop *
NL = getNearestLoop(POI, L);
721 assert((
NL != &Unloop && (!
NL ||
NL->contains(&Unloop))) &&
722 "uninitialized successor");
723 LI->changeLoopFor(POI,
NL);
727 assert((FoundIB || Unloop.contains(L)) &&
"uninitialized successor");
733 bool Changed = FoundIB;
734 for (
unsigned NIters = 0; Changed; ++NIters) {
735 assert(NIters < Unloop.getNumBlocks() &&
"runaway iterative algorithm");
741 POE =
DFS.endPostorder();
744 Loop *L = LI->getLoopFor(*POI);
745 Loop *
NL = getNearestLoop(*POI, L);
747 assert(
NL != &Unloop && (!
NL ||
NL->contains(&Unloop)) &&
748 "uninitialized successor");
749 LI->changeLoopFor(*POI,
NL);
757 void UnloopUpdater::removeBlocksFromAncestors() {
761 Loop *OuterParent = LI->getLoopFor(
BB);
762 if (Unloop.contains(OuterParent)) {
765 OuterParent = SubloopParents[OuterParent];
771 assert(OldParent &&
"new loop is not an ancestor of the original");
772 OldParent->removeBlockFromLoop(
BB);
778 void UnloopUpdater::updateSubloopParents() {
779 while (!Unloop.isInnermost()) {
780 Loop *Subloop = *std::prev(Unloop.end());
781 Unloop.removeChildLoop(std::prev(Unloop.end()));
783 assert(SubloopParents.count(Subloop) &&
"DFS failed to visit subloop");
784 if (
Loop *Parent = SubloopParents[Subloop])
785 Parent->addChildLoop(Subloop);
787 LI->addTopLevelLoop(Subloop);
800 Loop *NearLoop = BBLoop;
802 Loop *Subloop =
nullptr;
803 if (NearLoop != &Unloop && Unloop.contains(NearLoop)) {
808 assert(Subloop &&
"subloop is not an ancestor of the original loop");
811 NearLoop = SubloopParents.insert({Subloop, &Unloop}).first->second;
816 assert(!Subloop &&
"subloop blocks must have a successor");
819 for (;
I !=
E; ++
I) {
823 Loop *L = LI->getLoopFor(*
I);
827 assert((FoundIB || !
DFS.hasPostorder(*
I)) &&
"should have seen IB");
830 if (L != &Unloop && Unloop.contains(L)) {
839 L = SubloopParents[L];
850 if (NearLoop == &Unloop || !NearLoop || NearLoop->
contains(L))
854 SubloopParents[Subloop] = NearLoop;
881 if (getLoopFor(
BB) != Unloop)
886 changeLoopFor(
BB,
nullptr);
907 UnloopUpdater Updater(Unloop,
this);
908 Updater.updateBlockParents();
911 Updater.removeBlocksFromAncestors();
914 Updater.updateSubloopParents();
919 assert(
I != ParentLoop->
end() &&
"Couldn't find loop");
951 OS << Banner <<
" (loop: ";
964 OS <<
"\n; Preheader:";
965 PreHeader->print(OS);
969 for (
auto *Block : L.
blocks())
973 OS <<
"Printing <null> block";
977 if (!ExitBlocks.empty()) {
978 OS <<
"\n; Exit blocks";
979 for (
auto *Block : ExitBlocks)
983 OS <<
"Printing <null> block";
1005 if (
Name.equals(
S->getString()))
1018 return Node->getNumOperands() == 0 && Node->isDistinct();
1029 MDs.push_back(
nullptr);
1035 bool IsVectorMetadata =
false;
1037 if (
MDNode *MD = dyn_cast<MDNode>(
Op)) {
1038 const MDString *
S = dyn_cast<MDString>(MD->getOperand(0));
1045 if (!IsVectorMetadata)
1077 LI.analyze(getAnalysis<DominatorTreeWrapperPass>().getDomTree());
1088 auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
1120 POE = Traversal.
end();
A set of analyses that are preserved following a run of a transformation pass.
void initializeLoopInfoWrapperPassPass(PassRegistry &)
Traverse the blocks in a loop using a depth-first search.
bool isLoopInvariant(const Value *V) const
Return true if the specified value is loop invariant.
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This class represents lattice values for constants.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
BasicBlock * getUniqueExitBlock() const
If getUniqueExitBlocks would return exactly one block, return that block.
void getExitBlocks(SmallVectorImpl< BlockT * > &ExitBlocks) const
Return all of the successor blocks of this loop.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
InstListType::iterator iterator
Instruction iterators...
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Interval::succ_iterator succ_end(Interval *I)
LocationClass< Ty > location(Ty &L)
Represents a single loop in the control flow graph.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
bool contains(const Loop *L) const
Return true if the specified loop is contained within in this loop.
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &)
Handle invalidation explicitly.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void verify(const DominatorTreeBase< BlockT, false > &DomTree) const
DebugLoc getStartLoc() const
Return the debug location of the start of this loop.
bool VerifyLoopInfo
Enables verification of loop info.
This templated class represents "all analyses that operate over <a particular IR unit>" (e....
The main scalar evolution driver.
BranchInst * getLoopGuardBranch() const
Return the loop guard branch, if it exists.
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE,...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
void print(raw_ostream &OS) const
Instruction::BinaryOps getInductionOpcode() const
Returns binary opcode of the induction operator.
Predicate getFlippedStrictnessPredicate() const
For predicate of kind "is X or equal to 0" returns the predicate "is X".
@ ICMP_SGT
signed greater than
static bool startswith(StringRef Magic, const char(&S)[N])
BinaryOperator * getInductionBinOp() const
The legacy pass manager's analysis pass to compute loop information.
static Value * findFinalIVValue(const Loop &L, const PHINode &IndVar, const Instruction &StepInst)
Return the final value of the loop induction variable if found.
bool isCanonical(ScalarEvolution &SE) const
Return true if the loop induction variable starts at zero and increments by one each time through the...
static ICmpInst * getLatchCmpInst(const Loop &L)
Get the latch condition instruction.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
MDNode * findOptionMDForLoopID(MDNode *LoopID, StringRef Name)
Find and return the loop attribute node for the attribute Name in LoopID.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
op_range operands() const
const BasicBlock * getUniqueSuccessor() const
Return the successor of this block if it has a unique successor.
LLVM Basic Block Representation.
unsigned getNumOperands() const
Return number of MDNode operands.
static Optional< Loop::LoopBounds > getBounds(const Loop &L, PHINode &IndVar, ScalarEvolution &SE)
Return the LoopBounds object if.
llvm::MDNode * makePostTransformationMetadata(llvm::LLVMContext &Context, MDNode *OrigLoopID, llvm::ArrayRef< llvm::StringRef > RemovePrefixes, llvm::ArrayRef< llvm::MDNode * > AddAttrs)
Create a new LoopID after the loop has been transformed.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
This is the shared class of boolean and integer constants.
LoopT * getParentLoop() const
Return the parent loop if it exists or nullptr for top level loops.
INITIALIZE_PASS_BEGIN(LoopInfoWrapperPass, "loops", "Natural Loop Information", true, true) INITIALIZE_PASS_END(LoopInfoWrapperPass
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
void getLoopLatches(SmallVectorImpl< BasicBlock * > &LoopLatches) const
Return all loop latch blocks of this loop.
bool getInductionDescriptor(ScalarEvolution &SE, InductionDescriptor &IndDesc) const
Get the loop induction descriptor for the loop induction variable.
A struct for saving information about induction variables.
void setLoopAlreadyUnrolled()
Add llvm.loop.unroll.disable to this loop's loop id metadata.
void analyze(const DominatorTreeBase< BlockT, false > &DomTree)
Create the loop forest using a stable algorithm.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
bool isSafeToSpeculativelyExecute(const Value *V, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr)
Return true if the instruction does not have any effects besides calculating the result and does not ...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
bool isAnnotatedParallel() const
Returns true if the loop is annotated parallel.
Represent the analysis usage information of a pass.
iterator_range< block_iterator > blocks() const
void moveToPlace(MemoryUseOrDef *What, BasicBlock *BB, MemorySSA::InsertionPlace Where)
POTIterator begin()
Postorder traversal over the graph.
Value * getIncomingValueForBlock(const BasicBlock *BB) const
LLVM_NODISCARD detail::scope_exit< typename std::decay< Callable >::type > make_scope_exit(Callable &&F)
void printLoop(Loop &L, raw_ostream &OS, const std::string &Banner="")
Function to print a loop's contents as LLVM's text IR assembly.
Legacy analysis pass which computes a DominatorTree.
iterator_range< const_phi_iterator > phis() const
Returns a range that iterates over the phis in the basic block.
This class implements an extremely fast bulk output stream that can only output to a stream.
const Module * getModule() const
Return the module owning the function this basic block belongs to, or nullptr if the function does no...
API to communicate dependencies between analyses during invalidation.
Direction
An enum for the direction of the loop.
LocRange getLocRange() const
Return the source code span of the loop.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
Value * getCondition() const
const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
This class is the base class for the comparison instructions.
const MDOperand & getOperand(unsigned I) const
Store the result of a depth first search within basic blocks contained by a single loop.
Value * getStartValue() const
bool isLoopSimplifyForm() const
Return true if the Loop is in the form that the LoopSimplify form transforms loops to,...
This class represents an analyzed expression in the program.
This instruction compares its operands according to the predicate given to the constructor.
static bool isBlockInLCSSAForm(const Loop &L, const BasicBlock &BB, const DominatorTree &DT)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
MemorySSA * getMemorySSA() const
Get handle on MemorySSA.
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
This is an important class for using LLVM in a threaded context.
A special type used by analysis passes to provide an address that identifies that particular analysis...
bool getIncomingAndBackEdge(BasicBlock *&Incoming, BasicBlock *&Backedge) const
Obtain the unique incoming and back edge.
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
MemoryUseOrDef * getMemoryAccess(const Instruction *I) const
Given a memory Mod/Ref'ing instruction, get the MemorySSA access associated with it.
Interval::succ_iterator succ_begin(Interval *I)
succ_begin/succ_end - define methods so that Intervals may be used just like BasicBlocks can with the...
Direction getDirection() const
Get the direction of the loop.
BasicBlock * getLoopPreheader() const
If there is a preheader for this loop, return it.
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
void perform(LoopInfo *LI)
Traverse the loop blocks and store the DFS result.
static MDString * get(LLVMContext &Context, StringRef Str)
BlockT * getLoopLatch() const
If there is a single latch block for this loop, return it.
A range representing the start and end location of a loop.
bool hasDedicatedExits() const
Return true if no exit block for the loop has a predecessor that is outside the loop.
ConstantInt * getConstIntStepValue() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
void erase(Loop *L)
Update LoopInfo after removing the last backedge from a loop.
A Module instance is used to store all the information related to an LLVM module.
void print(raw_ostream &O, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
std::vector< BasicBlock * >::const_iterator POIterator
Postorder list iterators.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
void printAsOperand(raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
Print the name of this Value out to the specified raw_ostream.
bool isUnconditional() const
@ ICMP_SLT
signed less than
LoopT * removeChildLoop(iterator I)
This removes the specified child from being a subloop of this loop.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void print(raw_ostream &OS, unsigned Depth=0, bool Verbose=false) const
Print loop with all the BBs inside it.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
StringRef - Represent a constant reference to a string, i.e.
bool makeLoopInvariant(Value *V, bool &Changed, Instruction *InsertPt=nullptr, MemorySSAUpdater *MSSAU=nullptr) const
If the given value is an instruction inside of the loop and it can be hoisted, do so to make it trivi...
PHINode * getCanonicalInductionVariable() const
Check to see if the loop has a canonical induction variable: an integer recurrence that starts at 0 a...
Represents analyses that only rely on functions' control flow.
const SCEV * getStep() const
bool isOutermost() const
Return true if the loop does not have a parent (natural) loop.
const BasicBlock * getUniquePredecessor() const
Return the predecessor of this block if it has a unique predecessor block.
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Core dominator tree base class.
MDNode * findOptionMDForLoop(const Loop *TheLoop, StringRef Name)
Find string metadata for a loop.
bool hasLoopInvariantOperands(const Instruction *I) const
Return true if all the operands of the specified instruction are loop invariant.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
LoopInfo run(Function &F, FunctionAnalysisManager &AM)
Optional< LoopBounds > getBounds(ScalarEvolution &SE) const
Return the struct LoopBounds collected if all struct members are found, else None.
bool isLoopInvariant(const SCEV *S, const Loop *L)
Return true if the value of the given SCEV is unchanging in the specified loop.
const DebugLoc & getStart() const
LLVMContext & getContext() const
Get the context in which this basic block lives.
static bool runOnFunction(Function &F, bool PostInlining)
bool isInnermost() const
Return true if the loop does not contain any (natural) loops.
static bool isInductionPHI(PHINode *Phi, const Loop *L, ScalarEvolution *SE, InductionDescriptor &D, const SCEV *Expr=nullptr, SmallVectorImpl< Instruction * > *CastsToIgnore=nullptr)
Returns true if Phi is an induction in the loop L.
Below are some utilities to get the loop guard, loop bounds and induction variable,...
bool isValidAsAccessGroup(MDNode *AccGroup)
Return whether an MDNode might represent an access group.
void setLoopID(MDNode *LoopID) const
Set the llvm.loop loop id metadata for this loop.
bool isLCSSAForm(const DominatorTree &DT) const
Return true if the Loop is in LCSSA form.
void setPreservesAll()
Set by analyses that do not transform their input at all.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
bool isAuxiliaryInductionVariable(PHINode &AuxIndVar, ScalarEvolution &SE) const
Return true if the given PHINode AuxIndVar is.
ICmpInst::Predicate getCanonicalPredicate() const
Return the canonical predicate for the latch compare instruction, if able to be calcuated.
bool isInvalid() const
Return true if this loop is no longer valid.
Interval::pred_iterator pred_end(Interval *I)
MDNode * getLoopID() const
Return the llvm.loop loop id metadata node for this loop if it is present.
This node represents a polynomial recurrence on the trip count of the specified loop.
BasicBlock * getHeader() const
bool isRecursivelyLCSSAForm(const DominatorTree &DT, const LoopInfo &LI) const
Return true if this Loop and all inner subloops are in LCSSA form.
void setLoopMustProgress()
Add llvm.loop.mustprogress to this loop's loop id metadata.
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
Interval::pred_iterator pred_begin(Interval *I)
pred_begin/pred_end - define methods so that Intervals may be used just like BasicBlocks can with the...
Analysis pass which computes a DominatorTree.
std::vector< Loop * >::const_iterator iterator
const BasicBlock * getParent() const
bool isSafeToClone() const
Return true if the loop body is safe to clone in practice.
Predicate getPredicate() const
Return the predicate for this instruction.
static cl::opt< bool, true > VerifyLoopInfoX("verify-loop-info", cl::location(VerifyLoopInfo), cl::Hidden, cl::desc("Verify loop info (time consuming)"))
std::vector< Loop * >::const_iterator iterator
iterator/begin/end - The interface to the top-level loops in the current function.
bool forcePrintModuleIR()
AnalysisUsage & addRequiredTransitive()
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
bool isOne() const
This is just a convenience method to make client code smaller for a common case.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
PHINode * getInductionVariable(ScalarEvolution &SE) const
Return the loop induction variable if found, else return nullptr.
bool isRotatedForm() const
Return true if the loop is in rotated form.
Value * getOperand(unsigned i) const
Conditional or Unconditional Branch instruction.
LLVM Value Representation.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
iterator_range< user_iterator > users()
bool isConditional() const
Tracking metadata reference owned by Metadata.
BasicBlock * getSuccessor(unsigned i) const
Analysis pass that exposes the LoopInfo for a function.
A Use represents the edge between a Value definition and its users.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.