[DAGCombiner] loosen constraints for fsub+fadd fold
authorSanjay Patel <spatel@rotateright.com>
Wed, 8 Aug 2018 23:04:43 +0000 (23:04 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 8 Aug 2018 23:04:43 +0000 (23:04 +0000)
commite47dc1a40522761752a4bdcb5e23f8147c1da0e2
tree24505b08baeef3434429ef42ba04729feabb13f0
parente327266d45b14b693630be50c0bfa1fce18c66f2
[DAGCombiner] loosen constraints for fsub+fadd fold

isNegatibleForFree() should not matter here (as the test diffs show)
because it's always a win to replace an fsub+fadd with fneg. The
problem in D50195 persists because either (1) we are doing these
folds in the wrong order or (2) we're missing another fold for fadd.

llvm-svn: 339299
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/fp-fold.ll