[InstCombine] fold fadd+fneg with fdiv/fmul betweena
authorSanjay Patel <spatel@rotateright.com>
Mon, 29 Jul 2019 13:50:25 +0000 (13:50 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 29 Jul 2019 13:50:25 +0000 (13:50 +0000)
commite9ee7b47d42b3e9f645810e65905a43b583d55c7
treec283f2ea9a2d63d00c31961faedbf2c9a790f7f8
parent98d281a99f1f60eac65ce348157dcec49742378f
[InstCombine] fold fadd+fneg with fdiv/fmul betweena

The backend already does this via isNegatibleForFree(),
but we may want to alter the fneg IR canonicalizations
that currently exist, so we need to try harder to fold
fneg in IR to avoid regressions.

llvm-svn: 367227
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/test/Transforms/InstCombine/fadd.ll