[llvm-commits] [llvm] r67012 - /llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp
Owen Anderson
resistor at mac.com
Sat Mar 14 14:40:08 PDT 2009
Author: resistor
Date: Sat Mar 14 16:40:05 2009
New Revision: 67012
URL: http://llvm.org/viewvc/llvm-project?rev=67012&view=rev
Log:
Give the pre-alloc splitter access to the VirtRegMap. It doesn't do anything
useful with it at the moment, but it will in the future.
Modified:
llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp
Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=67012&r1=67011&r2=67012&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original)
+++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Sat Mar 14 16:40:05 2009
@@ -15,6 +15,7 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "pre-alloc-split"
+#include "VirtRegMap.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveStackAnalysis.h"
#include "llvm/CodeGen/MachineDominators.h"
@@ -57,6 +58,7 @@
MachineRegisterInfo *MRI;
LiveIntervals *LIs;
LiveStacks *LSs;
+ VirtRegMap *VRM;
// Barrier - Current barrier being processed.
MachineInstr *Barrier;
@@ -100,8 +102,10 @@
AU.addPreservedID(PHIEliminationID);
AU.addRequired<MachineDominatorTree>();
AU.addRequired<MachineLoopInfo>();
+ AU.addRequired<VirtRegMap>();
AU.addPreserved<MachineDominatorTree>();
AU.addPreserved<MachineLoopInfo>();
+ AU.addPreserved<VirtRegMap>();
MachineFunctionPass::getAnalysisUsage(AU);
}
@@ -917,6 +921,9 @@
MO.setReg(NewVReg);
}
+ // Grow the VirtRegMap, since we've created a new vreg.
+ VRM->grow();
+
// The renumbered vreg shares a stack slot with the old register.
if (IntervalSSMap.count(CurrLI->reg))
IntervalSSMap[NewVReg] = IntervalSSMap[CurrLI->reg];
@@ -1512,6 +1519,7 @@
MRI = &MF.getRegInfo();
LIs = &getAnalysis<LiveIntervals>();
LSs = &getAnalysis<LiveStacks>();
+ VRM = &getAnalysis<VirtRegMap>();
bool MadeChange = false;
More information about the llvm-commits
mailing list