[PATCH] D109446: DAG: Fix incorrect folding of fmul -1 to fneg

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 09:17:45 PDT 2021


arsenm added a comment.

In D109446#2990532 <https://reviews.llvm.org/D109446#2990532>, @efriedma wrote:

> I think we can fold `(fmul X, -1.0) -> (fsub -0.0, X)` unconditionally; at least, Alive2 is happy with it. If we can do that, we can just let the existing fsub code figure out the rest.  Does that sound like a plan?

That works (although is a code size regression for AMDGPU). We have other combines like this that we have to undo later for this reason anyway


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

https://reviews.llvm.org/D109446



More information about the llvm-commits mailing list