Expunge the last uses of std::map from LiveIntervals.
llvm-svn: 54766
This commit is contained in:
parent
767b5cc7fd
commit
706f6b7899
|
@ -28,7 +28,6 @@
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/Support/Allocator.h"
|
#include "llvm/Support/Allocator.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <map>
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
|
@ -434,10 +433,10 @@ namespace llvm {
|
||||||
|
|
||||||
bool alsoFoldARestore(int Id, int index, unsigned vr,
|
bool alsoFoldARestore(int Id, int index, unsigned vr,
|
||||||
BitVector &RestoreMBBs,
|
BitVector &RestoreMBBs,
|
||||||
std::map<unsigned,std::vector<SRInfo> >&RestoreIdxes);
|
DenseMap<unsigned,std::vector<SRInfo> >&RestoreIdxes);
|
||||||
void eraseRestoreInfo(int Id, int index, unsigned vr,
|
void eraseRestoreInfo(int Id, int index, unsigned vr,
|
||||||
BitVector &RestoreMBBs,
|
BitVector &RestoreMBBs,
|
||||||
std::map<unsigned,std::vector<SRInfo> >&RestoreIdxes);
|
DenseMap<unsigned,std::vector<SRInfo> >&RestoreIdxes);
|
||||||
|
|
||||||
/// handleSpilledImpDefs - Remove IMPLICIT_DEF instructions which are being
|
/// handleSpilledImpDefs - Remove IMPLICIT_DEF instructions which are being
|
||||||
/// spilled and create empty intervals for their uses.
|
/// spilled and create empty intervals for their uses.
|
||||||
|
@ -460,7 +459,7 @@ namespace llvm {
|
||||||
VirtRegMap &vrm, const TargetRegisterClass* rc,
|
VirtRegMap &vrm, const TargetRegisterClass* rc,
|
||||||
SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
|
SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
|
||||||
unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
|
unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
|
||||||
std::map<unsigned,unsigned> &MBBVRegsMap,
|
DenseMap<unsigned,unsigned> &MBBVRegsMap,
|
||||||
std::vector<LiveInterval*> &NewLIs, float &SSWeight);
|
std::vector<LiveInterval*> &NewLIs, float &SSWeight);
|
||||||
void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
|
void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
|
||||||
LiveInterval::Ranges::const_iterator &I,
|
LiveInterval::Ranges::const_iterator &I,
|
||||||
|
@ -469,10 +468,10 @@ namespace llvm {
|
||||||
VirtRegMap &vrm, const TargetRegisterClass* rc,
|
VirtRegMap &vrm, const TargetRegisterClass* rc,
|
||||||
SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
|
SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
|
||||||
BitVector &SpillMBBs,
|
BitVector &SpillMBBs,
|
||||||
std::map<unsigned,std::vector<SRInfo> > &SpillIdxes,
|
DenseMap<unsigned,std::vector<SRInfo> > &SpillIdxes,
|
||||||
BitVector &RestoreMBBs,
|
BitVector &RestoreMBBs,
|
||||||
std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes,
|
DenseMap<unsigned,std::vector<SRInfo> > &RestoreIdxes,
|
||||||
std::map<unsigned,unsigned> &MBBVRegsMap,
|
DenseMap<unsigned,unsigned> &MBBVRegsMap,
|
||||||
std::vector<LiveInterval*> &NewLIs, float &SSWeight);
|
std::vector<LiveInterval*> &NewLIs, float &SSWeight);
|
||||||
|
|
||||||
static LiveInterval* createInterval(unsigned Reg);
|
static LiveInterval* createInterval(unsigned Reg);
|
||||||
|
|
|
@ -1091,7 +1091,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
|
||||||
SmallVector<int, 4> &ReMatIds,
|
SmallVector<int, 4> &ReMatIds,
|
||||||
const MachineLoopInfo *loopInfo,
|
const MachineLoopInfo *loopInfo,
|
||||||
unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
|
unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
|
||||||
std::map<unsigned,unsigned> &MBBVRegsMap,
|
DenseMap<unsigned,unsigned> &MBBVRegsMap,
|
||||||
std::vector<LiveInterval*> &NewLIs, float &SSWeight) {
|
std::vector<LiveInterval*> &NewLIs, float &SSWeight) {
|
||||||
MachineBasicBlock *MBB = MI->getParent();
|
MachineBasicBlock *MBB = MI->getParent();
|
||||||
unsigned loopDepth = loopInfo->getLoopDepth(MBB);
|
unsigned loopDepth = loopInfo->getLoopDepth(MBB);
|
||||||
|
@ -1334,10 +1334,10 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
|
||||||
SmallVector<int, 4> &ReMatIds,
|
SmallVector<int, 4> &ReMatIds,
|
||||||
const MachineLoopInfo *loopInfo,
|
const MachineLoopInfo *loopInfo,
|
||||||
BitVector &SpillMBBs,
|
BitVector &SpillMBBs,
|
||||||
std::map<unsigned, std::vector<SRInfo> > &SpillIdxes,
|
DenseMap<unsigned, std::vector<SRInfo> > &SpillIdxes,
|
||||||
BitVector &RestoreMBBs,
|
BitVector &RestoreMBBs,
|
||||||
std::map<unsigned, std::vector<SRInfo> > &RestoreIdxes,
|
DenseMap<unsigned, std::vector<SRInfo> > &RestoreIdxes,
|
||||||
std::map<unsigned,unsigned> &MBBVRegsMap,
|
DenseMap<unsigned,unsigned> &MBBVRegsMap,
|
||||||
std::vector<LiveInterval*> &NewLIs, float &SSWeight) {
|
std::vector<LiveInterval*> &NewLIs, float &SSWeight) {
|
||||||
bool AllCanFold = true;
|
bool AllCanFold = true;
|
||||||
unsigned NewVReg = 0;
|
unsigned NewVReg = 0;
|
||||||
|
@ -1404,7 +1404,7 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
|
||||||
unsigned MBBId = MBB->getNumber();
|
unsigned MBBId = MBB->getNumber();
|
||||||
unsigned ThisVReg = 0;
|
unsigned ThisVReg = 0;
|
||||||
if (TrySplit) {
|
if (TrySplit) {
|
||||||
std::map<unsigned,unsigned>::const_iterator NVI = MBBVRegsMap.find(MBBId);
|
DenseMap<unsigned,unsigned>::iterator NVI = MBBVRegsMap.find(MBBId);
|
||||||
if (NVI != MBBVRegsMap.end()) {
|
if (NVI != MBBVRegsMap.end()) {
|
||||||
ThisVReg = NVI->second;
|
ThisVReg = NVI->second;
|
||||||
// One common case:
|
// One common case:
|
||||||
|
@ -1466,7 +1466,7 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
|
||||||
if (VNI)
|
if (VNI)
|
||||||
HasKill = anyKillInMBBAfterIdx(li, VNI, MBB, getDefIndex(index));
|
HasKill = anyKillInMBBAfterIdx(li, VNI, MBB, getDefIndex(index));
|
||||||
}
|
}
|
||||||
std::map<unsigned, std::vector<SRInfo> >::iterator SII =
|
DenseMap<unsigned, std::vector<SRInfo> >::iterator SII =
|
||||||
SpillIdxes.find(MBBId);
|
SpillIdxes.find(MBBId);
|
||||||
if (!HasKill) {
|
if (!HasKill) {
|
||||||
if (SII == SpillIdxes.end()) {
|
if (SII == SpillIdxes.end()) {
|
||||||
|
@ -1499,14 +1499,14 @@ rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasUse) {
|
if (HasUse) {
|
||||||
std::map<unsigned, std::vector<SRInfo> >::iterator SII =
|
DenseMap<unsigned, std::vector<SRInfo> >::iterator SII =
|
||||||
SpillIdxes.find(MBBId);
|
SpillIdxes.find(MBBId);
|
||||||
if (SII != SpillIdxes.end() &&
|
if (SII != SpillIdxes.end() &&
|
||||||
SII->second.back().vreg == NewVReg &&
|
SII->second.back().vreg == NewVReg &&
|
||||||
(int)index > SII->second.back().index)
|
(int)index > SII->second.back().index)
|
||||||
// Use(s) following the last def, it's not safe to fold the spill.
|
// Use(s) following the last def, it's not safe to fold the spill.
|
||||||
SII->second.back().canFold = false;
|
SII->second.back().canFold = false;
|
||||||
std::map<unsigned, std::vector<SRInfo> >::iterator RII =
|
DenseMap<unsigned, std::vector<SRInfo> >::iterator RII =
|
||||||
RestoreIdxes.find(MBBId);
|
RestoreIdxes.find(MBBId);
|
||||||
if (RII != RestoreIdxes.end() && RII->second.back().vreg == NewVReg)
|
if (RII != RestoreIdxes.end() && RII->second.back().vreg == NewVReg)
|
||||||
// If we are splitting live intervals, only fold if it's the first
|
// 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,
|
bool LiveIntervals::alsoFoldARestore(int Id, int index, unsigned vr,
|
||||||
BitVector &RestoreMBBs,
|
BitVector &RestoreMBBs,
|
||||||
std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes) {
|
DenseMap<unsigned,std::vector<SRInfo> > &RestoreIdxes) {
|
||||||
if (!RestoreMBBs[Id])
|
if (!RestoreMBBs[Id])
|
||||||
return false;
|
return false;
|
||||||
std::vector<SRInfo> &Restores = RestoreIdxes[Id];
|
std::vector<SRInfo> &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,
|
void LiveIntervals::eraseRestoreInfo(int Id, int index, unsigned vr,
|
||||||
BitVector &RestoreMBBs,
|
BitVector &RestoreMBBs,
|
||||||
std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes) {
|
DenseMap<unsigned,std::vector<SRInfo> > &RestoreIdxes) {
|
||||||
if (!RestoreMBBs[Id])
|
if (!RestoreMBBs[Id])
|
||||||
return;
|
return;
|
||||||
std::vector<SRInfo> &Restores = RestoreIdxes[Id];
|
std::vector<SRInfo> &Restores = RestoreIdxes[Id];
|
||||||
|
@ -1613,10 +1613,10 @@ addIntervalsForSpills(const LiveInterval &li,
|
||||||
|
|
||||||
// Each bit specify whether it a spill is required in the MBB.
|
// Each bit specify whether it a spill is required in the MBB.
|
||||||
BitVector SpillMBBs(mf_->getNumBlockIDs());
|
BitVector SpillMBBs(mf_->getNumBlockIDs());
|
||||||
std::map<unsigned, std::vector<SRInfo> > SpillIdxes;
|
DenseMap<unsigned, std::vector<SRInfo> > SpillIdxes;
|
||||||
BitVector RestoreMBBs(mf_->getNumBlockIDs());
|
BitVector RestoreMBBs(mf_->getNumBlockIDs());
|
||||||
std::map<unsigned, std::vector<SRInfo> > RestoreIdxes;
|
DenseMap<unsigned, std::vector<SRInfo> > RestoreIdxes;
|
||||||
std::map<unsigned,unsigned> MBBVRegsMap;
|
DenseMap<unsigned,unsigned> MBBVRegsMap;
|
||||||
std::vector<LiveInterval*> NewLIs;
|
std::vector<LiveInterval*> NewLIs;
|
||||||
const TargetRegisterClass* rc = mri_->getRegClass(li.reg);
|
const TargetRegisterClass* rc = mri_->getRegClass(li.reg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue