[llvm-commits] [llvm] r158679 - in /llvm/trunk: include/llvm/CodeGen/DFAPacketizer.h include/llvm/CodeGen/ScoreboardHazardRecognizer.h include/llvm/MC/MCInstrItineraries.h lib/CodeGen/DFAPacketizer.cpp lib/CodeGen/ScoreboardHazardRecognizer.cpp lib/Target/CellSPU/SPUNopFiller.cpp lib/Target/Hexagon/HexagonVLIWPacketizer.cpp utils/TableGen/SubtargetEmitter.cpp

Hal Finkel hfinkel at anl.gov
Mon Jun 18 14:08:19 PDT 2012


Author: hfinkel
Date: Mon Jun 18 16:08:18 2012
New Revision: 158679

URL: http://llvm.org/viewvc/llvm-project?rev=158679&view=rev
Log:
Allow up to 64 functional units per processor itinerary.

This patch changes the type used to hold the FU bitset from unsigned to uint64_t.
This will be needed for some upcoming PowerPC itineraries.

Modified:
    llvm/trunk/include/llvm/CodeGen/DFAPacketizer.h
    llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
    llvm/trunk/include/llvm/MC/MCInstrItineraries.h
    llvm/trunk/lib/CodeGen/DFAPacketizer.cpp
    llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp
    llvm/trunk/lib/Target/CellSPU/SPUNopFiller.cpp
    llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
    llvm/trunk/utils/TableGen/SubtargetEmitter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/DFAPacketizer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DFAPacketizer.h?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/DFAPacketizer.h (original)
