[PATCH] D82778: [InstCombine] fma x, y, 0 -> fmul x, y

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 09:42:46 PDT 2020


arsenm added a comment.

I don't think I see why this needs an nsz check (but think it could also fold -0 in the 3rd operand with one). The fma should only be able to produce a negative 0 if the 3rd operand is also a -0

fadd(+0, -0) -> +0
fadd(-0, -0) -> -0

fmul(-0, +x) -> -0
fmul(+0, -x) -> -0
fmul(-0, -x) -> 0

fma(+x, -0, 0) -> +0
fma(-x, +0, 0) -> +0
fma(-x, -0, 0) -> +0
fma(+x, -0, -0) -> -0


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

https://reviews.llvm.org/D82778





More information about the llvm-commits mailing list