[llvm] r185037 - In InstCombine{AddSub, MulDivRem} convert APFloat.isFiniteNonZero() && !APFloat.isDenormal => APFloat.isNormal.
Michael Gottesman
mgottesman at apple.com
Wed Jun 26 16:17:31 PDT 2013
Author: mgottesman
Date: Wed Jun 26 18:17:31 2013
New Revision: 185037
URL: http://llvm.org/viewvc/llvm-project?rev=185037&view=rev
Log:
In InstCombine{AddSub,MulDivRem} convert APFloat.isFiniteNonZero() && !APFloat.isDenormal => APFloat.isNormal.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp?rev=185037&r1=185036&r2=185037&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp Wed Jun 26 18:17:31 2013
@@ -488,7 +488,7 @@ Value *FAddCombine::performFactorization
createFSub(AddSub0, AddSub1);
if (ConstantFP *CFP = dyn_cast<ConstantFP>(NewAddSub)) {
const APFloat &F = CFP->getValueAPF();
- if (!F.isFiniteNonZero() || F.isDenormal())
+ if (!F.isNormal())
return 0;
}
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp?rev=185037&r1=185036&r2=185037&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp Wed Jun 26 18:17:31 2013
@@ -344,7 +344,7 @@ static bool isFMulOrFDivWithConstant(Val
static bool isNormalFp(const ConstantFP *C) {
const APFloat &Flt = C->getValueAPF();
- return Flt.isFiniteNonZero() && !Flt.isDenormal();
+ return Flt.isNormal();
}
/// foldFMulConst() is a helper routine of InstCombiner::visitFMul().
@@ -893,14 +893,14 @@ Instruction *InstCombiner::visitFDiv(Bin
//
Constant *C = ConstantExpr::getFDiv(C1, C2);
const APFloat &F = cast<ConstantFP>(C)->getValueAPF();
- if (F.isFiniteNonZero() && !F.isDenormal())
+ if (F.isNormal())
Res = BinaryOperator::CreateFMul(X, C);
} else if (match(Op0, m_FDiv(m_Value(X), m_ConstantFP(C1)))) {
// (X/C1)/C2 => X /(C2*C1) [=> X * 1/(C2*C1) if reciprocal is allowed]
//
Constant *C = ConstantExpr::getFMul(C1, C2);
const APFloat &F = cast<ConstantFP>(C)->getValueAPF();
- if (F.isFiniteNonZero() && !F.isDenormal()) {
+ if (F.isNormal()) {
Res = CvtFDivConstToReciprocal(X, cast<ConstantFP>(C),
AllowReciprocal);
if (!Res)
@@ -941,7 +941,7 @@ Instruction *InstCombiner::visitFDiv(Bin
if (Fold) {
const APFloat &FoldC = cast<ConstantFP>(Fold)->getValueAPF();
- if (FoldC.isFiniteNonZero() && !FoldC.isDenormal()) {
+ if (FoldC.isNormal()) {
Instruction *R = CreateDiv ?
BinaryOperator::CreateFDiv(Fold, X) :
BinaryOperator::CreateFMul(X, Fold);
More information about the llvm-commits
mailing list