[llvm-mca] Add the RetireStage. 

Summary:
This class maintains the same logic as the original RetireControlUnit.

This is just an intermediate patch to make the RCU a Stage.  Future patches will remove the dependency on the DispatchStage, and then more properly populate the pre/execute/post Stage interface.  

Reviewers: andreadb, RKSimon, courbet

Reviewed By: andreadb, courbet

Subscribers: javed.absar, mgorny, tschuett, gbedwell, llvm-commits

Differential Revision: https://reviews.llvm.org/D47244

llvm-svn: 333292
diff --git a/llvm/tools/llvm-mca/Backend.cpp b/llvm/tools/llvm-mca/Backend.cpp
index 9077b6e..dc2b1de 100644
--- a/llvm/tools/llvm-mca/Backend.cpp
+++ b/llvm/tools/llvm-mca/Backend.cpp
@@ -37,10 +37,15 @@
 void Backend::runCycle(unsigned Cycle) {
   notifyCycleBegin(Cycle);
 
+  // Update the stages before we do any processing for this cycle.
   InstRef IR;
+  Retire->preExecute(IR);
   Dispatch->preExecute(IR);
+
+  // This will execute scheduled instructions.
   HWS->cycleEvent(); // TODO: This will eventually be stage-ified.
 
+  // Fetch instructions and dispatch them to the hardware.
   while (Fetch->execute(IR)) {
     if (!Dispatch->execute(IR))
       break;