Remove support for NOT instruction
[oota-llvm.git] / lib / Transforms / Scalar / LICM.cpp
index 99450bbd255c8e2147eca80dd1ce966019ef38d0..8bcb227e74b14c542b1e78dcb966fda4b638ad38 100644 (file)
@@ -39,7 +39,7 @@ namespace {
     // This transformation requires natural loop information...
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.preservesCFG();
-      AU.addRequired(LoopInfo::ID); 
+      AU.addRequired<LoopInfo>();
     }
 
   private:
@@ -84,15 +84,13 @@ namespace {
     // the specified instruction types are hoisted.
     //
     friend class InstVisitor<LICM>;
-    void visitUnaryOperator(Instruction &I) {
-      if (isLoopInvariant(I.getOperand(0))) hoist(I);
-    }
     void visitBinaryOperator(Instruction &I) {
       if (isLoopInvariant(I.getOperand(0)) && isLoopInvariant(I.getOperand(1)))
         hoist(I);
     }
-
-    void visitCastInst(CastInst &I) { visitUnaryOperator((Instruction&)I); }
+    void visitCastInst(CastInst &I) {
+      if (isLoopInvariant(I.getOperand(0))) hoist((Instruction&)I);
+    }
     void visitShiftInst(ShiftInst &I) { visitBinaryOperator((Instruction&)I); }
 
     void visitGetElementPtrInst(GetElementPtrInst &GEPI) {
@@ -103,7 +101,7 @@ namespace {
     }
   };
 
-  RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
+  RegisterOpt<LICM> X("licm", "Loop Invariant Code Motion");
 }
 
 Pass *createLICMPass() { return new LICM(); }