summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-10-25 11:51:34 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2018-10-25 11:51:34 +0000
commit77c26aebdaae0196fc131eb3b613dac3b0023814 (patch)
treef224de9ad4b8f98b03d68e8fe552d2628673b9f9 /llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
parentcaa02f879f569de2c0d912e670f0edbb647ed3a4 (diff)
downloadbcm5719-llvm-77c26aebdaae0196fc131eb3b613dac3b0023814.tar.gz
bcm5719-llvm-77c26aebdaae0196fc131eb3b613dac3b0023814.zip
[llvm-mca] Removed a couple of redundant method declarations, and simplified code in ResourcePressureView. NFC
llvm-svn: 345259
Diffstat (limited to 'llvm/tools/llvm-mca/Views/ResourcePressureView.cpp')
-rw-r--r--llvm/tools/llvm-mca/Views/ResourcePressureView.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp b/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
index 17c801259d9..e71825b07c7 100644
--- a/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
+++ b/llvm/tools/llvm-mca/Views/ResourcePressureView.cpp
@@ -20,7 +20,10 @@ namespace mca {
using namespace llvm;
-void ResourcePressureView::initialize() {
+ResourcePressureView::ResourcePressureView(const llvm::MCSubtargetInfo &sti,
+ llvm::MCInstPrinter &Printer,
+ const SourceMgr &Sequence)
+ : STI(sti), MCIP(Printer), Source(Sequence) {
// Populate the map of resource descriptors.
unsigned R2VIndex = 0;
const MCSchedModel &SM = STI.getSchedModel();
@@ -92,8 +95,7 @@ static void printResourcePressure(formatted_raw_ostream &OS, double Pressure,
OS.PadToColumn(Col);
}
-void ResourcePressureView::printResourcePressurePerIteration(
- raw_ostream &OS, unsigned Executions) const {
+void ResourcePressureView::printResourcePressurePerIter(raw_ostream &OS) const {
std::string Buffer;
raw_string_ostream TempStream(Buffer);
formatted_raw_ostream FOS(TempStream);
@@ -126,6 +128,7 @@ void ResourcePressureView::printResourcePressurePerIteration(
FOS << '\n';
FOS.flush();
+ const unsigned Executions = Source.getNumIterations();
for (unsigned I = 0, E = NumResourceUnits; I < E; ++I) {
double Usage = ResourceUsage[I + Source.size() * E];
printResourcePressure(FOS, Usage / Executions, (I + 1) * 7);
@@ -135,8 +138,7 @@ void ResourcePressureView::printResourcePressurePerIteration(
OS << Buffer;
}
-void ResourcePressureView::printResourcePressurePerInstruction(
- raw_ostream &OS, unsigned Executions) const {
+void ResourcePressureView::printResourcePressurePerInst(raw_ostream &OS) const {
std::string Buffer;
raw_string_ostream TempStream(Buffer);
formatted_raw_ostream FOS(TempStream);
@@ -149,6 +151,7 @@ void ResourcePressureView::printResourcePressurePerInstruction(
raw_string_ostream InstrStream(Instruction);
unsigned InstrIndex = 0;
+ const unsigned Executions = Source.getNumIterations();
for (const MCInst &MCI : Source) {
unsigned BaseEltIdx = InstrIndex * NumResourceUnits;
for (unsigned J = 0; J < NumResourceUnits; ++J) {
OpenPOWER on IntegriCloud