aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-28 18:06:58 +0000
committerDale Johannesen <dalej@apple.com>2007-09-28 18:06:58 +0000
commit4292d1c02a6f10eca22aa6e27d57ea8bf15b3140 (patch)
tree450f247711e5189b3f5243b42877b7814642e574 /lib/Transforms/IPO/SimplifyLibCalls.cpp
parent9fda5be36bf5554c93f0dba8cfaed0b27369ae71 (diff)
minor long double related changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/SimplifyLibCalls.cpp')
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 01d3c9ff2e..717a5a847f 100644
--- a/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -1115,17 +1115,15 @@ public:
/// @brief Perform the pow optimization.
virtual bool OptimizeCall(CallInst *ci, SimplifyLibCalls &SLC) {
const Type *Ty = cast<Function>(ci->getOperand(0))->getReturnType();
+ if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
+ return false; // FIXME long double not yet supported
Value* base = ci->getOperand(1);
Value* expn = ci->getOperand(2);
if (ConstantFP *Op1 = dyn_cast<ConstantFP>(base)) {
- if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
- return false; // FIXME long double not yet supported
if (Op1->isExactlyValue(1.0)) // pow(1.0,x) -> 1.0
return ReplaceCallWith(ci, ConstantFP::get(Ty,
Ty==Type::FloatTy ? APFloat(1.0f) : APFloat(1.0)));
} else if (ConstantFP* Op2 = dyn_cast<ConstantFP>(expn)) {
- if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy)
- return false; // FIXME long double not yet supported
if (Op2->getValueAPF().isZero()) {
// pow(x,0.0) -> 1.0
return ReplaceCallWith(ci, ConstantFP::get(Ty,