From: Owen Anderson Date: Wed, 13 Aug 2008 22:28:50 +0000 (+0000) Subject: Expunge the last uses of std::map from LiveIntervals. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=289983123ba4170c8a27e9638935818f8142bc89;p=oota-llvm.git Expunge the last uses of std::map from LiveIntervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54766 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index e12bab18b71..a94840e8962 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -28,7 +28,6 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" #include -#include namespace llvm { @@ -434,10 +433,10 @@ namespace llvm { bool alsoFoldARestore(int Id, int index, unsigned vr, BitVector &RestoreMBBs, - std::map >&RestoreIdxes); + DenseMap >&RestoreIdxes); void eraseRestoreInfo(int Id, int index, unsigned vr, BitVector &RestoreMBBs, - std::map >&RestoreIdxes); + DenseMap >&RestoreIdxes); /// handleSpilledImpDefs - Remove IMPLICIT_DEF instructions which are being /// spilled and create empty intervals for their uses. @@ -460,7 +459,7 @@ namespace llvm { VirtRegMap &vrm, const TargetRegisterClass* rc, SmallVector &ReMatIds, const MachineLoopInfo *loopInfo, unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse, - std::map &MBBVRegsMap, + DenseMap &MBBVRegsMap, std::vector &NewLIs, float &SSWeight); void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, LiveInterval::Ranges::const_iterator &I, @@ -469,10 +468,10 @@ namespace llvm { VirtRegMap &vrm, const TargetRegisterClass* rc, SmallVector &ReMatIds, const MachineLoopInfo *loopInfo, BitVector &SpillMBBs, - std::map > &SpillIdxes, + DenseMap > &SpillIdxes, BitVector &RestoreMBBs, - std::map > &RestoreIdxes, - std::map &MBBVRegsMap, + DenseMap > &RestoreIdxes, + DenseMap &MBBVRegsMap, std::vector &NewLIs, float &SSWeight); static LiveInterval* createInterval(unsigned Reg); diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 742ef5c2df9..d027a81e844 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1091,7 +1091,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI, SmallVector &ReMatIds, const MachineLoopInfo *loopInfo, unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse, - std::map &MBBVRegsMap, + DenseMap &MBBVRegsMap, std::vector &NewLIs, float &SSWeight) { MachineBasicBlock *MBB = MI->getParent(); unsigned loopDepth = loopInfo->getLoopDepth(MBB); @@ -1334,10 +1334,10 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, SmallVector &ReMatIds, const MachineLoopInfo *loopInfo, BitVector &SpillMBBs, - std::map > &SpillIdxes, + DenseMap > &SpillIdxes, BitVector &RestoreMBBs, - std::map > &RestoreIdxes, - std::map &MBBVRegsMap, + DenseMap > &RestoreIdxes, + DenseMap &MBBVRegsMap, std::vector &NewLIs, float &SSWeight) { bool AllCanFold = true; unsigned NewVReg = 0; @@ -1404,7 +1404,7 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, unsigned MBBId = MBB->getNumber(); unsigned ThisVReg = 0; if (TrySplit) { - std::map::const_iterator NVI = MBBVRegsMap.find(MBBId); + DenseMap::iterator NVI = MBBVRegsMap.find(MBBId); if (NVI != MBBVRegsMap.end()) { ThisVReg = NVI->second; // One common case: @@ -1466,7 +1466,7 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, if (VNI) HasKill = anyKillInMBBAfterIdx(li, VNI, MBB, getDefIndex(index)); } - std::map >::iterator SII = + DenseMap >::iterator SII = SpillIdxes.find(MBBId); if (!HasKill) { if (SII == SpillIdxes.end()) { @@ -1499,14 +1499,14 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, } if (HasUse) { - std::map >::iterator SII = + DenseMap >::iterator SII = SpillIdxes.find(MBBId); if (SII != SpillIdxes.end() && SII->second.back().vreg == NewVReg && (int)index > SII->second.back().index) // Use(s) following the last def, it's not safe to fold the spill. SII->second.back().canFold = false; - std::map >::iterator RII = + DenseMap >::iterator RII = RestoreIdxes.find(MBBId); if (RII != RestoreIdxes.end() && RII->second.back().vreg == NewVReg) // If we are splitting live intervals, only fold if it's the first @@ -1539,7 +1539,7 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, bool LiveIntervals::alsoFoldARestore(int Id, int index, unsigned vr, BitVector &RestoreMBBs, - std::map > &RestoreIdxes) { + DenseMap > &RestoreIdxes) { if (!RestoreMBBs[Id]) return false; std::vector &Restores = RestoreIdxes[Id]; @@ -1553,7 +1553,7 @@ bool LiveIntervals::alsoFoldARestore(int Id, int index, unsigned vr, void LiveIntervals::eraseRestoreInfo(int Id, int index, unsigned vr, BitVector &RestoreMBBs, - std::map > &RestoreIdxes) { + DenseMap > &RestoreIdxes) { if (!RestoreMBBs[Id]) return; std::vector &Restores = RestoreIdxes[Id]; @@ -1613,10 +1613,10 @@ addIntervalsForSpills(const LiveInterval &li, // Each bit specify whether it a spill is required in the MBB. BitVector SpillMBBs(mf_->getNumBlockIDs()); - std::map > SpillIdxes; + DenseMap > SpillIdxes; BitVector RestoreMBBs(mf_->getNumBlockIDs()); - std::map > RestoreIdxes; - std::map MBBVRegsMap; + DenseMap > RestoreIdxes; + DenseMap MBBVRegsMap; std::vector NewLIs; const TargetRegisterClass* rc = mri_->getRegClass(li.reg);