Give SplitAnalysis a VRM member to access VirtRegMap::getOriginal().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 19 Feb 2011 00:53:42 +0000 (00:53 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 19 Feb 2011 00:53:42 +0000 (00:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126005 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocGreedy.cpp
lib/CodeGen/SplitKit.cpp
lib/CodeGen/SplitKit.h

index 3c65cf3b29bd79077876bd0d79cbe64e2db7b807..c1372cd038cfecf67907159bc749118f2896c92e 100644 (file)
@@ -1266,7 +1266,7 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
   Bundles = &getAnalysis<EdgeBundles>();
   SpillPlacer = &getAnalysis<SpillPlacement>();
 
-  SA.reset(new SplitAnalysis(*MF, *LIS, *Loops));
+  SA.reset(new SplitAnalysis(*VRM, *LIS, *Loops));
 
   allocatePhysRegs();
   addMBBLiveIns(MF);
index 7b02b2662329491f4aa604bf31cf931ccd579342..5663936bf3aae501fb0512b3e9be4a8f076c8d91 100644 (file)
@@ -37,13 +37,14 @@ AllowSplit("spiller-splits-edges",
 //                                 Split Analysis
 //===----------------------------------------------------------------------===//
 
-SplitAnalysis::SplitAnalysis(const MachineFunction &mf,
+SplitAnalysis::SplitAnalysis(const VirtRegMap &vrm,
                              const LiveIntervals &lis,
                              const MachineLoopInfo &mli)
-  : MF(mf),
+  : MF(vrm.getMachineFunction()),
+    VRM(vrm),
     LIS(lis),
     Loops(mli),
-    TII(*mf.getTarget().getInstrInfo()),
+    TII(*MF.getTarget().getInstrInfo()),
     CurLI(0) {}
 
 void SplitAnalysis::clear() {
index 7adc0be10de4aadd8b424035e12e31abbf406bde..5c34afd1c81952d13ee697c11d5ef63fabcce6d8 100644 (file)
@@ -43,6 +43,7 @@ typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode;
 class SplitAnalysis {
 public:
   const MachineFunction &MF;
+  const VirtRegMap &VRM;
   const LiveIntervals &LIS;
   const MachineLoopInfo &Loops;
   const TargetInstrInfo &TII;
@@ -105,7 +106,7 @@ private:
   bool canAnalyzeBranch(const MachineBasicBlock *MBB);
 
 public:
-  SplitAnalysis(const MachineFunction &mf, const LiveIntervals &lis,
+  SplitAnalysis(const VirtRegMap &vrm, const LiveIntervals &lis,
                 const MachineLoopInfo &mli);
 
   /// analyze - set CurLI to the specified interval, and analyze how it may be