forked from OSchip/llvm-project
[ValueTracking] simplify code in CannotBeNegativeZero() with match(); NFCI
llvm-svn: 318055
This commit is contained in:
parent
5df6b94381
commit
9e3d8f4b39
|
@ -2607,10 +2607,8 @@ bool llvm::CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
|
|||
if (FPO->hasNoSignedZeros())
|
||||
return true;
|
||||
|
||||
// (add x, 0.0) is guaranteed to return +0.0, not -0.0.
|
||||
if (I->getOpcode() == Instruction::FAdd)
|
||||
if (ConstantFP *CFP = dyn_cast<ConstantFP>(I->getOperand(1)))
|
||||
if (CFP->isNullValue())
|
||||
// (fadd x, 0.0) is guaranteed to return +0.0, not -0.0.
|
||||
if (match(I, m_FAdd(m_Value(), m_Zero())))
|
||||
return true;
|
||||
|
||||
// sitofp and uitofp turn into +0.0 for zero.
|
||||
|
|
Loading…
Reference in New Issue