Remove optimizations that don't require both operands to be constant. These
authorReid Spencer <rspencer@reidspencer.com>
Fri, 29 Apr 2005 05:55:35 +0000 (05:55 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 29 Apr 2005 05:55:35 +0000 (05:55 +0000)
are moved to simplify-libcalls pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21614 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/Local.cpp

index 07b3249c8c4eafc88136f66cd643455312ce4808..4d141533b889e0d2e7c9b87f68f1298a3d3cc3dd 100644 (file)
@@ -360,16 +360,6 @@ Constant *llvm::ConstantFoldCall(Function *F,
         } else if (Name == "atan2")
           return ConstantFP::get(Ty, atan2(Op1V,Op2V));
       }
-      else if (Name == "pow" && Op1V == 1.0) {
-        return ConstantFP::get(Ty,1.0);
-      }
-    } else if (ConstantFP* Op2 = dyn_cast<ConstantFP>(Operands[1])) {
-      double Op2V = Op2->getValue();
-      if (Name == "pow")
-        if (Op2V == 0.0)
-          return ConstantFP::get(Ty,1.0);
-        else if (Op2V == 1.0)
-          return Operands[0];
     }
   }
   return 0;