[llvm] [InstSimplify] fold uno/ord comparison if fpclass is always NaN (PR #97763)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 7 07:00:15 PDT 2024


================
@@ -4117,9 +4117,14 @@ static Value *simplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
   // This catches the 2 variable input case, constants are handled below as a
   // class-like compare.
   if (Pred == FCmpInst::FCMP_ORD || Pred == FCmpInst::FCMP_UNO) {
-    if (FMF.noNaNs() || (isKnownNeverNaN(RHS, /*Depth=*/0, Q) &&
-                         isKnownNeverNaN(LHS, /*Depth=*/0, Q)))
+    KnownFPClass RHSClass = computeKnownFPClass(RHS, fcAllFlags, 0, Q);
----------------
dtcxzyw wrote:

```suggestion
    KnownFPClass RHSClass = computeKnownFPClass(RHS, fcAllFlags, /*Depth=*/0, Q);
```

https://github.com/llvm/llvm-project/pull/97763


More information about the llvm-commits mailing list