Go to the documentation of this file.
31 ? runWithLoopNestPasses(L, AM, AR, U)
32 : runWithoutLoopNestPasses(L, AM, AR, U);
49 MapClassName2PassName) {
50 assert(LoopPasses.size() + LoopNestPasses.size() == IsLoopNestPass.size());
52 unsigned IdxLP = 0, IdxLNP = 0;
53 for (
unsigned Idx = 0, Size = IsLoopNestPass.size(); Idx != Size; ++Idx) {
54 if (IsLoopNestPass[Idx]) {
55 auto *
P = LoopNestPasses[IdxLNP++].get();
56 P->printPipeline(OS, MapClassName2PassName);
58 auto *
P = LoopPasses[IdxLP++].get();
59 P->printPipeline(OS, MapClassName2PassName);
72 "Loop-nest passes should only run on top-level loops.");
79 unsigned LoopPassIndex = 0, LoopNestPassIndex = 0;
85 std::unique_ptr<LoopNest> LoopNestPtr;
86 bool IsLoopNestPtrValid =
false;
88 for (
size_t I = 0,
E = IsLoopNestPass.size();
I !=
E; ++
I) {
90 if (!IsLoopNestPass[
I]) {
92 auto &
Pass = LoopPasses[LoopPassIndex++];
93 PassPA = runSinglePass(L,
Pass, AM, AR, U, PI);
96 auto &
Pass = LoopNestPasses[LoopNestPassIndex++];
100 if (!IsLoopNestPtrValid) {
102 IsLoopNestPtrValid =
true;
104 PassPA = runSinglePass(*LoopNestPtr,
Pass, AM, AR, U, PI);
150 for (
auto &
Pass : LoopPasses) {
182 void FunctionToLoopPassAdaptor::printPipeline(
184 OS << (UseMemorySSA ?
"loop-mssa(" :
"loop(");
185 Pass->printPipeline(OS, MapClassName2PassName);
200 PA = LoopCanonicalizationFPM.
run(
F, AM);
218 UseBranchProbabilityInfo &&
F.hasProfileData()
239 LAMFP.markMSSAUsed();
262 assert(any_isa<const Loop *>(
IR) || any_isa<const LoopNest *>(
IR));
263 const Loop *L = any_isa<const Loop *>(
IR)
264 ? any_cast<const Loop *>(
IR)
265 : &any_cast<const LoopNest *>(
IR)->getOutermostLoop();
266 assert(L &&
"Loop should be valid for printing");
271 "Loops must remain in LCSSA form!");
278 "L should be a top-level loop in loop-nest mode.");
281 Updater.CurrentL = L;
282 Updater.SkipCurrentLoop =
false;
297 PassPA =
Pass->run(*L,
LAM, LAR, Updater);
308 "that does not preserve MemorySSA");
332 }
while (!Worklist.
empty());
348 if (UseBlockFrequencyInfo &&
F.hasProfileData())
350 if (UseBranchProbabilityInfo &&
F.hasProfileData())
359 : OS(OS), Banner(Banner) {}
A set of analyses that are preserved following a run of a transformation pass.
A manager for alias analyses.
Analysis pass providing the TargetTransformInfo.
Analysis pass that exposes the ScalarEvolution for a function.
This is an optimization pass for GlobalISel generic memory operations.
void verifyMemorySSA(VerificationLevel=VerificationLevel::Fast) const
Verify that MemorySSA is self consistent (IE definitions dominate all uses, uses appear in the right ...
The TimeTraceScope is a helper class to call the begin and end functions of the time trace profiler.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represents a single loop in the control flow graph.
void invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Invalidate cached analyses for an IR unit.
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 insert(const T &X)
Insert a new element into the PriorityWorklist.
void verify(const DominatorTreeBase< BlockT, false > &DomTree) const
bool VerifyLoopInfo
Enable verification of loop info.
This templated class represents "all analyses that operate over <a particular IR unit>" (e....
void pushBeforeNonSkippedPassCallback(CallableT C)
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Runs the loop passes across every loop in the function.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void intersect(const PreservedAnalyses &Arg)
Intersect this set with another in place.
LoopT * getParentLoop() const
Return the parent loop if it exists or nullptr for top level loops.
Analysis pass which computes BranchProbabilityInfo.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Analysis providing branch probability information.
LLVM_NODISCARD T pop_back_val()
bool isSpecialPass(StringRef PassID, const std::vector< StringRef > &Specials)
void printLoop(Loop &L, raw_ostream &OS, const std::string &Banner="")
Function to print a loop's contents as LLVM's text IR assembly.
void verifyLoop() const
Verify loop structure.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class implements an extremely fast bulk output stream that can only output to a stream.
Statically lint checks LLVM IR
Analysis pass which computes BlockFrequencyInfo.
This analysis provides information for a loop nest.
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
An efficient, type-erasing, non-owning reference to a callable.
PreservedAnalyses runWithLoopNestPasses(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U)
void runAfterPass(const PassT &Pass, const IRUnitT &IR, const PreservedAnalyses &PA) const
AfterPass instrumentation point - takes Pass instance that has just been executed and constant refere...
PreservedAnalyses run(Loop &L, LoopAnalysisManager &, LoopStandardAnalysisResults &, LPMUpdater &)
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
A function analysis which provides an AssumptionCache.
A version of PriorityWorklist that selects small size optimized data structures for the vector and ma...
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Encapsulates MemorySSA, including all data associated with memory accesses.
void runAfterPassInvalidated(const PassT &Pass, const PreservedAnalyses &PA) const
AfterPassInvalidated instrumentation point - takes Pass instance that has just been executed.
bool empty() const
Determine if the PriorityWorklist is empty or not.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class provides instrumentation entry points for the Pass Manager, doing calls to callbacks regis...
An analysis that produces MemorySSA for a function.
void popBeforeNonSkippedPassCallback()
StringRef - Represent a constant reference to a string, i.e.
void appendLoopsToWorklist(RangeT &&, SmallPriorityWorklist< Loop *, 4 > &)
Utility that implements appending of loops onto a worklist given a range.
bool isOutermost() const
Return true if the loop does not have a parent (natural) loop.
Manages a sequence of passes over a particular unit of IR.
bool runBeforePass(const PassT &Pass, const IRUnitT &IR) const
BeforePass instrumentation point - takes Pass instance to be executed and constant reference to IR it...
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
bool isRecursivelyLCSSAForm(const DominatorTree &DT, const LoopInfo &LI) const
Return true if this Loop and all inner subloops are in LCSSA form.
void setParentLoop(Loop *L)
PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs)
Run all of the passes in this manager over the given unit of IR.
Analysis pass which computes a DominatorTree.
PreservedAnalyses runWithoutLoopNestPasses(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U)
Pass interface - Implemented by all 'passes'.
void preserveSet()
Mark an analysis set as preserved.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
bool verify(VerificationLevel VL=VerificationLevel::Full) const
verify - checks if the tree is correct.
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.
Pseudo-analysis pass that exposes the PassInstrumentation to pass managers.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
bool skipCurrentLoop() const
This can be queried by loop passes which run other loop passes (like pass managers) to know whether t...
bool VerifyMemorySSA
Enables verification of MemorySSA.
static std::unique_ptr< LoopNest > getLoopNest(Loop &Root, ScalarEvolution &SE)
Construct a LoopNest object.
Analysis pass providing the TargetLibraryInfo.
bool VerifyDomInfo
Enables verification of dominator trees.
Analysis pass that exposes the LoopInfo for a function.