diff options
author | Dale Johannesen <dalej@apple.com> | 2007-10-02 17:43:59 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-10-02 17:43:59 +0000 |
commit | 9ab7fb3ba47442d521a5bed09a27a5e8e7a786ed (patch) | |
tree | b23da219f3f8c1bb5cef7f93bb79892b765bfdf9 /lib/Analysis/ConstantFolding.cpp | |
parent | f09156837508435dc38c6827b552bcbddf6500c2 (diff) | |
download | external_llvm-9ab7fb3ba47442d521a5bed09a27a5e8e7a786ed.zip external_llvm-9ab7fb3ba47442d521a5bed09a27a5e8e7a786ed.tar.gz external_llvm-9ab7fb3ba47442d521a5bed09a27a5e8e7a786ed.tar.bz2 |
Rewrite sqrt and powi to use anyfloat. By popular demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index d689615..599c769 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -329,16 +329,8 @@ Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C, bool llvm::canConstantFoldCallTo(Function *F) { switch (F->getIntrinsicID()) { - case Intrinsic::sqrt_f32: - case Intrinsic::sqrt_f64: - case Intrinsic::sqrt_f80: - case Intrinsic::sqrt_f128: - case Intrinsic::sqrt_ppcf128: - case Intrinsic::powi_f32: - case Intrinsic::powi_f64: - case Intrinsic::powi_f80: - case Intrinsic::powi_f128: - case Intrinsic::powi_ppcf128: + case Intrinsic::sqrt: + case Intrinsic::powi: case Intrinsic::bswap: case Intrinsic::ctpop: case Intrinsic::ctlz: @@ -539,12 +531,12 @@ llvm::ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands) { } } else if (NumOperands == 2) { if (ConstantFP *Op1 = dyn_cast<ConstantFP>(Operands[0])) { + if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy) + return 0; double Op1V = Ty==Type::FloatTy ? (double)Op1->getValueAPF().convertToFloat(): Op1->getValueAPF().convertToDouble(); if (ConstantFP *Op2 = dyn_cast<ConstantFP>(Operands[1])) { - if (Ty!=Type::FloatTy && Ty!=Type::DoubleTy) - return 0; double Op2V = Ty==Type::FloatTy ? (double)Op2->getValueAPF().convertToFloat(): Op2->getValueAPF().convertToDouble(); |