[llvm] [llvm] Don't combine repeated subnormal divisors (PR #149333)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 10:57:22 PDT 2025
================
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=x86_64 -verify-machineinstrs < %s | FileCheck %s
+
+; Negative test: repeated FP divisor transform should bail out when the rewrite
+; would introduce infinities because of subnormal constant divisors.
+define void @two_denorm_fdivs(float %a0, float %a1, float %a2, ptr %res) {
+; CHECK-LABEL: two_denorm_fdivs:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movss {{.*#+}} xmm0 = [1.95915678E-39,0.0E+0,0.0E+0,0.0E+0]
+; CHECK-NEXT: divss %xmm0, %xmm1
+; CHECK-NEXT: movss %xmm1, (%rdi)
+; CHECK-NEXT: divss %xmm0, %xmm2
+; CHECK-NEXT: movss %xmm2, 4(%rdi)
+; CHECK-NEXT: retq
+entry:
+ %div0 = fdiv ninf float %a1, 0x37E5555500000000
----------------
efriedma-quic wrote:
It looks like you added the wrong test? At least, I can't reproduce the issue without additional flags.
https://github.com/llvm/llvm-project/pull/149333
More information about the llvm-commits
mailing list