1 //===--------------------- PipelinePrinter.h --------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// This file implements class PipelinePrinter.
13 /// PipelinePrinter allows the customization of the performance report.
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H
18 #define LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H
22 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/Support/raw_ostream.h"
25 #define DEBUG_TYPE "llvm-mca"
29 /// A printer class that knows how to collects statistics on the
30 /// code analyzed by the llvm-mca tool.
32 /// This class knows how to print out the analysis information collected
33 /// during the execution of the code. Internally, it delegates to other
34 /// classes the task of printing out timeline information as well as
35 /// resource pressure.
36 class PipelinePrinter {
38 llvm::SmallVector<std::unique_ptr<View>, 8> Views;
41 PipelinePrinter(Pipeline &pipeline) : P(pipeline) {}
43 void addView(std::unique_ptr<View> V) {
44 P.addEventListener(V.get());
45 Views.emplace_back(std::move(V));
48 void printReport(llvm::raw_ostream &OS) const;
52 #endif // LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H