Revert [llvm-mca] Return the total number of cycles from method Pipeline::run().

This reverts commits 347767.

llvm-svn: 347775
diff --git a/llvm/tools/llvm-mca/include/Pipeline.h b/llvm/tools/llvm-mca/include/Pipeline.h
index 0fd4026..47ff07b 100644
--- a/llvm/tools/llvm-mca/include/Pipeline.h
+++ b/llvm/tools/llvm-mca/include/Pipeline.h
@@ -67,10 +67,7 @@
 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
diff --git a/llvm/tools/llvm-mca/lib/Pipeline.cpp b/llvm/tools/llvm-mca/lib/Pipeline.cpp
index 0f91060..309f415 100644
--- a/llvm/tools/llvm-mca/lib/Pipeline.cpp
+++ b/llvm/tools/llvm-mca/lib/Pipeline.cpp
@@ -35,7 +35,7 @@
   });
 }
 
-Expected<unsigned> Pipeline::run() {
+Error Pipeline::run() {
   assert(!Stages.empty() && "Unexpected empty pipeline found!");
 
   do {
@@ -46,7 +46,7 @@
     ++Cycles;
   } while (hasWorkToProcess());
 
-  return Cycles;
+  return ErrorSuccess();
 }
 
 Error Pipeline::runCycle() {
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index 9858896..8b792be 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -240,9 +240,8 @@
 // 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;