mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 15:26:06 +00:00

The goal of this patch is to address most of PR36874. To fully fix PR36874 we need to split the "InstructionInfo" view from the "SummaryView". That would make easy to check the latency and rthroughput as well. The patch reuses all the logic from ResourcePressureView to print out the "instruction tables". We have an entry for every instruction in the input sequence. Each entry reports the theoretical resource pressure distribution. Resource pressure is uniformly distributed across all the processor resource units of a group. At the moment, the backend pipeline is not configurable, so the only way to fix this is by creating a different driver that simply sends instruction events to the resource pressure view. That means, we don't use the Backend interface. Instead, it is simpler to just have a different code-path for when flag -instruction-tables is specified. Once Clement addresses bug 36663, then we can port the "instruction tables" logic into a stage of our configurable pipeline. Updated the BtVer2 test cases (thanks Simon for the help). Now we pass flag -instruction-tables to each modified test. Differential Revision: https://reviews.llvm.org/D44839 llvm-svn: 328487
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
//===--------------------- InstructionTables.h ------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
/// \file
|
|
///
|
|
/// This file implements a custom driver to generate instruction tables.
|
|
/// See the description of command-line flag -instruction-tables in
|
|
/// docs/CommandGuide/lvm-mca.rst
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H
|
|
#define LLVM_TOOLS_LLVM_MCA_INSTRUCTIONTABLES_H
|
|
|
|
#include "HWEventListener.h"
|
|
#include "InstrBuilder.h"
|
|
#include "SourceMgr.h"
|
|
#include "llvm/MC/MCSchedule.h"
|
|
|
|
namespace mca {
|
|
|
|
class InstructionTables {
|
|
const llvm::MCSchedModel &SM;
|
|
InstrBuilder &IB;
|
|
SourceMgr &S;
|
|
std::set<HWEventListener *> Listeners;
|
|
|
|
public:
|
|
InstructionTables(const llvm::MCSchedModel &Model, InstrBuilder &Builder,
|
|
SourceMgr &Source)
|
|
: SM(Model), IB(Builder), S(Source) {}
|
|
|
|
void addEventListener(HWEventListener *Listener) {
|
|
if (Listener)
|
|
Listeners.insert(Listener);
|
|
}
|
|
|
|
void run();
|
|
};
|
|
} // namespace mca
|
|
|
|
#endif
|