[InstCombine] fold fsub+fneg with fdiv/fmul between
authorSanjay Patel <spatel@rotateright.com>
Sun, 28 Jul 2019 17:10:06 +0000 (17:10 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 28 Jul 2019 17:10:06 +0000 (17:10 +0000)
commit99c57c6daf6728a9f546c5b78b93c93f16314312
treeba546b2d4c26fd237b3f16a7a63a9a1cb53f1aa5
parent2c8098374b6baedf1007aaf82b161addfb507bf8
[InstCombine] fold fsub+fneg with fdiv/fmul between

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: 367194
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/test/Transforms/InstCombine/fsub.ll