+++ llvm/trunk/include/llvm/CodeGen/DFAPacketizer.h Mon Jun 18 16:08:18 2012
@@ -42,7 +42,7 @@
 
 class DFAPacketizer {
 private:
-  typedef std::pair<unsigned, unsigned> UnsignPair;
+  typedef std::pair<unsigned, uint64_t> UnsignPair;
   const InstrItineraryData *InstrItins;
   int CurrentState;
   const int (*DFAStateInputTable)[2];

Modified: llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h Mon Jun 18 16:08:18 2012
@@ -39,7 +39,7 @@
   // bottom-up scheduler, then the scoreboard cycles are the inverse of the
   // scheduler's cycles.
   class Scoreboard {
-    unsigned *Data;
+    uint64_t *Data;
 
     // The maximum number of cycles monitored by the Scoreboard. This
     // value is determined based on the target itineraries to ensure
@@ -54,7 +54,7 @@
     }
 
     size_t getDepth() const { return Depth; }
-    unsigned& operator[](size_t idx) const {
+    uint64_t& operator[](size_t idx) const {
       // Depth is expected to be a power-of-2.
       assert(Depth && !(Depth & (Depth - 1)) &&
              "Scoreboard was not initialized properly!");
@@ -65,7 +65,7 @@
     void reset(size_t d = 1) {
       if (Data == NULL) {
         Depth = d;
-        Data = new unsigned[Depth];
+        Data = new uint64_t[Depth];
       }
 
       memset(Data, 0, Depth * sizeof(Data[0]));

Modified: llvm/trunk/include/llvm/MC/MCInstrItineraries.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCInstrItineraries.h?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCInstrItineraries.h (original)
+++ llvm/trunk/include/llvm/MC/MCInstrItineraries.h Mon Jun 18 16:08:18 2012
@@ -62,7 +62,7 @@
   };
 
   unsigned Cycles_;  ///< Length of stage in machine cycles
-  unsigned Units_;   ///< Choice of functional units
+  uint64_t Units_;   ///< Choice of functional units
   int NextCycles_;   ///< Number of machine cycles to next stage
   ReservationKinds Kind_; ///< Kind of the FU reservation
 
@@ -72,7 +72,7 @@
   }
 
   /// getUnits - returns the choice of FUs
-  unsigned getUnits() const {
+  uint64_t getUnits() const {
     return Units_;
   }
 

Modified: llvm/trunk/lib/CodeGen/DFAPacketizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DFAPacketizer.cpp?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DFAPacketizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/DFAPacketizer.cpp Mon Jun 18 16:08:18 2012
@@ -66,7 +66,7 @@
 bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
   unsigned InsnClass = MID->getSchedClass();
   const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
-  unsigned FuncUnits = IS->getUnits();
+  uint64_t FuncUnits = IS->getUnits();
   UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
   ReadTable(CurrentState);
   return (CachedTable.count(StateTrans) != 0);
@@ -78,7 +78,7 @@
 void DFAPacketizer::reserveResources(const llvm::MCInstrDesc *MID) {
   unsigned InsnClass = MID->getSchedClass();
   const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
-  unsigned FuncUnits = IS->getUnits();
+  uint64_t FuncUnits = IS->getUnits();
   UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
   ReadTable(CurrentState);
   assert(CachedTable.count(StateTrans) != 0);

Modified: llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp Mon Jun 18 16:08:18 2012
@@ -95,9 +95,9 @@
     last--;
 
   for (unsigned i = 0; i <= last; i++) {
-    unsigned FUs = (*this)[i];
+    uint64_t FUs = (*this)[i];
     dbgs() << "\t";
-    for (int j = 31; j >= 0; j--)
+    for (int j = 63; j >= 0; j--)
       dbgs() << ((FUs & (1 << j)) ? '1' : '0');
     dbgs() << '\n';
   }
@@ -144,7 +144,7 @@
         break;
       }
 
-      unsigned freeUnits = IS->getUnits();
+      uint64_t freeUnits = IS->getUnits();
       switch (IS->getReservationKind()) {
       case InstrStage::Required:
         // Required FUs conflict with both reserved and required ones
@@ -196,7 +196,7 @@
       assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
              "Scoreboard depth exceeded!");
 
-      unsigned freeUnits = IS->getUnits();
+      uint64_t freeUnits = IS->getUnits();
       switch (IS->getReservationKind()) {
       case InstrStage::Required:
         // Required FUs conflict with both reserved and required ones
@@ -209,7 +209,7 @@
       }
 
       // reduce to a single unit
-      unsigned freeUnit = 0;
+      uint64_t freeUnit = 0;
       do {
         freeUnit = freeUnits;
         freeUnits = freeUnit & (freeUnit - 1);

Modified: llvm/trunk/lib/Target/CellSPU/SPUNopFiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUNopFiller.cpp?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUNopFiller.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUNopFiller.cpp Mon Jun 18 16:08:18 2012
@@ -138,7 +138,7 @@
 SPUNopFiller::getOpPlacement( MachineInstr &instr ) {
   int sc = instr.getDesc().getSchedClass();
   const InstrStage *stage = IID->beginStage(sc);
-  unsigned FUs = stage->getUnits();
+  uint64_t FUs = stage->getUnits();
   SPUOpPlace retval;
 
   switch( FUs ) {

Modified: llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp Mon Jun 18 16:08:18 2012
@@ -3183,7 +3183,7 @@
   unsigned SchedClass = TID.getSchedClass();
   const InstrStage* IS =
                     ResourceTracker->getInstrItins()->beginStage(SchedClass);
-  unsigned FuncUnits = IS->getUnits();
+  uint64_t FuncUnits = IS->getUnits();
   return !FuncUnits;
 }
 

Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=158679&r1=158678&r2=158679&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Mon Jun 18 16:08:18 2012
@@ -379,8 +379,8 @@
        << "namespace " << Name << "FU {\n";
 
     for (unsigned j = 0, FUN = FUs.size(); j < FUN; ++j)
-      OS << "  const unsigned " << FUs[j]->getName()
-         << " = 1 << " << j << ";\n";
+      OS << "  const uint64_t " << FUs[j]->getName()
+         << " = 1ULL << " << j << ";\n";
 
     OS << "}\n";
 





More information about the llvm-commits mailing list