[InstSimplify] fsub nnan x, x -> 0.0 is valid without ninf

Both inf - inf and (-inf) - (-inf) are NaN, so it's already covered by
nnan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239702 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2015-06-14 21:01:20 +00:00
parent f3e82660de
commit 49e5e9f0c9
2 changed files with 5 additions and 5 deletions

View File

@ -854,8 +854,8 @@ static Value *SimplifyFSubInst(Value *Op0, Value *Op1, FastMathFlags FMF,
return X;
}
// fsub nnan ninf x, x ==> 0.0
if (FMF.noNaNs() && FMF.noInfs() && Op0 == Op1)
// fsub nnan x, x ==> 0.0
if (FMF.noNaNs() && Op0 == Op1)
return Constant::getNullValue(Op0->getType());
return nullptr;