[llvm] r328094 - [llvm-mca] Clean up some code. NFC

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 05:49:07 PDT 2018


Author: adibiagio
Date: Wed Mar 21 05:49:07 2018
New Revision: 328094

URL: http://llvm.org/viewvc/llvm-project?rev=328094&view=rev
Log:
[llvm-mca] Clean up some code. NFC

Removed a couple of methods from DispatchUnit.

Modified:
    llvm/trunk/tools/llvm-mca/Dispatch.cpp
    llvm/trunk/tools/llvm-mca/Dispatch.h

Modified: llvm/trunk/tools/llvm-mca/Dispatch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/Dispatch.cpp?rev=328094&r1=328093&r2=328094&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/Dispatch.cpp (original)
+++ llvm/trunk/tools/llvm-mca/Dispatch.cpp Wed Mar 21 05:49:07 2018
@@ -119,17 +119,6 @@ void RegisterFile::invalidateRegisterMap
       RegisterMappings[*I].first = nullptr;
 }
 
-// Update the number of used mappings in the event of instruction retired.
-// This mehod delegates to the register file the task of invalidating
-// register mappings that were created for instruction IS.
-void DispatchUnit::invalidateRegisterMappings(const Instruction &IS) {
-  for (const std::unique_ptr<WriteState> &WS : IS.getDefs()) {
-    DEBUG(dbgs() << "[RAT] Invalidating mapping for: ");
-    DEBUG(WS->dump());
-    RAT->invalidateRegisterMapping(*WS.get());
-  }
-}
-
 void RegisterFile::collectWrites(SmallVectorImpl<WriteState *> &Writes,
                                  unsigned RegID) const {
   assert(RegID && RegID < RegisterMappings.size());
@@ -243,7 +232,9 @@ void DispatchUnit::notifyInstructionReti
       HWInstructionEvent(HWInstructionEvent::Retired, Index));
 
   const Instruction &IS = Owner->getInstruction(Index);
-  invalidateRegisterMappings(IS);
+  for (const std::unique_ptr<WriteState> &WS : IS.getDefs())
+    RAT->invalidateRegisterMapping(*WS.get());
+
   Owner->eraseInstruction(Index);
 }
 
@@ -374,7 +365,7 @@ unsigned DispatchUnit::dispatch(unsigned
 
   // Allocate new mappings.
   for (std::unique_ptr<WriteState> &WS : NewInst->getDefs())
-    addNewRegisterMapping(*WS);
+    RAT->addRegisterMapping(*WS);
 
   // Set the cycles left before the write-back stage.
   const InstrDesc &D = NewInst->getDesc();

Modified: llvm/trunk/tools/llvm-mca/Dispatch.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/Dispatch.h?rev=328094&r1=328093&r2=328094&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/Dispatch.h (original)
+++ llvm/trunk/tools/llvm-mca/Dispatch.h Wed Mar 21 05:49:07 2018
@@ -302,7 +302,6 @@ public:
   unsigned getTotalRegisterMappingsCreated(unsigned RegFileIndex = 0) const {
     return RAT->getTotalRegisterMappingsCreated(RegFileIndex);
   }
-  void addNewRegisterMapping(WriteState &WS) { RAT->addRegisterMapping(WS); }
 
   void cycleEvent(unsigned Cycle) {
     RCU->cycleEvent();
@@ -319,7 +318,6 @@ public:
     RCU->onInstructionExecuted(TokenID);
   }
 
-  void invalidateRegisterMappings(const Instruction &Inst);
 #ifndef NDEBUG
   void dump() const;
 #endif




More information about the llvm-commits mailing list