Don't create a MIN/MAX node if the underlying compare has more than one use.
authorJames Molloy <james.molloy@arm.com>
Thu, 4 Jun 2015 13:48:23 +0000 (13:48 +0000)
committerJames Molloy <james.molloy@arm.com>
Thu, 4 Jun 2015 13:48:23 +0000 (13:48 +0000)
commit37593732a49932b985cba26825415d803793ac05
tree7a465f49fb1edd2575992b4e79dd38d2821a2f42
parent7813ae879e7a9151349ad67f26ee6cfd6feae347
Don't create a MIN/MAX node if the underlying compare has more than one use.

If the compare in a select pattern has another use then it can't be removed, so we'd just
be creating repeated code if we created a min/max node.

Spotted by Matt Arsenault!

llvm-svn: 239037
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/AArch64/minmax.ll