forked from OSchip/llvm-project
The testing to ensure a vector of zeros of type floating point isn't misclassified as negative zero can be simplified, as pointed out by Duncan Sands.
llvm-svn: 177386
This commit is contained in:
parent
ffb4ca8bb4
commit
298e4192ea
|
@ -53,11 +53,8 @@ bool Constant::isNegativeZeroValue() const {
|
|||
if (SplatCFP && SplatCFP->isZero() && SplatCFP->isNegative())
|
||||
return true;
|
||||
|
||||
// However, vectors of zeroes which are floating point represent +0.0's.
|
||||
if (const ConstantAggregateZero *CAZ = dyn_cast<ConstantAggregateZero>(this))
|
||||
if (const VectorType *VT = dyn_cast<VectorType>(CAZ->getType()))
|
||||
if (VT->getElementType()->isFloatingPointTy())
|
||||
// As it's a CAZ, we know it's the zero bit-pattern (ie, +0.0) in each element.
|
||||
// We've already handled true FP case; any other FP vectors can't represent -0.0.
|
||||
if (getType()->isFPOrFPVectorTy())
|
||||
return false;
|
||||
|
||||
// Otherwise, just use +0.0.
|
||||
|
|
Loading…
Reference in New Issue