[llvm] InstCombine: Clean up SimplifyDemandedFPClass use context application (PR #176886)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 20 08:29:34 PST 2026


================
@@ -2375,12 +2358,6 @@ Value *InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
         SimplifyDemandedFPClass(I, 0, SrcDemandedMask, KnownLHS, Depth + 1))
       return I;
 
-    // Propagate nnan-ness to sources to simplify source checks.
-    if ((DemandedMask & fcNan) == fcNone) {
-      KnownLHS.knownNot(fcNan);
-      KnownRHS.knownNot(fcNan);
-    }
-
     if (FMF.noInfs()) {
       // Flag implies inputs cannot be infinity.
       KnownLHS.knownNot(fcInf);
----------------
arsenm wrote:

Yes, the flag propgation is still needed in many cases. The demanded mask only implies the result, but the flag is stronger and implies the source for any of the operations that can overflow 

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


More information about the llvm-commits mailing list