]> granicus.if.org Git - llvm/commit
DAGCombiner: don't duplicate (fmul x, c) in visitFNEG if fneg is free
authorFiona Glaser <escha@apple.com>
Fri, 5 Jun 2015 17:52:34 +0000 (17:52 +0000)
committerFiona Glaser <escha@apple.com>
Fri, 5 Jun 2015 17:52:34 +0000 (17:52 +0000)
commit5a0d6b758c21b6a7b00cf8291c99af7ef4daa3d1
treee92168bc0abf5578341ebea0eaf410c303222a1b
parent485adcac20be9b4c42583a8a552cfde53cc6553f
DAGCombiner: don't duplicate (fmul x, c) in visitFNEG if fneg is free

For targets with a free fneg, this fold is always a net loss if it
ends up duplicating the multiply, so definitely avoid it.

This might be true for some targets without a free fneg too, but
I'll leave that for future investigation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239167 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/R600/fmul.ll