2018-06-25 18:53:00 +02:00
|
|
|
//===--------------------- PipelinePrinter.h --------------------*- C++ -*-===//
|
2018-03-08 14:05:02 +01:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
/// \file
|
|
|
|
///
|
2018-06-25 18:53:00 +02:00
|
|
|
/// This file implements class PipelinePrinter.
|
2018-03-08 17:08:43 +01:00
|
|
|
///
|
2018-06-25 18:53:00 +02:00
|
|
|
/// PipelinePrinter allows the customization of the performance report.
|
2018-03-08 14:05:02 +01:00
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2018-06-25 18:53:00 +02:00
|
|
|
#ifndef LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H
|
|
|
|
#define LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H
|
2018-03-08 14:05:02 +01:00
|
|
|
|
2018-06-25 18:53:00 +02:00
|
|
|
#include "Pipeline.h"
|
2018-08-24 22:24:53 +02:00
|
|
|
#include "Views/View.h"
|
2018-03-08 17:08:43 +01:00
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2018-03-08 14:05:02 +01:00
|
|
|
|
|
|
|
#define DEBUG_TYPE "llvm-mca"
|
|
|
|
|
|
|
|
namespace mca {
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// A printer class that knows how to collects statistics on the
|
2018-03-08 14:05:02 +01:00
|
|
|
/// code analyzed by the llvm-mca tool.
|
|
|
|
///
|
|
|
|
/// This class knows how to print out the analysis information collected
|
|
|
|
/// during the execution of the code. Internally, it delegates to other
|
|
|
|
/// classes the task of printing out timeline information as well as
|
|
|
|
/// resource pressure.
|
2018-06-25 18:53:00 +02:00
|
|
|
class PipelinePrinter {
|
|
|
|
Pipeline &P;
|
2018-03-08 17:08:43 +01:00
|
|
|
llvm::SmallVector<std::unique_ptr<View>, 8> Views;
|
2018-03-08 14:05:02 +01:00
|
|
|
|
|
|
|
public:
|
2018-06-25 18:53:00 +02:00
|
|
|
PipelinePrinter(Pipeline &pipeline) : P(pipeline) {}
|
2018-03-08 14:05:02 +01:00
|
|
|
|
2018-03-09 14:52:03 +01:00
|
|
|
void addView(std::unique_ptr<View> V) {
|
2018-06-25 18:53:00 +02:00
|
|
|
P.addEventListener(V.get());
|
2018-03-09 14:52:03 +01:00
|
|
|
Views.emplace_back(std::move(V));
|
|
|
|
}
|
2018-03-08 14:05:02 +01:00
|
|
|
|
2018-03-08 17:08:43 +01:00
|
|
|
void printReport(llvm::raw_ostream &OS) const;
|
2018-03-08 14:05:02 +01:00
|
|
|
};
|
|
|
|
} // namespace mca
|
|
|
|
|
2018-06-25 18:53:00 +02:00
|
|
|
#endif // LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H
|