[llvm-branch-commits] [llvm] AMDGPU: Handle amdgcn_rcp in computeKnownFPClass (PR #172490)
Yingwei Zheng via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 17 05:01:04 PST 2025
================
@@ -5553,6 +5553,39 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
// TODO: Copy inf handling from instructions
break;
+ case Intrinsic::amdgcn_rcp: {
+ KnownFPClass KnownSrc;
+ computeKnownFPClass(II->getArgOperand(0), DemandedElts, InterestedClasses,
+ KnownSrc, Q, Depth + 1);
+
+ Known.propagateNaN(KnownSrc);
+
+ Type *EltTy = II->getType()->getScalarType();
+
+ // f32 denormal always flushed.
+ if (EltTy->isFloatTy())
+ Known.knownNot(fcSubnormal);
----------------
dtcxzyw wrote:
```suggestion
if (EltTy->isFloatTy()) {
Known.knownNot(fcSubnormal);
KnownSrc.knownNot(fcSubnormal);
}
```
It can be used for the isKnownNeverLogicalNegZero check below.
https://github.com/llvm/llvm-project/pull/172490
More information about the llvm-branch-commits
mailing list