[llvm] [InstCombine] Resolve incorrect submasking in foldIntrinsicIsFPClass (PR #190504)

Hardik Gupta via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 5 10:30:30 PDT 2026


================
@@ -863,6 +863,37 @@ define i1 @test_class_is_not_nan_nnan_src_strict(float %x) strictfp {
   ret i1 %class
 }
 
+; Fold to true when known classes are a strict subset of the mask
----------------
hardikkgupta wrote:

You are right. I missed that the mask stripping at line 1174 ensures `Mask ⊆ Known.KnownFPClasses` before reaching the equality check, making equivalent. The original issue mentioned this should match the DAG equivalent fix (#189944), but the InstCombine worklist revisit already covers the subset case. I can close this if the current behavior is considered correct. CC @RKSimon for clarification on whether a single-pass fold was the intent

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


More information about the llvm-commits mailing list