Conditionalize constant folding of math intrinsics on the availability of an implemen...
[oota-llvm.git] / lib / Analysis / ConstantFolding.cpp
index e499c73566c649e21fcab9354914b496887352e9..26e38886f6026ba537217b1870a5b1dbab690b2b 100644 (file)
@@ -1282,16 +1282,26 @@ llvm::ConstantFoldCall(Function *F, ArrayRef<Constant *> Operands,
         default: break;
         case Intrinsic::fabs:
           return ConstantFoldFP(fabs, V, Ty);
+#if HAVE_LOG2
         case Intrinsic::log2:
           return ConstantFoldFP(log2, V, Ty);
+#endif
+#if HAVE_LOG
         case Intrinsic::log:
           return ConstantFoldFP(log, V, Ty);
+#endif
+#if HAVE_LOG10
         case Intrinsic::log10:
           return ConstantFoldFP(log10, V, Ty);
+#endif
+#if HAVE_EXP
         case Intrinsic::exp:
           return ConstantFoldFP(exp, V, Ty);
+#endif
+#if HAVE_EXP2
         case Intrinsic::exp2:
           return ConstantFoldFP(exp2, V, Ty);
+#endif
         case Intrinsic::floor:
           return ConstantFoldFP(floor, V, Ty);
       }