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)
commitcd2647f4fdc4a34eac8e26ea89a1f7c5abf9177a
tree26c62a340699aec0bf1ede9a7a9c62750c029a35
parent6ff6fc605522d046b09de50e431015841e05c60e
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239037 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/AArch64/minmax.ll