Use a DenseMap for mapping reg->reg. This improves the LiveInterval

analysis running time from 2.7869secs to 2.5226secs on 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16244 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos
2004-09-08 03:01:50 +00:00
parent 67f9349175
commit 5d0d1e350a
3 changed files with 19 additions and 15 deletions

View File

@ -619,6 +619,8 @@ namespace {
void LiveIntervals::joinIntervals() {
DEBUG(std::cerr << "********** JOINING INTERVALS ***********\n");
// reserve space for the reg2reg map
r2rMap_.grow(mf_->getSSARegMap()->getLastVirtReg());
const LoopInfo &LI = getAnalysis<LoopInfo>();
if (LI.begin() == LI.end()) {
@ -644,9 +646,9 @@ void LiveIntervals::joinIntervals() {
}
DEBUG(std::cerr << "*** Register mapping ***\n");
DEBUG(for (std::map<unsigned, unsigned>::iterator I = r2rMap_.begin(),
E = r2rMap_.end(); I != E; ++I)
std::cerr << " reg " << I->first << " -> reg " << I->second << "\n";);
DEBUG(for (int i = 0, e = r2rMap_.size(); i != e; ++i)
if (r2rMap_[i])
std::cerr << " reg " << i << " -> reg " << r2rMap_[i] << "\n");
}
/// Return true if the two specified registers belong to different register