From 7fa889b946266f5cf3f386acf2487aed244e5d10 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 15 Jul 2010 06:51:46 +0000 Subject: [PATCH] revert bill's patches in an attempt to fix the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108419 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AggressiveAntiDepBreaker.cpp | 22 ++++++++++------------ lib/CodeGen/AggressiveAntiDepBreaker.h | 13 ++++++------- lib/CodeGen/CriticalAntiDepBreaker.cpp | 6 ++---- lib/CodeGen/CriticalAntiDepBreaker.h | 8 ++++---- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/lib/CodeGen/AggressiveAntiDepBreaker.cpp index 78b600e1b74..a7189acc3fe 100644 --- a/lib/CodeGen/AggressiveAntiDepBreaker.cpp +++ b/lib/CodeGen/AggressiveAntiDepBreaker.cpp @@ -42,8 +42,6 @@ DebugMod("agg-antidep-debugmod", 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 @@ void AggressiveAntiDepBreaker::StartBlock(MachineBasicBlock *BB) { State = new AggressiveAntiDepState(TRI->getNumRegs(), BB); bool IsReturnBlock = (!BB->empty() && BB->back().getDesc().isReturn()); - std::vector &KillIndices = State->GetKillIndices(); - std::vector &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 @@ void AggressiveAntiDepBreaker::Observe(MachineInstr *MI, unsigned Count, DEBUG(MI->dump()); DEBUG(dbgs() << "\tRegs:"); - std::vector &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 @@ void AggressiveAntiDepBreaker::HandleLastUse(unsigned Reg, unsigned KillIdx, const char *tag, const char *header, const char *footer) { - std::vector &KillIndices = State->GetKillIndices(); - std::vector &DefIndices = State->GetDefIndices(); + unsigned *KillIndices = State->GetKillIndices(); + unsigned *DefIndices = State->GetDefIndices(); std::multimap& RegRefs = State->GetRegRefs(); @@ -366,7 +364,7 @@ void AggressiveAntiDepBreaker::HandleLastUse(unsigned Reg, unsigned KillIdx, void AggressiveAntiDepBreaker::PrescanInstruction(MachineInstr *MI, unsigned Count, std::set& PassthruRegs) { - std::vector &DefIndices = State->GetDefIndices(); + unsigned *DefIndices = State->GetDefIndices(); std::multimap& RegRefs = State->GetRegRefs(); @@ -562,8 +560,8 @@ bool AggressiveAntiDepBreaker::FindSuitableFreeRegisters( unsigned AntiDepGroupIndex, RenameOrderType& RenameOrder, std::map &RenameMap) { - std::vector &KillIndices = State->GetKillIndices(); - std::vector &DefIndices = State->GetDefIndices(); + unsigned *KillIndices = State->GetKillIndices(); + unsigned *DefIndices = State->GetDefIndices(); std::multimap& RegRefs = State->GetRegRefs(); @@ -735,8 +733,8 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies( MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned InsertPosIndex) { - std::vector &KillIndices = State->GetKillIndices(); - std::vector &DefIndices = State->GetDefIndices(); + unsigned *KillIndices = State->GetKillIndices(); + unsigned *DefIndices = State->GetDefIndices(); std::multimap& RegRefs = State->GetRegRefs(); diff --git a/lib/CodeGen/AggressiveAntiDepBreaker.h b/lib/CodeGen/AggressiveAntiDepBreaker.h index d9365a5120b..91ebb850d19 100644 --- a/lib/CodeGen/AggressiveAntiDepBreaker.h +++ b/lib/CodeGen/AggressiveAntiDepBreaker.h @@ -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 -#include namespace llvm { - class TargetRegisterInfo; /// Class AggressiveAntiDepState /// Contains all the state necessary for anti-dep breaking. class AggressiveAntiDepState { @@ -60,27 +59,27 @@ namespace llvm { /// 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 GroupNodeIndices; + unsigned GroupNodeIndices[TargetRegisterInfo::FirstVirtualRegister]; /// RegRefs - Map registers to all their references within a live range. std::multimap RegRefs; /// KillIndices - The index of the most recent kill (proceding bottom-up), /// or ~0u if the register is not live. - std::vector 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 DefIndices; + unsigned DefIndices[TargetRegisterInfo::FirstVirtualRegister]; public: AggressiveAntiDepState(const unsigned TargetRegs, MachineBasicBlock *BB); /// GetKillIndices - Return the kill indices. - std::vector &GetKillIndices() { return KillIndices; } + unsigned *GetKillIndices() { return KillIndices; } /// GetDefIndices - Return the define indices. - std::vector &GetDefIndices() { return DefIndices; } + unsigned *GetDefIndices() { return DefIndices; } /// GetRegRefs - Return the RegRefs map. std::multimap& GetRegRefs() { return RegRefs; } diff --git a/lib/CodeGen/CriticalAntiDepBreaker.cpp b/lib/CodeGen/CriticalAntiDepBreaker.cpp index 9d486651ce0..e3746a98564 100644 --- a/lib/CodeGen/CriticalAntiDepBreaker.cpp +++ b/lib/CodeGen/CriticalAntiDepBreaker.cpp @@ -34,9 +34,6 @@ CriticalAntiDepBreaker(MachineFunction& MFi) : 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 @@ CriticalAntiDepBreaker::~CriticalAntiDepBreaker() { void CriticalAntiDepBreaker::StartBlock(MachineBasicBlock *BB) { // Clear out the register class data. - Classes.clear(); + std::fill(Classes, array_endof(Classes), + static_cast(0)); // Initialize the indices to indicate that no registers are live. const unsigned BBSize = BB->size(); diff --git a/lib/CodeGen/CriticalAntiDepBreaker.h b/lib/CodeGen/CriticalAntiDepBreaker.h index 62ef72ace11..540630083bc 100644 --- a/lib/CodeGen/CriticalAntiDepBreaker.h +++ b/lib/CodeGen/CriticalAntiDepBreaker.h @@ -25,7 +25,6 @@ #include "llvm/ADT/BitVector.h" #include "llvm/ADT/SmallSet.h" #include -#include namespace llvm { class TargetInstrInfo; @@ -47,18 +46,19 @@ class TargetRegisterInfo; /// 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 Classes; + const TargetRegisterClass * + Classes[TargetRegisterInfo::FirstVirtualRegister]; /// RegRegs - Map registers to all their references within a live range. std::multimap RegRefs; /// KillIndices - The index of the most recent kill (proceding bottom-up), /// or ~0u if the register is not live. - std::vector 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 DefIndices; + unsigned DefIndices[TargetRegisterInfo::FirstVirtualRegister]; /// KeepRegs - A set of registers which are live and cannot be changed to /// break anti-dependencies.