[llvm-commits] [llvm] r108419 - in /llvm/trunk/lib/CodeGen: AggressiveAntiDepBreaker.cpp AggressiveAntiDepBreaker.h CriticalAntiDepBreaker.cpp CriticalAntiDepBreaker.h

Chris Lattner sabre at nondot.org
Wed Jul 14 23:51:46 PDT 2010


Author: lattner
Date: Thu Jul 15 01:51:46 2010
New Revision: 108419

URL: http://llvm.org/viewvc/llvm-project?rev=108419&view=rev
Log:
revert bill's patches in an attempt to fix the buildbot.

Modified:
    llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp
    llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h
    llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.cpp
    llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.h

Modified: llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp?rev=108419&r1=108418&r2=108419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp (original)
+++ llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp Thu Jul 15 01:51:46 2010
@@ -42,8 +42,6 @@
 AggressiveAntiDepState::AggressiveAntiDepState(const unsigned TargetRegs,
                                                MachineBasicBlock *BB) :
   NumTargetRegs(TargetRegs), GroupNodes(TargetRegs, 0) {
-  KillIndices.reserve(TargetRegs);
-  DefIndices.reserve(TargetRegs);
 
   const unsigned BBSize = BB->size();
   for (unsigned i = 0; i < NumTargetRegs; ++i) {
@@ -147,8 +145,8 @@
   State = new AggressiveAntiDepState(TRI->getNumRegs(), BB);
 
   bool IsReturnBlock = (!BB->empty() && BB->back().getDesc().isReturn());
-  std::vector<unsigned> &KillIndices = State->GetKillIndices();
-  std::vector<unsigned> &DefIndices = State->GetDefIndices();
+  unsigned *KillIndices = State->GetKillIndices();
+  unsigned *DefIndices = State->GetDefIndices();
 
   // Determine the live-out physregs for this block.
   if (IsReturnBlock) {
@@ -228,7 +226,7 @@
   DEBUG(MI->dump());
   DEBUG(dbgs() << "\tRegs:");
 
-  std::vector<unsigned> &DefIndices = State->GetDefIndices();
+  unsigned *DefIndices = State->GetDefIndices();
   for (unsigned Reg = 0; Reg != TRI->getNumRegs(); ++Reg) {
     // If Reg is current live, then mark that it can't be renamed as
     // we don't know the extent of its live-range anymore (now that it
@@ -330,8 +328,8 @@
                                              const char *tag,
                                              const char *header,
                                              const char *footer) {
-  std::vector<unsigned> &KillIndices = State->GetKillIndices();
-  std::vector<unsigned> &DefIndices = State->GetDefIndices();
+  unsigned *KillIndices = State->GetKillIndices();
+  unsigned *DefIndices = State->GetDefIndices();
   std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
     RegRefs = State->GetRegRefs();
 
@@ -366,7 +364,7 @@
 void AggressiveAntiDepBreaker::PrescanInstruction(MachineInstr *MI,
                                                   unsigned Count,
                                              std::set<unsigned>& PassthruRegs) {
-  std::vector<unsigned> &DefIndices = State->GetDefIndices();
+  unsigned *DefIndices = State->GetDefIndices();
   std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
     RegRefs = State->GetRegRefs();
 
@@ -562,8 +560,8 @@
                                 unsigned AntiDepGroupIndex,
                                 RenameOrderType& RenameOrder,
                                 std::map<unsigned, unsigned> &RenameMap) {
-  std::vector<unsigned> &KillIndices = State->GetKillIndices();
-  std::vector<unsigned> &DefIndices = State->GetDefIndices();
+  unsigned *KillIndices = State->GetKillIndices();
+  unsigned *DefIndices = State->GetDefIndices();
   std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
     RegRefs = State->GetRegRefs();
 
@@ -735,8 +733,8 @@
                               MachineBasicBlock::iterator Begin,
                               MachineBasicBlock::iterator End,
                               unsigned InsertPosIndex) {
-  std::vector<unsigned> &KillIndices = State->GetKillIndices();
-  std::vector<unsigned> &DefIndices = State->GetDefIndices();
+  unsigned *KillIndices = State->GetKillIndices();
+  unsigned *DefIndices = State->GetDefIndices();
   std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
     RegRefs = State->GetRegRefs();
 

Modified: llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h?rev=108419&r1=108418&r2=108419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h (original)
+++ llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.h Thu Jul 15 01:51:46 2010
@@ -24,13 +24,12 @@
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/ScheduleDAG.h"
 #include "llvm/Target/TargetSubtarget.h"
+#include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/SmallSet.h"
 #include <map>
-#include <vector>
 
 namespace llvm {
-  class TargetRegisterInfo;
   /// Class AggressiveAntiDepState
   /// Contains all the state necessary for anti-dep breaking.
   class AggressiveAntiDepState {
@@ -60,27 +59,27 @@
     /// currently representing the group that the register belongs to.
     /// Register 0 is always represented by the 0 group, a group
     /// composed of registers that are not eligible for anti-aliasing.
-    std::vector<unsigned> GroupNodeIndices;
+    unsigned GroupNodeIndices[TargetRegisterInfo::FirstVirtualRegister];
 
     /// RegRefs - Map registers to all their references within a live range.
     std::multimap<unsigned, RegisterReference> RegRefs;
 
     /// KillIndices - The index of the most recent kill (proceding bottom-up),
     /// or ~0u if the register is not live.
-    std::vector<unsigned> KillIndices;
+    unsigned KillIndices[TargetRegisterInfo::FirstVirtualRegister];
 
     /// DefIndices - The index of the most recent complete def (proceding bottom
     /// up), or ~0u if the register is live.
-    std::vector<unsigned> DefIndices;
+    unsigned DefIndices[TargetRegisterInfo::FirstVirtualRegister];
 
   public:
     AggressiveAntiDepState(const unsigned TargetRegs, MachineBasicBlock *BB);
 
     /// GetKillIndices - Return the kill indices.
-    std::vector<unsigned> &GetKillIndices() { return KillIndices; }
+    unsigned *GetKillIndices() { return KillIndices; }
 
     /// GetDefIndices - Return the define indices.
-    std::vector<unsigned> &GetDefIndices() { return DefIndices; }
+    unsigned *GetDefIndices() { return DefIndices; }
 
     /// GetRegRefs - Return the RegRefs map.
     std::multimap<unsigned, RegisterReference>& GetRegRefs() { return RegRefs; }

Modified: llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.cpp?rev=108419&r1=108418&r2=108419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.cpp (original)
+++ llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.cpp Thu Jul 15 01:51:46 2010
@@ -34,9 +34,6 @@
   TRI(MF.getTarget().getRegisterInfo()),
   AllocatableSet(TRI->getAllocatableSet(MF))
 {
-  Classes.reserve(TRI->getNumRegs());
-  KillIndices.reserve(TRI->getNumRegs());
-  DefIndices.reserve(TRI->getNumRegs());
 }
 
 CriticalAntiDepBreaker::~CriticalAntiDepBreaker() {
@@ -44,7 +41,8 @@
 
 void CriticalAntiDepBreaker::StartBlock(MachineBasicBlock *BB) {
   // Clear out the register class data.
-  Classes.clear();
+  std::fill(Classes, array_endof(Classes),
+            static_cast<const TargetRegisterClass *>(0));
 
   // Initialize the indices to indicate that no registers are live.
   const unsigned BBSize = BB->size();

Modified: llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.h?rev=108419&r1=108418&r2=108419&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.h (original)
+++ llvm/trunk/lib/CodeGen/CriticalAntiDepBreaker.h Thu Jul 15 01:51:46 2010
@@ -25,7 +25,6 @@
 #include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/SmallSet.h"
 #include <map>
-#include <vector>
 
 namespace llvm {
 class TargetInstrInfo;
@@ -47,18 +46,19 @@
     /// corresponding value is null. If the register is live but used in
     /// multiple register classes, the corresponding value is -1 casted to a
     /// pointer.
-    std::vector<const TargetRegisterClass *> Classes;
+    const TargetRegisterClass *
+      Classes[TargetRegisterInfo::FirstVirtualRegister];
 
     /// RegRegs - Map registers to all their references within a live range.
     std::multimap<unsigned, MachineOperand *> RegRefs;
 
     /// KillIndices - The index of the most recent kill (proceding bottom-up),
     /// or ~0u if the register is not live.
-    std::vector<unsigned> KillIndices;
+    unsigned KillIndices[TargetRegisterInfo::FirstVirtualRegister];
 
     /// DefIndices - The index of the most recent complete def (proceding bottom
     /// up), or ~0u if the register is live.
-    std::vector<unsigned> DefIndices;
+    unsigned DefIndices[TargetRegisterInfo::FirstVirtualRegister];
 
     /// KeepRegs - A set of registers which are live and cannot be changed to
     /// break anti-dependencies.





More information about the llvm-commits mailing list