Revert r158679 - use case is unclear (and it increases the memory footprint).
authorHal Finkel <hfinkel@anl.gov>
Fri, 22 Jun 2012 20:27:13 +0000 (20:27 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 22 Jun 2012 20:27:13 +0000 (20:27 +0000)
Original commit message:
    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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159027 91177308-0d34-0410-b5e6-96231b3b80d8

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

index d9a48b6328a9c8fec633aa5184d9dacaef49fc6d..2d2db78144a453f6972c9333700268da30fdb8e3 100644 (file)
@@ -42,7 +42,7 @@ class SUnit;
 
 class DFAPacketizer {
 private:
-  typedef std::pair<unsigned, uint64_t> UnsignPair;
+  typedef std::pair<unsigned, unsigned> UnsignPair;
   const InstrItineraryData *InstrItins;
   int CurrentState;
   const int (*DFAStateInputTable)[2];
index c741e1ba241d873384b138b69b53f9d791e77642..060e89a3fdc79d42414cba1f37ee69f35338bbec 100644 (file)
@@ -39,7 +39,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
   // bottom-up scheduler, then the scoreboard cycles are the inverse of the
   // scheduler's cycles.
   class Scoreboard {
-    uint64_t *Data;
+    unsigned *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 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
     }
 
     size_t getDepth() const { return Depth; }
-    uint64_t& operator[](size_t idx) const {
+    unsigned& 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 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
     void reset(size_t d = 1) {
       if (Data == NULL) {
         Depth = d;
-        Data = new uint64_t[Depth];
+        Data = new unsigned[Depth];
       }
 
       memset(Data, 0, Depth * sizeof(Data[0]));
index e6178a2d6120a753da81a66b83f43e305d1bdafc..05baddd918adf9ff18460b33ed049ad5621ea1ac 100644 (file)
@@ -62,7 +62,7 @@ struct InstrStage {
   };
 
   unsigned Cycles_;  ///< Length of stage in machine cycles
-  uint64_t Units_;   ///< Choice of functional units
+  unsigned 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 @@ struct InstrStage {
   }
 
   /// getUnits - returns the choice of FUs
-  uint64_t getUnits() const {
+  unsigned getUnits() const {
     return Units_;
   }
 
index d4775775c0562f44a98745ef49eef71d5cf98e33..ff2f11353afd04b4a770800490c3fc5c13600678 100644 (file)
@@ -66,7 +66,7 @@ void DFAPacketizer::ReadTable(unsigned int state) {
 bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
   unsigned InsnClass = MID->getSchedClass();
   const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
-  uint64_t FuncUnits = IS->getUnits();
+  unsigned FuncUnits = IS->getUnits();
   UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
   ReadTable(CurrentState);
   return (CachedTable.count(StateTrans) != 0);
@@ -78,7 +78,7 @@ bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
 void DFAPacketizer::reserveResources(const llvm::MCInstrDesc *MID) {
   unsigned InsnClass = MID->getSchedClass();
   const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
-  uint64_t FuncUnits = IS->getUnits();
+  unsigned FuncUnits = IS->getUnits();
   UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
   ReadTable(CurrentState);
   assert(CachedTable.count(StateTrans) != 0);
index ed5e4a3fec2f27605921f9515bddf9dd65db02a2..7110b7566aba0e32c3e6afd81f7e444cf79e4ad5 100644 (file)
@@ -95,10 +95,10 @@ void ScoreboardHazardRecognizer::Scoreboard::dump() const {
     last--;
 
   for (unsigned i = 0; i <= last; i++) {
-    uint64_t FUs = (*this)[i];
+    unsigned FUs = (*this)[i];
     dbgs() << "\t";
-    for (int j = 63; j >= 0; j--)
-      dbgs() << ((FUs & (1ULL << j)) ? '1' : '0');
+    for (int j = 31; j >= 0; j--)
+      dbgs() << ((FUs & (1 << j)) ? '1' : '0');
     dbgs() << '\n';
   }
 }
@@ -144,7 +144,7 @@ ScoreboardHazardRecognizer::getHazardType(SUnit *SU, int Stalls) {
         break;
       }
 
-      uint64_t freeUnits = IS->getUnits();
+      unsigned freeUnits = IS->getUnits();
       switch (IS->getReservationKind()) {
       case InstrStage::Required:
         // Required FUs conflict with both reserved and required ones
@@ -196,7 +196,7 @@ void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
       assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
              "Scoreboard depth exceeded!");
 
-      uint64_t freeUnits = IS->getUnits();
+      unsigned freeUnits = IS->getUnits();
       switch (IS->getReservationKind()) {
       case InstrStage::Required:
         // Required FUs conflict with both reserved and required ones
@@ -209,7 +209,7 @@ void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
       }
 
       // reduce to a single unit
-      uint64_t freeUnit = 0;
+      unsigned freeUnit = 0;
       do {
         freeUnit = freeUnits;
         freeUnits = freeUnit & (freeUnit - 1);
index 150959777d0a6c45f8de8514717b61af63bf561d..7c58041e3b8471b4d509560c77161f265c049373 100644 (file)
@@ -138,7 +138,7 @@ SPUNopFiller::SPUOpPlace
 SPUNopFiller::getOpPlacement( MachineInstr &instr ) {
   int sc = instr.getDesc().getSchedClass();
   const InstrStage *stage = IID->beginStage(sc);
-  uint64_t FUs = stage->getUnits();
+  unsigned FUs = stage->getUnits();
   SPUOpPlace retval;
 
   switch( FUs ) {
index 7f1658d37dcccbe3e587984d119d5c438f6e81d9..a03ed03365ba64e33cc39c535d2d205d1a206852 100644 (file)
@@ -3183,7 +3183,7 @@ bool HexagonPacketizerList::ignorePseudoInstruction(MachineInstr *MI,
   unsigned SchedClass = TID.getSchedClass();
   const InstrStage* IS =
                     ResourceTracker->getInstrItins()->beginStage(SchedClass);
-  uint64_t FuncUnits = IS->getUnits();
+  unsigned FuncUnits = IS->getUnits();
   return !FuncUnits;
 }
 
index 19b0550b994ffc7efaaeec26820e521fa61e796e..59464d294056dcbc1fd3a87d21cd1735fc6a8d86 100644 (file)
@@ -379,8 +379,8 @@ void SubtargetEmitter::EmitStageAndOperandCycleData(raw_ostream &OS,
        << "namespace " << Name << "FU {\n";
 
     for (unsigned j = 0, FUN = FUs.size(); j < FUN; ++j)
-      OS << "  const uint64_t " << FUs[j]->getName()
-         << " = 1ULL << " << j << ";\n";
+      OS << "  const unsigned " << FUs[j]->getName()
+         << " = 1 << " << j << ";\n";
 
     OS << "}\n";