[InstCombine] fix profitability equation for max-of-nots transform
authorSanjay Patel <spatel@rotateright.com>
Wed, 9 Nov 2016 00:13:11 +0000 (00:13 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 9 Nov 2016 00:13:11 +0000 (00:13 +0000)
commit4e9d6cd35404b8804150c43ea7a8375f398664f4
tree30319fc59d401c82f6b9355ed032d3a49017ef50
parent99dc5feff144a4183a67d66833c51fc7f2444ff9
[InstCombine] fix profitability equation for max-of-nots transform

As the test change shows, we can increase the critical path by adding
a 'not' instruction, so make sure that we're actually removing an
instruction if we do this transform.

This transform could also cause us to miss folds of min/max pairs.

llvm-svn: 286315
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/max-of-nots.ll