[all-commits] [llvm/llvm-project] 93099c: [InstCombine] allow more fast-math-flags to propag...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Fri Dec 9 08:11:33 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 93099c7d21727dd94383783020de4c89a6c5809c
      https://github.com/llvm/llvm-project/commit/93099c7d21727dd94383783020de4c89a6c5809c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-12-09 (Fri, 09 Dec 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Transforms/InstCombine/fneg.ll

  Log Message:
  -----------
  [InstCombine] allow more fast-math-flags to propagate in fneg-of-select fold

We were conservatively intersecting flags, but we can take the union here
because forbidden special values (nsz/nnan/ninf) are not altered by fneg.
So if they were guaranteed not present on the select or fneg, then they
are guaranteed not present on the new select. Alive2 appears to agree on
the test diffs (reduced to not include irrelevant flags like reassoc):
https://alive2.llvm.org/ce/z/ViqqrO

This prevents a potential regression if we tighten up the FMF behavior
for fabs with NAN as suggested in issue #59279.




More information about the All-commits mailing list