LLVM 18.0.0git
LoopAccessAnalysisPrinter.cpp
Go to the documentation of this file.
1//===- LoopAccessAnalysisPrinter.cpp - Loop Access Analysis Printer --------==//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
14
15using namespace llvm;
16
17#define DEBUG_TYPE "loop-accesses"
18
21 auto &LAIs = AM.getResult<LoopAccessAnalysis>(F);
22 auto &LI = AM.getResult<LoopAnalysis>(F);
23 OS << "Printing analysis 'Loop Access Analysis' for function '" << F.getName()
24 << "':\n";
25
27 appendLoopsToWorklist(LI, Worklist);
28 while (!Worklist.empty()) {
29 Loop *L = Worklist.pop_back_val();
30 OS.indent(2) << L->getHeader()->getName() << ":\n";
31 LAIs.getInfo(*L).print(OS, 4);
32 }
34}
#define F(x, y, z)
Definition: MD5.cpp:55
This file provides a priority worklist.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:649
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Definition: PassManager.h:803
This analysis provides dependence information for the memory accesses of a loop.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Analysis pass that exposes the LoopInfo for a function.
Definition: LoopInfo.h:566
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:44
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:172
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: PassManager.h:178
bool empty() const
Determine if the PriorityWorklist is empty or not.
A version of PriorityWorklist that selects small size optimized data structures for the vector and ma...
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void appendLoopsToWorklist(RangeT &&, SmallPriorityWorklist< Loop *, 4 > &)
Utility that implements appending of loops onto a worklist given a range.
Definition: LoopUtils.cpp:1609