summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commit6bf69ed3cc94cca3ad0da1beb5c334ac278613fd (patch)
tree5d87552b86f5cbf0c68836517aa7f4a7223ecf3d /llvm/lib/Transforms
parent483e305210d0a57d329831206475709f4f12b699 (diff)
downloadbcm5719-llvm-6bf69ed3cc94cca3ad0da1beb5c334ac278613fd.tar.gz
bcm5719-llvm-6bf69ed3cc94cca3ad0da1beb5c334ac278613fd.zip
minor long double related changes
llvm-svn: 42439
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 01d3c9ff2ec..717a5a847f8 100644
--- a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud