71#define LDIST_NAME "loop-distribute"
72#define DEBUG_TYPE LDIST_NAME
77 "llvm.loop.distribute.followup_all";
79 "llvm.loop.distribute.followup_coincident";
81 "llvm.loop.distribute.followup_sequential";
83 "llvm.loop.distribute.followup_fallback";
88STATISTIC(NumLoopsDistributed,
"Number of loops distributed");
99 : DepCycle(DepCycle), OrigLoop(L) {
104 bool hasDepCycle()
const {
return DepCycle; }
107 void add(Instruction *
I) { Set.insert(
I); }
114 bool empty()
const {
return Set.empty(); }
118 void moveTo(InstPartition &
Other) {
119 Other.Set.insert_range(Set);
121 Other.DepCycle |= DepCycle;
126 void populateUsedSet() {
130 for (
auto *
B : OrigLoop->getBlocks())
131 Set.insert(
B->getTerminator());
135 SmallVector<Instruction *, 8> Worklist(Set.begin(), Set.end());
136 while (!Worklist.empty()) {
139 for (
Value *V :
I->operand_values()) {
141 if (
I && OrigLoop->contains(
I->getParent()) && Set.insert(
I))
142 Worklist.push_back(
I);
152 unsigned Index, LoopInfo *LI,
155 VMap, Twine(
".ldist") + Twine(Index),
156 LI, DT, ClonedLoopBlocks);
162 const Loop *getClonedLoop()
const {
return ClonedLoop; }
167 Loop *getDistributedLoop()
const {
168 return ClonedLoop ? ClonedLoop : OrigLoop;
176 void remapInstructions() {
182 void removeUnusedInsts() {
183 SmallVector<Instruction *, 8>
Unused;
185 for (
auto *
Block : OrigLoop->getBlocks())
186 for (
auto &Inst : *
Block)
187 if (!Set.count(&Inst)) {
193 "Branches are marked used early on");
194 Unused.push_back(NewInst);
199 for (
auto *Inst :
reverse(Unused)) {
201 if (!Inst->use_empty())
203 Inst->eraseFromParent();
207 void print(raw_ostream &OS)
const {
208 OS << (DepCycle ?
" (cycle)\n" :
"\n");
211 OS <<
" " <<
I->getParent()->getName() <<
":" << *
I <<
"\n";
214 void printBlocks(raw_ostream &OS)
const {
215 for (
auto *BB : getDistributedLoop()->getBlocks())
231 Loop *ClonedLoop =
nullptr;
235 SmallVector<BasicBlock *, 8> ClonedLoopBlocks;
245class InstPartitionContainer {
246 using InstToPartitionIdT = DenseMap<Instruction *, int>;
249 InstPartitionContainer(
Loop *L, LoopInfo *LI, DominatorTree *DT)
250 : L(L), LI(LI), DT(DT) {}
253 unsigned getSize()
const {
return PartitionContainer.size(); }
257 void addToCyclicPartition(Instruction *Inst) {
259 if (PartitionContainer.empty() || !PartitionContainer.back().hasDepCycle())
260 PartitionContainer.emplace_back(Inst, L,
true);
262 PartitionContainer.back().add(Inst);
270 void addToNewNonCyclicPartition(Instruction *Inst) {
271 PartitionContainer.emplace_back(Inst, L);
279 void mergeAdjacentNonCyclic() {
280 mergeAdjacentPartitionsIf(
281 [](
const InstPartition *
P) {
return !
P->hasDepCycle(); });
286 void mergeNonIfConvertible() {
287 mergeAdjacentPartitionsIf([&](
const InstPartition *Partition) {
288 if (Partition->hasDepCycle())
292 bool seenStore =
false;
294 for (
auto *Inst : *Partition)
305 void mergeBeforePopulating(
const ScalarOptions &Opts) {
306 mergeAdjacentNonCyclic();
307 if (!Opts.loop_distribute_non_if_convertible)
308 mergeNonIfConvertible();
318 bool mergeToAvoidDuplicatedLoads() {
319 using LoadToPartitionT = DenseMap<Instruction *, InstPartition *>;
320 using ToBeMergedT = EquivalenceClasses<InstPartition *>;
322 LoadToPartitionT LoadToPartition;
323 ToBeMergedT ToBeMerged;
328 for (PartitionContainerT::iterator
I = PartitionContainer.begin(),
329 E = PartitionContainer.end();
335 for (Instruction *Inst : *PartI)
338 LoadToPartitionT::iterator LoadToPart;
340 std::tie(LoadToPart, NewElt) =
341 LoadToPartition.insert(std::make_pair(Inst, PartI));
345 <<
"LDist: Merging partitions due to this load in multiple "
346 <<
"partitions: " << PartI <<
", " << LoadToPart->second <<
"\n"
352 ToBeMerged.unionSets(PartI, &*PartJ);
353 }
while (&*PartJ != LoadToPart->second);
357 if (ToBeMerged.empty())
362 for (
const auto &
C : ToBeMerged) {
366 auto PartI =
C->getData();
367 for (
auto *PartJ :
make_range(std::next(ToBeMerged.member_begin(*
C)),
368 ToBeMerged.member_end())) {
369 PartJ->moveTo(*PartI);
374 PartitionContainer.remove_if(
375 [](
const InstPartition &
P) {
return P.empty(); });
382 void setupPartitionIdOnInstructions() {
384 for (
const auto &Partition : PartitionContainer) {
385 for (Instruction *Inst : Partition) {
389 std::tie(Iter, NewElt) =
390 InstToPartitionId.insert(std::make_pair(Inst, PartitionID));
400 void populateUsedSet() {
401 for (
auto &
P : PartitionContainer)
412 assert(Pred &&
"Preheader does not have a single predecessor");
414 assert(ExitBlock &&
"No single exit block");
417 assert(!PartitionContainer.empty() &&
"at least two partitions expected");
421 "preheader not empty");
424 MDNode *OrigLoopID = L->getLoopID();
432 NewLoop = Part.cloneLoopWithPreheader(TopPH, Pred, Index, LI, DT);
434 Part.getVMap()[ExitBlock] = TopPH;
435 Part.remapInstructions();
436 setNewLoopID(OrigLoopID, &Part);
443 setNewLoopID(OrigLoopID, &PartitionContainer.back());
448 for (
auto Curr = PartitionContainer.cbegin(),
449 Next = std::next(PartitionContainer.cbegin()),
450 E = PartitionContainer.cend();
452 DT->changeImmediateDominator(
453 Next->getDistributedLoop()->getLoopPreheader(),
454 Curr->getDistributedLoop()->getExitingBlock());
458 void removeUnusedInsts() {
459 for (
auto &Partition : PartitionContainer)
460 Partition.removeUnusedInsts();
470 computePartitionSetForPointers(
const LoopAccessInfo &LAI) {
473 unsigned N = RtPtrCheck->
Pointers.size();
474 SmallVector<int, 8> PtrToPartitions(
N);
475 for (
unsigned I = 0;
I <
N; ++
I) {
478 auto ReadInstructions =
480 Instructions.append(ReadInstructions.begin(), ReadInstructions.end());
482 int &Partition = PtrToPartitions[
I];
485 for (Instruction *Inst : Instructions) {
488 int ThisPartition = this->InstToPartitionId[Inst];
490 Partition = ThisPartition;
492 else if (Partition == -1)
494 else if (Partition != ThisPartition)
497 assert(Partition != -2 &&
"Pointer not belonging to any partition");
500 return PtrToPartitions;
503 void print(raw_ostream &OS)
const {
505 for (
const auto &
P : PartitionContainer) {
506 OS <<
"LDist: Partition " <<
Index++ <<
":";
514 friend raw_ostream &
operator<<(raw_ostream &OS,
515 const InstPartitionContainer &Partitions) {
516 Partitions.print(OS);
521 void printBlocks(raw_ostream &OS)
const {
523 for (
const auto &
P : PartitionContainer) {
524 OS <<
"LDist: Partition " <<
Index++ <<
":";
530 using PartitionContainerT = std::list<InstPartition>;
533 PartitionContainerT PartitionContainer;
537 InstToPartitionIdT InstToPartitionId;
545 template <
class UnaryPredicate>
546 void mergeAdjacentPartitionsIf(UnaryPredicate Predicate) {
547 InstPartition *PrevMatch =
nullptr;
548 for (
auto I = PartitionContainer.begin();
I != PartitionContainer.end();) {
550 if (PrevMatch ==
nullptr && DoesMatch) {
553 }
else if (PrevMatch !=
nullptr && DoesMatch) {
554 I->moveTo(*PrevMatch);
555 I = PartitionContainer.erase(
I);
564 void setNewLoopID(MDNode *OrigLoopID, InstPartition *Part) {
571 Loop *NewLoop = Part->getDistributedLoop();
583class MemoryInstructionDependences {
584 using Dependence = MemoryDepChecker::Dependence;
589 unsigned NumUnsafeDependencesStartOrEnd = 0;
591 Entry(Instruction *Inst) : Inst(Inst) {}
594 using AccessesType = SmallVector<Entry, 8>;
599 MemoryInstructionDependences(
600 const SmallVectorImpl<Instruction *> &Instructions,
601 const SmallVectorImpl<Dependence> &Dependences) {
605 for (
const auto &Dep : Dependences)
606 if (Dep.isPossiblyBackward()) {
610 ++Accesses[Dep.Source].NumUnsafeDependencesStartOrEnd;
611 --Accesses[Dep.Destination].NumUnsafeDependencesStartOrEnd;
618 AccessesType Accesses;
622class LoopDistributeForLoop {
624 LoopDistributeForLoop(
const ScalarOptions &Opts,
Loop *L,
Function *F,
625 LoopInfo *LI, DominatorTree *DT, ScalarEvolution *SE,
626 LoopAccessInfoManager &LAIs,
627 OptimizationRemarkEmitter *ORE)
628 : Opts(Opts), L(L), F(F), LI(LI), DT(DT), SE(SE), LAIs(LAIs), ORE(ORE) {
634 assert(L->isInnermost() &&
"Only process inner loops.");
637 << L->getHeader()->getParent()->getName() <<
"' from "
638 << L->getLocStr() <<
"\n");
641 if (!L->getExitBlock())
642 return fail(
"MultipleExitBlocks",
"multiple exit blocks");
643 if (!L->isLoopSimplifyForm())
644 return fail(
"NotLoopSimplifyForm",
645 "loop is not in loop-simplify form");
646 if (!L->isRotatedForm())
647 return fail(
"NotBottomTested",
"loop is not bottom tested");
651 LAI = &LAIs.getInfo(*L);
655 if (LAI->canVectorizeMemory())
656 return fail(
"MemOpsCanBeVectorized",
657 "memory operations are safe for vectorization");
659 auto *Dependences = LAI->getDepChecker().getDependences();
660 if (!Dependences || Dependences->empty())
661 return fail(
"NoUnsafeDeps",
"no unsafe dependences to isolate");
664 << L->getHeader()->getName() <<
"\n");
666 InstPartitionContainer Partitions(L, LI, DT);
687 const MemoryDepChecker &DepChecker = LAI->getDepChecker();
691 int NumUnsafeDependencesActive = 0;
692 for (
const auto &InstDep : MID) {
696 if (NumUnsafeDependencesActive ||
697 InstDep.NumUnsafeDependencesStartOrEnd > 0)
698 Partitions.addToCyclicPartition(
I);
700 Partitions.addToNewNonCyclicPartition(
I);
701 NumUnsafeDependencesActive += InstDep.NumUnsafeDependencesStartOrEnd;
702 assert(NumUnsafeDependencesActive >= 0 &&
703 "Negative number of dependences active");
712 for (
auto *Inst : DefsUsedOutside)
713 Partitions.addToNewNonCyclicPartition(Inst);
715 LLVM_DEBUG(
dbgs() <<
"LDist: Seeded partitions:\n" << Partitions);
716 if (Partitions.getSize() < 2)
717 return fail(
"CantIsolateUnsafeDeps",
718 "cannot isolate unsafe dependencies");
722 Partitions.mergeBeforePopulating(Opts);
723 LLVM_DEBUG(
dbgs() <<
"LDist: Merged partitions:\n" << Partitions);
724 if (Partitions.getSize() < 2)
725 return fail(
"CantIsolateUnsafeDeps",
726 "cannot isolate unsafe dependencies");
729 Partitions.populateUsedSet();
730 LLVM_DEBUG(
dbgs() <<
"LDist: Populated partitions:\n" << Partitions);
734 if (Partitions.mergeToAvoidDuplicatedLoads()) {
735 LLVM_DEBUG(
dbgs() <<
"LDist: Partitions merged to ensure unique loads:\n"
737 if (Partitions.getSize() < 2)
738 return fail(
"CantIsolateUnsafeDeps",
739 "cannot isolate unsafe dependencies");
744 const SCEVPredicate &Pred = LAI->getPSE().getPredicate();
746 return fail(
"RuntimeCheckWithConvergent",
747 "may not insert runtime check with convergent operation");
751 (IsForced.value_or(
false)
752 ? Opts.loop_distribute_scev_check_threshold_with_pragma
753 : Opts.loop_distribute_scev_check_threshold))
754 return fail(
"TooManySCEVRuntimeChecks",
755 "too many SCEV run-time checks needed.\n");
758 return fail(
"HeuristicDisabled",
"distribution heuristic disabled");
761 << L->getHeader()->getName() <<
"\n");
764 Partitions.setupPartitionIdOnInstructions();
767 auto PtrToPartition = Partitions.computePartitionSetForPointers(*LAI);
768 const auto *RtPtrChecking = LAI->getRuntimePointerChecking();
769 const auto &AllChecks = RtPtrChecking->getChecks();
770 auto Checks = includeOnlyCrossPartitionChecks(AllChecks, PtrToPartition,
773 if (LAI->hasConvergentOp() && !Checks.empty()) {
774 return fail(
"RuntimeCheckWithConvergent",
775 "may not insert runtime check with convergent operation");
785 assert(!LAI->hasConvergentOp() &&
"inserting illegal loop versioning");
787 MDNode *OrigLoopID = L->getLoopID();
790 LLVM_DEBUG(LAI->getRuntimePointerChecking()->printChecks(
dbgs(), Checks));
792 if (!L->isRecursivelyLCSSAForm(*DT, *LI))
794 LoopVersioning LVer(*LAI, Checks, L, LI, DT, SE);
795 LVer.versionLoop(DefsUsedOutside);
796 LVer.annotateLoopWithNoAlias();
804 "llvm.loop.distribute.",
true);
805 LVer.getNonVersionedLoop()->setLoopID(UnversionedLoopID);
812 Partitions.cloneLoops();
816 Partitions.removeUnusedInsts();
820 if (Opts.loop_distribute_verify) {
822 assert(DT->verify(DominatorTree::VerificationLevel::Fast));
825 ++NumLoopsDistributed;
828 return OptimizationRemark(
LDIST_NAME,
"Distribute", L->getStartLoc(),
830 <<
"distributed loop";
836 bool fail(StringRef RemarkName, StringRef Message) {
837 LLVMContext &Ctx = F->getContext();
838 bool Forced = isForced().value_or(
false);
844 return OptimizationRemarkMissed(
LDIST_NAME,
"NotDistributed",
845 L->getStartLoc(), L->getHeader())
846 <<
"loop not distributed: use -Rpass-analysis=loop-distribute for "
853 ORE->emit(OptimizationRemarkAnalysis(
855 RemarkName, L->getStartLoc(), L->getHeader())
856 <<
"loop not distributed: " << Message);
861 Ctx.
diagnose(DiagnosticInfoOptimizationFailure(
862 *F, L->getStartLoc(),
"loop not distributed: failed "
863 "explicitly specified loop distribution"));
873 const std::optional<bool> &isForced()
const {
return IsForced; }
881 SmallVector<RuntimePointerCheck, 4> includeOnlyCrossPartitionChecks(
882 const SmallVectorImpl<RuntimePointerCheck> &AllChecks,
883 const SmallVectorImpl<int> &PtrToPartition,
884 const RuntimePointerChecking *RtPtrChecking) {
885 SmallVector<RuntimePointerCheck, 4> Checks;
887 copy_if(AllChecks, std::back_inserter(Checks),
889 for (
unsigned PtrIdx1 :
Check.first->Members)
890 for (
unsigned PtrIdx2 :
Check.second->Members)
906 PtrToPartition, PtrIdx1, PtrIdx2))
923 const ScalarOptions &Opts;
929 const LoopAccessInfo *LAI =
nullptr;
932 LoopAccessInfoManager &LAIs;
933 OptimizationRemarkEmitter *ORE;
941 std::optional<bool> IsForced;
954 for (
Loop *TopLevelLoop : *LI)
957 if (L->isInnermost())
961 const ScalarOptions &Opts = ScalarOptions::Global;
963 for (
Loop *L : Worklist) {
964 LoopDistributeForLoop LDL(Opts, L, &
F, LI, DT, SE, LAIs, ORE);
969 dbgs() <<
"LDist: Distributed loop guarded for reprocessing\n");
975 if (LDL.isForced().value_or(Opts.enable_loop_distribute))
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static void fail(const SDLoc &DL, SelectionDAG &DAG, const Twine &Msg, SDValue Val={})
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static bool runImpl(MachineFunction &MF)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file defines the DenseMap class.
This file builds on the ADT/GraphTraits.h file to build generic depth first graph iterator.
Generic implementation of equivalence classes through the use Tarjan's efficient union-find algorithm...
This is the interface for a simple mod/ref and alias analysis over globals.
This header defines various interfaces for pass management in LLVM.
This header provides classes for managing per-loop analyses.
static const char *const LLVMLoopDistributeFollowupCoincident
static const char *const LLVMLoopDistributeFollowupSequential
static const char *const LLVMLoopDistributeFollowupAll
static const char * DistributedMetaData
static const char *const LLVMLoopDistributeFollowupFallback
static bool runImpl(Function &F, LoopInfo *LI, DominatorTree *DT, ScalarEvolution *SE, OptimizationRemarkEmitter *ORE, LoopAccessInfoManager &LAIs)
static bool processLoop(Loop &L, const AArch64Subtarget &ST, DataLayout DL)
This file implements a set that has insertion order iteration characteristics.
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)
static unsigned getSize(unsigned Kind)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
iterator begin()
Instruction iterator methods.
LLVM_ABI const BasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor block.
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction; assumes that the block is well-formed.
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT > iterator
Analysis pass which computes a DominatorTree.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
LLVM_ABI void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
This analysis provides dependence information for the memory accesses of a loop.
const RuntimePointerChecking * getRuntimePointerChecking() const
static LLVM_ABI bool blockNeedsPredication(const BasicBlock *BB, const Loop *TheLoop, const DominatorTree *DT)
Return true if the block BB needs to be predicated in order for the loop to be vectorized.
SmallVector< Instruction *, 4 > getInstructionsForAccess(Value *Ptr, bool isWrite) const
Return the list of instructions that use Ptr to read or write memory.
Analysis pass that exposes the LoopInfo for a function.
BlockT * getLoopPreheader() const
If there is a preheader for this loop, return it.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Represents a single loop in the control flow graph.
void setLoopID(MDNode *LoopID) const
Set the llvm.loop loop id metadata for this loop.
const SmallVectorImpl< Instruction * > & getMemoryInstructions() const
The vector of memory access instructions.
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
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.
PreservedAnalyses & preserve()
Mark an analysis as preserved.
LLVM_ABI bool needsChecking(const RuntimeCheckingPtrGroup &M, const RuntimeCheckingPtrGroup &N) const
Decide if we need to add a check between two groups of pointers, according to needsChecking.
static LLVM_ABI bool arePointersInSamePartition(const SmallVectorImpl< int > &PtrToPartition, unsigned PtrIdx1, unsigned PtrIdx2)
Check if pointers are in the same partition.
SmallVector< PointerInfo, 2 > Pointers
Information about the pointers that may require checking.
virtual unsigned getComplexity() const
Returns the estimated complexity of this predicate.
virtual bool isAlwaysTrue() const =0
Returns true if the predicate is always true.
Analysis pass that exposes the ScalarEvolution for a function.
The main scalar evolution driver.
typename vector_type::const_iterator iterator
typename vector_type::const_iterator const_iterator
A SetVector that performs no allocations if smaller than a certain size.
typename SuperClass::const_iterator const_iterator
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM_ABI bool replaceUsesOfWith(Value *From, Value *To)
Replace uses of one Value with another.
const ParentTy * getParent() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
@ BasicBlock
Various leaf nodes.
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
LLVM_ABI iterator begin() const
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
LLVM_ABI bool getBooleanLoopAttribute(const Loop *TheLoop, StringRef Name)
Returns true if Name is applied to TheLoop and enabled.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
LLVM_ABI std::optional< bool > getOptionalBoolLoopAttribute(const Loop *TheLoop, StringRef Name)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI void salvageDebugInfo(const MachineRegisterInfo &MRI, MachineInstr &MI)
Assuming the instruction MI is going to be deleted, attempt to salvage debug users of MI by writing t...
LLVM_ABI bool formLCSSARecursively(Loop &L, const DominatorTree &DT, const LoopInfo *LI, ScalarEvolution *SE)
Put a loop nest into LCSSA form.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
LLVM_ABI std::optional< MDNode * > makeFollowupLoopID(MDNode *OrigLoopID, ArrayRef< StringRef > FollowupAttrs, const char *InheritOptionsAttrsPrefix="", bool AlwaysNew=false)
Create a new loop identifier for a loop created from a loop transformation.
std::pair< const RuntimeCheckingPtrGroup *, const RuntimeCheckingPtrGroup * > RuntimePointerCheck
A memcheck which made up of a pair of grouped pointers.
OutputIt copy_if(R &&Range, OutputIt Out, UnaryPredicate P)
Provide wrappers to std::copy_if which take ranges instead of having to pass begin/end explicitly.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ABI void addStringMetadataToLoop(Loop *TheLoop, const char *MDString, unsigned V=0)
Set input string into loop metadata by keeping other values intact.
LLVM_ABI SmallVector< Instruction *, 8 > findDefsUsedOutsideOfLoop(Loop *L)
Returns the instructions that use values defined in the loop.
auto reverse(ContainerTy &&C)
LLVM_ABI Loop * cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB, Loop *OrigLoop, ValueToValueMapTy &VMap, const Twine &NameSuffix, LoopInfo *LI, DominatorTree *DT, SmallVectorImpl< BasicBlock * > &Blocks)
Clones a loop OrigLoop.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI bool hasDisableAllTransformsHint(const Loop *L)
Look for the loop attribute that disables all transformation heuristic.
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...
LLVM_ABI BasicBlock * SplitBlock(BasicBlock *Old, BasicBlock::iterator SplitPt, DominatorTree *DT, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, const Twine &BBName="")
Split the specified block at the specified instruction.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
LLVM_ABI void remapInstructionsInBlocks(ArrayRef< BasicBlock * > Blocks, ValueToValueMapTy &VMap)
Remaps instructions in Blocks using the mapping in VMap.
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Next
iterator_range< df_iterator< T > > depth_first(const T &G)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.