================
@@ -5369,44 +5369,30 @@ void computeKnownFPClass(const Value *V, const APInt
&DemandedElts,
case Intrinsic::experimental_constrained_log2:
case Intrinsic::amdgcn_log: {
Type *EltTy = II->getType()->getScalarType();
- if (IID == Intrinsic::amdgcn_log && EltTy->isFloatTy())
- Known.knownNot(fcSubnormal);
-
- Known.knownNot(fcNegZero);
// log(+inf) -> +inf
// log([+-]0.0) -> -inf
// log(-inf) -> nan
// log(-x) -> nan
- if ((InterestedClasses & (fcNan | fcInf)) == fcNone)
- break;
-
- FPClassTest InterestedSrcs = InterestedClasses;
- if ((InterestedClasses & fcNegInf) != fcNone)
- InterestedSrcs |= fcZero | fcSubnormal;
- if ((InterestedClasses & fcNan) != fcNone)
- InterestedSrcs |= fcNan | (fcNegative & ~fcNan);
-
- KnownFPClass KnownSrc;
- computeKnownFPClass(II->getArgOperand(0), DemandedElts, InterestedSrcs,
- KnownSrc, Q, Depth + 1);
-
- if (KnownSrc.isKnownNeverPosInfinity())
- Known.knownNot(fcPosInf);
-
- if (KnownSrc.isKnownNeverNaN() && KnownSrc.cannotBeOrderedLessThanZero())
- Known.knownNot(fcNan);
-
- const Function *F = II->getFunction();
- if (!F)
- break;
+ if ((InterestedClasses & (fcNan | fcInf)) != fcNone) {
+ FPClassTest InterestedSrcs = InterestedClasses;
+ if ((InterestedClasses & fcNegInf) != fcNone)
+ InterestedSrcs |= fcZero | fcSubnormal;
+ if ((InterestedClasses & fcNan) != fcNone)
+ InterestedSrcs |= fcNan | (fcNegative & ~fcNan);
----------------
dtcxzyw wrote:
```suggestion
InterestedSrcs |= fcNan | fcNegative;
```
https://github.com/llvm/llvm-project/pull/173881
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits