@@ -5357,7 +5357,9 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
5357
5357
case Intrinsic::maxnum:
5358
5358
case Intrinsic::minnum:
5359
5359
case Intrinsic::minimum:
5360
- case Intrinsic::maximum: {
5360
+ case Intrinsic::maximum:
5361
+ case Intrinsic::minimumnum:
5362
+ case Intrinsic::maximumnum: {
5361
5363
KnownFPClass KnownLHS, KnownRHS;
5362
5364
computeKnownFPClass (II->getArgOperand (0 ), DemandedElts, InterestedClasses,
5363
5365
KnownLHS, Depth + 1 , Q);
@@ -5368,10 +5370,12 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
5368
5370
Known = KnownLHS | KnownRHS;
5369
5371
5370
5372
// If either operand is not NaN, the result is not NaN.
5371
- if (NeverNaN && (IID == Intrinsic::minnum || IID == Intrinsic::maxnum))
5373
+ if (NeverNaN &&
5374
+ (IID == Intrinsic::minnum || IID == Intrinsic::maxnum ||
5375
+ IID == Intrinsic::minimumnum || IID == Intrinsic::maximumnum))
5372
5376
Known.knownNot (fcNan);
5373
5377
5374
- if (IID == Intrinsic::maxnum) {
5378
+ if (IID == Intrinsic::maxnum || IID == Intrinsic::maximumnum ) {
5375
5379
// If at least one operand is known to be positive, the result must be
5376
5380
// positive.
5377
5381
if ((KnownLHS.cannotBeOrderedLessThanZero () &&
@@ -5385,21 +5389,22 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
5385
5389
if (KnownLHS.cannotBeOrderedLessThanZero () ||
5386
5390
KnownRHS.cannotBeOrderedLessThanZero ())
5387
5391
Known.knownNot (KnownFPClass::OrderedLessThanZeroMask);
5388
- } else if (IID == Intrinsic::minnum) {
5392
+ } else if (IID == Intrinsic::minnum || IID == Intrinsic::minimumnum ) {
5389
5393
// If at least one operand is known to be negative, the result must be
5390
5394
// negative.
5391
5395
if ((KnownLHS.cannotBeOrderedGreaterThanZero () &&
5392
5396
KnownLHS.isKnownNeverNaN ()) ||
5393
5397
(KnownRHS.cannotBeOrderedGreaterThanZero () &&
5394
5398
KnownRHS.isKnownNeverNaN ()))
5395
5399
Known.knownNot (KnownFPClass::OrderedGreaterThanZeroMask);
5396
- } else {
5400
+ } else if (IID == Intrinsic::minimum) {
5397
5401
// If at least one operand is known to be negative, the result must be
5398
5402
// negative.
5399
5403
if (KnownLHS.cannotBeOrderedGreaterThanZero () ||
5400
5404
KnownRHS.cannotBeOrderedGreaterThanZero ())
5401
5405
Known.knownNot (KnownFPClass::OrderedGreaterThanZeroMask);
5402
- }
5406
+ } else
5407
+ llvm_unreachable (" unhandled intrinsic" );
5403
5408
5404
5409
// Fixup zero handling if denormals could be returned as a zero.
5405
5410
//
@@ -5427,15 +5432,20 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
5427
5432
Known.signBitMustBeOne ();
5428
5433
else
5429
5434
Known.signBitMustBeZero ();
5430
- } else if ((IID == Intrinsic::maximum || IID == Intrinsic::minimum) ||
5435
+ } else if ((IID == Intrinsic::maximum || IID == Intrinsic::minimum ||
5436
+ IID == Intrinsic::maximumnum ||
5437
+ IID == Intrinsic::minimumnum) ||
5438
+ // FIXME: Should be using logical zero versions
5431
5439
((KnownLHS.isKnownNeverNegZero () ||
5432
5440
KnownRHS.isKnownNeverPosZero ()) &&
5433
5441
(KnownLHS.isKnownNeverPosZero () ||
5434
5442
KnownRHS.isKnownNeverNegZero ()))) {
5435
- if ((IID == Intrinsic::maximum || IID == Intrinsic::maxnum) &&
5443
+ if ((IID == Intrinsic::maximum || IID == Intrinsic::maximumnum ||
5444
+ IID == Intrinsic::maxnum) &&
5436
5445
(KnownLHS.SignBit == false || KnownRHS.SignBit == false ))
5437
5446
Known.signBitMustBeZero ();
5438
- else if ((IID == Intrinsic::minimum || IID == Intrinsic::minnum) &&
5447
+ else if ((IID == Intrinsic::minimum || IID == Intrinsic::minimumnum ||
5448
+ IID == Intrinsic::minnum) &&
5439
5449
(KnownLHS.SignBit == true || KnownRHS.SignBit == true ))
5440
5450
Known.signBitMustBeOne ();
5441
5451
}
0 commit comments