[all-commits] [llvm/llvm-project] bcb4e7: [InstCombine] Fix 0.0 / x -> 0 folds when the divi...

Justin Lebar via All-commits all-commits at lists.llvm.org
Sat Jul 18 14:10:23 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bcb4e7d061ac22bce4ac65f5158a4746fb0edc0f
      https://github.com/llvm/llvm-project/commit/bcb4e7d061ac22bce4ac65f5158a4746fb0edc0f
  Author: Justin Lebar <justin.lebar at gmail.com>
  Date:   2026-07-18 (Sat, 18 Jul 2026)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
    M llvm/test/Transforms/InstCombine/simplify-demanded-fpclass-fdiv.ll

  Log Message:
  -----------
  [InstCombine] Fix 0.0 / x -> 0 folds when the divisor may be zero (#202482)

SimplifyDemandedUseFPClass folded 0/x to a signed zero, guarded only on
the divisor being non-NaN. But when x==0, the result is is NaN, not 0!

Require the divisor to be never (logical) zero, unless a NaN result
isn't demanded.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list