summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca/lib')
-rw-r--r--llvm/tools/llvm-mca/lib/Context.cpp2
-rw-r--r--llvm/tools/llvm-mca/lib/Instruction.cpp2
-rw-r--r--llvm/tools/llvm-mca/lib/Stages/FetchStage.cpp19
3 files changed, 10 insertions, 13 deletions
diff --git a/llvm/tools/llvm-mca/lib/Context.cpp b/llvm/tools/llvm-mca/lib/Context.cpp
index c84ea73c4d2..4e30fc9de31 100644
--- a/llvm/tools/llvm-mca/lib/Context.cpp
+++ b/llvm/tools/llvm-mca/lib/Context.cpp
@@ -41,7 +41,7 @@ Context::createDefaultPipeline(const PipelineOptions &Opts, InstrBuilder &IB,
auto HWS = llvm::make_unique<Scheduler>(SM, LSU.get());
// Create the pipeline stages.
- auto Fetch = llvm::make_unique<FetchStage>(IB, SrcMgr);
+ auto Fetch = llvm::make_unique<FetchStage>(SrcMgr);
auto Dispatch = llvm::make_unique<DispatchStage>(STI, MRI, Opts.DispatchWidth,
*RCU, *PRF);
auto Execute = llvm::make_unique<ExecuteStage>(*HWS);
diff --git a/llvm/tools/llvm-mca/lib/Instruction.cpp b/llvm/tools/llvm-mca/lib/Instruction.cpp
index 12b6e185ced..42f5cd38ee9 100644
--- a/llvm/tools/llvm-mca/lib/Instruction.cpp
+++ b/llvm/tools/llvm-mca/lib/Instruction.cpp
@@ -93,7 +93,7 @@ void ReadState::cycleEvent() {
#ifndef NDEBUG
void WriteState::dump() const {
- dbgs() << "{ OpIdx=" << WD.OpIndex << ", Lat=" << getLatency() << ", RegID "
+ dbgs() << "{ OpIdx=" << WD->OpIndex << ", Lat=" << getLatency() << ", RegID "
<< getRegisterID() << ", Cycles Left=" << getCyclesLeft() << " }";
}
diff --git a/llvm/tools/llvm-mca/lib/Stages/FetchStage.cpp b/llvm/tools/llvm-mca/lib/Stages/FetchStage.cpp
index 515dc15c5b3..85d06d2d183 100644
--- a/llvm/tools/llvm-mca/lib/Stages/FetchStage.cpp
+++ b/llvm/tools/llvm-mca/lib/Stages/FetchStage.cpp
@@ -14,6 +14,7 @@
//===----------------------------------------------------------------------===//
#include "Stages/FetchStage.h"
+#include "Instruction.h"
namespace mca {
@@ -25,20 +26,15 @@ bool FetchStage::isAvailable(const InstRef & /* unused */) const {
return false;
}
-llvm::Error FetchStage::getNextInstruction() {
+void FetchStage::getNextInstruction() {
assert(!CurrentInstruction && "There is already an instruction to process!");
if (!SM.hasNext())
- return llvm::ErrorSuccess();
- const SourceRef SR = SM.peekNext();
- llvm::Expected<std::unique_ptr<Instruction>> InstOrErr =
- IB.createInstruction(SR.second);
- if (!InstOrErr)
- return InstOrErr.takeError();
- std::unique_ptr<Instruction> Inst = std::move(InstOrErr.get());
+ return;
+ SourceRef SR = SM.peekNext();
+ std::unique_ptr<Instruction> Inst = llvm::make_unique<Instruction>(SR.second);
CurrentInstruction = InstRef(SR.first, Inst.get());
Instructions[SR.first] = std::move(Inst);
SM.updateNext();
- return llvm::ErrorSuccess();
}
llvm::Error FetchStage::execute(InstRef & /*unused */) {
@@ -48,12 +44,13 @@ llvm::Error FetchStage::execute(InstRef & /*unused */) {
// Move the program counter.
CurrentInstruction.invalidate();
- return getNextInstruction();
+ getNextInstruction();
+ return llvm::ErrorSuccess();
}
llvm::Error FetchStage::cycleStart() {
if (!CurrentInstruction)
- return getNextInstruction();
+ getNextInstruction();
return llvm::ErrorSuccess();
}
OpenPOWER on IntegriCloud