From 2c4f7b5faaeedd97058ec4cfa44177124c42b9e1 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Thu, 9 Sep 2004 19:24:38 +0000 Subject: [PATCH] Grow the map on entry so that we don't crash if joinIntervals never runs (if coalescing is disabled for example). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16259 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveIntervalAnalysis.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index e0fefc3870f..04978d62e82 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -88,6 +88,7 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) { mri_ = tm_->getRegisterInfo(); lv_ = &getAnalysis(); allocatableRegs_ = mri_->getAllocatableSet(fn); + r2rMap_.grow(mf_->getSSARegMap()->getLastVirtReg()); // number MachineInstrs unsigned miIndex = 0; @@ -619,8 +620,6 @@ 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(); if (LI.begin() == LI.end()) {