[PATCH] D73978: [WIP][FPEnv] Don't transform FSUB(-0.0,X)->FNEG(X) when flushing denormals

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 14:53:17 PDT 2020


arsenm added a comment.

In D73978#1952649 <https://reviews.llvm.org/D73978#1952649>, @cameron.mcinally wrote:

> Rebase and AMDGPU test changes to elucidate a problem with this Diff.
>
> @arsenm, The problem in the AMDGPU tests is that FSUB(-0.0, X) is not folding into the following instruction, as it would if it was transformed into an FNEG(X).
>
> It's probably okay to fold some of these. E.g.
>
>   -  %fneg.a = fsub float -0.000000e+00, %a
>   +  %fneg.a = fneg float %a
>      %add = fadd float %fneg.a, %b
>
>
> If we're flushing input to zero, it's probably okay to fold a FSUB(-0,X) into the FADD, since the FADD will flush denorms. Although, if we're flushing output to zero, that probably is NOT ok, since something like FADD(largest_denorm, largest_denorm) would return a normal.
>
> I guess what I'm really asking is how important is this to AMDGPU? It seems to be the only target that is upset about the changes in this Diff.


AMDGPU isn't respecting the new attributes yet. My patches to switch to it are still working their way through the review/commit process


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73978/new/

https://reviews.llvm.org/D73978





More information about the llvm-commits mailing list