[llvm] r347775 - Revert [llvm-mca] Return the total number of cycles from method Pipeline::run().
Andrea Di Biagio via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 28 08:39:48 PST 2018
Author: adibiagio
Date: Wed Nov 28 08:39:48 2018
New Revision: 347775
URL: http://llvm.org/viewvc/llvm-project?rev=347775&view=rev
Log:
Revert [llvm-mca] Return the total number of cycles from method Pipeline::run().
This reverts commits 347767.
Modified:
llvm/trunk/tools/llvm-mca/include/Pipeline.h
llvm/trunk/tools/llvm-mca/lib/Pipeline.cpp
llvm/trunk/tools/llvm-mca/llvm-mca.cpp
Modified: llvm/trunk/tools/llvm-mca/include/Pipeline.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/include/Pipeline.h?rev=347775&r1=347774&r2=347775&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/include/Pipeline.h (original)
+++ llvm/trunk/tools/llvm-mca/include/Pipeline.h Wed Nov 28 08:39:48 2018
@@ -67,10 +67,7 @@ class Pipeline {
public:
Pipeline() : Cycles(0) {}
void appendStage(std::unique_ptr<Stage> S);
-
- /// Returns the total number of simulated cycles.
- Expected<unsigned> run();
-
+ Error run();
void addEventListener(HWEventListener *Listener);
};
} // namespace mca
Modified: llvm/trunk/tools/llvm-mca/lib/Pipeline.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/lib/Pipeline.cpp?rev=347775&r1=347774&r2=347775&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/lib/Pipeline.cpp (original)
+++ llvm/trunk/tools/llvm-mca/lib/Pipeline.cpp Wed Nov 28 08:39:48 2018
@@ -35,7 +35,7 @@ bool Pipeline::hasWorkToProcess() {
});
}
-Expected<unsigned> Pipeline::run() {
+Error Pipeline::run() {
assert(!Stages.empty() && "Unexpected empty pipeline found!");
do {
@@ -46,7 +46,7 @@ Expected<unsigned> Pipeline::run() {
++Cycles;
} while (hasWorkToProcess());
- return Cycles;
+ return ErrorSuccess();
}
Error Pipeline::runCycle() {
Modified: llvm/trunk/tools/llvm-mca/llvm-mca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/llvm-mca.cpp?rev=347775&r1=347774&r2=347775&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/llvm-mca.cpp (original)
+++ llvm/trunk/tools/llvm-mca/llvm-mca.cpp Wed Nov 28 08:39:48 2018
@@ -240,9 +240,8 @@ static void processViewOptions() {
// Returns true on success.
static bool runPipeline(mca::Pipeline &P) {
// Handle pipeline errors here.
- Expected<unsigned> Cycles = P.run();
- if (!Cycles) {
- WithColor::error() << toString(Cycles.takeError());
+ if (auto Err = P.run()) {
+ WithColor::error() << toString(std::move(Err));
return false;
}
return true;
More information about the llvm-commits
mailing list