InstSimplify: Use isKnownNeverInfOrNaN
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 11 Apr 2023 20:41:02 +0000 (16:41 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Thu, 18 May 2023 22:29:47 +0000 (23:29 +0100)
llvm/lib/Analysis/InstructionSimplify.cpp

index e3cd9fd..2b78b2b 100644 (file)
@@ -4084,14 +4084,10 @@ static Value *simplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
       if (Pred == FCmpInst::FCMP_UNE && isKnownNeverInfinity(LHS, Q.DL, Q.TLI))
         return getTrue(RetTy);
       // LHS == Inf || LHS == NaN
-      if (Pred == FCmpInst::FCMP_UEQ &&
-          isKnownNeverInfinity(LHS, Q.DL, Q.TLI) &&
-          isKnownNeverNaN(LHS, Q.DL, Q.TLI))
+      if (Pred == FCmpInst::FCMP_UEQ && isKnownNeverInfOrNaN(LHS, Q.DL, Q.TLI))
         return getFalse(RetTy);
       // LHS != Inf && LHS != NaN
-      if (Pred == FCmpInst::FCMP_ONE &&
-          isKnownNeverInfinity(LHS, Q.DL, Q.TLI) && // xxxx fixme
-          isKnownNeverNaN(LHS, Q.DL, Q.TLI))
+      if (Pred == FCmpInst::FCMP_ONE && isKnownNeverInfOrNaN(LHS, Q.DL, Q.TLI))
         return getTrue(RetTy);
     }
     if (C->isNegative() && !C->isNegZero()) {