Fixed the comment. No functionality change.
[oota-llvm.git] / lib / CodeGen / RegAllocPBQP.cpp
index 40f7570646b8bf8da472833aa2fb22f2efefe9d6..adab2b01d8000a8d0a86df6db951aba6c4c2c0cd 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "PBQP.h"
 #include "VirtRegMap.h"
+#include "Spiller.h"
 #include "llvm/CodeGen/LiveIntervalAnalysis.h"
 #include "llvm/CodeGen/LiveStackAnalysis.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
@@ -82,6 +83,7 @@ namespace {
       au.addPreserved<LiveStacks>();
       au.addRequired<MachineLoopInfo>();
       au.addPreserved<MachineLoopInfo>();
+      au.addRequired<VirtRegMap>();
       MachineFunctionPass::getAnalysisUsage(au);
     }
 
@@ -359,10 +361,10 @@ PBQPRegAlloc::CoalesceMap PBQPRegAlloc::findCoalesces() {
          iItr != iEnd; ++iItr) {
 
       const MachineInstr *instr = &*iItr;
-      unsigned srcReg, dstReg;
+      unsigned srcReg, dstReg, srcSubReg, dstSubReg;
 
       // If this isn't a copy then continue to the next instruction.
-      if (!tii->isMoveInstr(*instr, srcReg, dstReg))
+      if (!tii->isMoveInstr(*instr, srcReg, dstReg, srcSubReg, dstSubReg))
         continue;
 
       // If the registers are already the same our job is nice and easy.
@@ -798,8 +800,7 @@ bool PBQPRegAlloc::runOnMachineFunction(MachineFunction &MF) {
   lss = &getAnalysis<LiveStacks>();
   loopInfo = &getAnalysis<MachineLoopInfo>();
 
-  std::auto_ptr<VirtRegMap> vrmAutoPtr(new VirtRegMap(*mf));
-  vrm = vrmAutoPtr.get();
+  vrm = &getAnalysis<VirtRegMap>();
 
   DOUT << "PBQP Register Allocating for " << mf->getFunction()->getName() << "\n";