LLVM  4.0.0
LoopAccessAnalysisPrinter.cpp
Go to the documentation of this file.
1 //===- LoopAccessAnalysisPrinter.cpp - Loop Access Analysis Printer --------==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
12 using namespace llvm;
13 
14 #define DEBUG_TYPE "loop-accesses"
15 
19  Function &F = *L.getHeader()->getParent();
20  auto &LAI = AM.getResult<LoopAccessAnalysis>(L, AR);
21  OS << "Loop access info in function '" << F.getName() << "':\n";
22  OS.indent(2) << L.getHeader()->getName() << ":\n";
23  LAI.print(OS, 4);
24  return PreservedAnalyses::all();
25 }
MachineLoop * L
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
BlockT * getHeader() const
Definition: LoopInfo.h:102
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:191
#define F(x, y, z)
Definition: MD5.cpp:51
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:107
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs...ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Definition: PassManager.h:653
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: PassManager.h:113
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
This analysis provides dependence information for the memory accesses of a loop.
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:368
PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U)
A container for analyses that lazily runs them and caches their results.