blob: 1c3ff1a61b7e23115850e6d4cdf96146b64ac787 [file] [log] [blame]
Chandler Carruth3bab7e12017-01-11 09:43:56 +00001//===- LoopAccessAnalysisPrinter.cpp - Loop Access Analysis Printer --------==//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Chandler Carruth3bab7e12017-01-11 09:43:56 +00006//
7//===----------------------------------------------------------------------===//
8
9#include "llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h"
10#include "llvm/Analysis/LoopAccessAnalysis.h"
11using namespace llvm;
12
13#define DEBUG_TYPE "loop-accesses"
14
15PreservedAnalyses
16LoopAccessInfoPrinterPass::run(Loop &L, LoopAnalysisManager &AM,
17 LoopStandardAnalysisResults &AR, LPMUpdater &) {
18 Function &F = *L.getHeader()->getParent();
19 auto &LAI = AM.getResult<LoopAccessAnalysis>(L, AR);
20 OS << "Loop access info in function '" << F.getName() << "':\n";
21 OS.indent(2) << L.getHeader()->getName() << ":\n";
22 LAI.print(OS, 4);
23 return PreservedAnalyses::all();
24}