summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-01-26 02:00:44 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-01-26 02:00:44 +0000
commit555f61bf58258b7741e89f9552f6ee7236b236d9 (patch)
treecaf5a4c2bc233ed711db2b0198e27946f9caeb50 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent0563fe34452f40ff762cf454bc4da8a385893047 (diff)
downloadbcm5719-llvm-555f61bf58258b7741e89f9552f6ee7236b236d9.tar.gz
bcm5719-llvm-555f61bf58258b7741e89f9552f6ee7236b236d9.zip
Implement cond ? -1 : 0 with sbb.
llvm-svn: 94490
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 8883064df99..640bdc091ca 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3220,6 +3220,14 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
NegOne, DAG.getConstant(0, VT),
cast<CondCodeSDNode>(N0.getOperand(2))->get(), true);
if (SCC.getNode()) return SCC;
+ if (!LegalOperations ||
+ TLI.isOperationLegal(ISD::SETCC, TLI.getSetCCResultType(VT)))
+ return DAG.getNode(ISD::SELECT, N->getDebugLoc(), VT,
+ DAG.getSetCC(N->getDebugLoc(),
+ TLI.getSetCCResultType(VT),
+ N0.getOperand(0), N0.getOperand(1),
+ cast<CondCodeSDNode>(N0.getOperand(2))->get()),
+ NegOne, DAG.getConstant(0, VT));
}
OpenPOWER on IntegriCloud