When extending a liveinterval by commuting, don't throw away the live ranges that...
[oota-llvm.git] / lib / CodeGen / MachineLICM.cpp
index 829583054459cba8e38d3cf2d202383d83f94416..7f48ab5499f798bf97c50d05cfcab95a82e6cb18 100644 (file)
@@ -150,12 +150,12 @@ namespace {
     ///
     void Hoist(MachineInstr &MI);
   };
-
-  char MachineLICM::ID = 0;
-  RegisterPass<MachineLICM> X("machine-licm",
-                              "Machine Loop Invariant Code Motion");
 } // end anonymous namespace
 
+char MachineLICM::ID = 0;
+static RegisterPass<MachineLICM>
+X("machine-licm", "Machine Loop Invariant Code Motion");
+
 FunctionPass *llvm::createMachineLICMPass() { return new MachineLICM(); }
 
 /// Hoist expressions out of the specified loop. Note, alias info for inner loop
@@ -297,10 +297,6 @@ bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
 void MachineLICM::Hoist(MachineInstr &MI) {
   if (!IsLoopInvariantInst(MI)) return;
 
-  // Hoisting things that are trivially rematerializable may result in worse
-  // code than before.
-  if (TII->isTriviallyReMaterializable(&MI)) return;
-
   std::vector<MachineBasicBlock*> Preds;
 
   // Non-back-edge predecessors.