Avoid forming a SELECT_CC in a type that the target doesn't
authorDan Gohman <gohman@apple.com>
Sun, 2 Aug 2009 16:19:38 +0000 (16:19 +0000)
committerDan Gohman <gohman@apple.com>
Sun, 2 Aug 2009 16:19:38 +0000 (16:19 +0000)
commit4ea480499c40cd7e28bf35cacda33ccbab2aab07
treeb1e9fc167d77663f3470136e7d05593812637ca0
parent7267734c3944582c8ceffddaec84fff70c929a62
Avoid forming a SELECT_CC in a type that the target doesn't
support. This isn't immediately interesting, because Legalize
ends up lowering SELECT_CC if the target doesn't support it,
but this simplifies the process.

Also, if the SELECT_CC would be expanded in Legalize, it
can potentially end up with two copies of the condition
expression. By leaving it as SELECT+SETCC, the SELECT can be
expanded into two SELECTs that use a single SETCC.

The two comparisons are usually CSE'd, but depending on
when various expressions get legalized, the comparison
expression could involve calls to library functions, such
that the comparison expression may not be able to be CSE'd.
This will be needed by a future patch.

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