[llvm] [llvm] Don't combine repeated subnormal divisors (PR #149333)

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 17 10:34:44 PDT 2025


================
@@ -18235,6 +18235,16 @@ SDValue DAGCombiner::combineRepeatedFPDivisors(SDNode *N) {
   if (N0CFP && (N0CFP->isExactlyValue(1.0) || N0CFP->isExactlyValue(-1.0)))
     return SDValue();
 
+  // Skip if we have subnormals, multiplying with the reciprocal will introduce
+  // infinities.
+  ConstantFPSDNode *N1CFP = isConstOrConstSplatFP(N1, /* AllowUndefs */ true);
----------------
andykaylor wrote:

The check on line 18229 above seems to be skipping the `arcp` check after the legalize phase. I'm not sure why that would be the case.

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


More information about the llvm-commits mailing list