Recommit r129383. PreRA scheduler heuristic fixes: VRegCycle, TokenFactor latency.
[oota-llvm.git] / lib / CodeGen / ScheduleDAGEmit.cpp
index 0c8435da6cbdf6f98aef026d30ca0f0d51e54785..6b7a8c6491bd1b699e067bfe45ffdd9adac8441d 100644 (file)
 #include "llvm/Support/MathExtras.h"
 using namespace llvm;
 
-void ScheduleDAG::AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO) {
-  MI->addMemOperand(MF, MO);
-}
-
 void ScheduleDAG::EmitNoop() {
-  TII->insertNoop(*BB, End);
+  TII->insertNoop(*BB, InsertPos);
 }
 
 void ScheduleDAG::EmitPhysRegCopy(SUnit *SU,
@@ -54,17 +50,17 @@ void ScheduleDAG::EmitPhysRegCopy(SUnit *SU,
           break;
         }
       }
-      TII->copyRegToReg(*BB, End, Reg, VRI->second,
-                        SU->CopyDstRC, SU->CopySrcRC);
+      BuildMI(*BB, InsertPos, DebugLoc(), TII->get(TargetOpcode::COPY), Reg)
+        .addReg(VRI->second);
     } else {
       // Copy from physical register.
       assert(I->getReg() && "Unknown physical register!");
       unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC);
       bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase)).second;
-      isNew = isNew; // Silence compiler warning.
+      (void)isNew; // Silence compiler warning.
       assert(isNew && "Node emitted out of order - early");
-      TII->copyRegToReg(*BB, End, VRBase, I->getReg(),
-                        SU->CopyDstRC, SU->CopySrcRC);
+      BuildMI(*BB, InsertPos, DebugLoc(), TII->get(TargetOpcode::COPY), VRBase)
+        .addReg(I->getReg());
     }
     break;
   }