[DAGCombine] combineRepeatedFPDivisors - recognize -1.0 / X as a reciprocal
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 25 Jun 2019 16:00:16 +0000 (16:00 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 25 Jun 2019 16:00:16 +0000 (16:00 +0000)
commit9762b26032c8b926fc2a77b30c93c2aacc52a46e
tree061add7fb32cd518ce979c33109dc11d2c52c45b
parent635eb80662d9a2df12d45748df064d000bf96530
[DAGCombine] combineRepeatedFPDivisors - recognize -1.0 / X as a reciprocal

Fixes issue identified by @nemanjai (Nemanja Ivanovic) in D62963 / rL363040 - infinite loop due to GetNegatedExpression fighting combineRepeatedFPDivisors resulting in fneg(fdiv(x,splat)) -> fneg(fmul(x,1.0/splat)) -> fmul(x,-1.0/splat) -> fmul(x,(-1.0 * 1.0)/splat) ......

llvm-svn: 364326
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/PowerPC/combine-fneg.ll [new file with mode: 0644]