summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-03-08 15:37:02 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-03-08 15:37:02 +0000
commitd93ef7afaae5082e891cc1f424f5a2b4e30645e6 (patch)
treec95c6d62e10b475ae774e54f939ddb6ff81031c5 /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parentb1588fc0572640c0ccf6bea1a6a31d4c858b64e8 (diff)
downloadbcm5719-llvm-d93ef7afaae5082e891cc1f424f5a2b4e30645e6.tar.gz
bcm5719-llvm-d93ef7afaae5082e891cc1f424f5a2b4e30645e6.zip
LegalizeDAG: Respect the result of TLI.getBooleanContents() when expanding SETCC
llvm-svn: 176695
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index f085e444b65..743a9da0590 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -3632,8 +3632,20 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node) {
// Otherwise, SETCC for the given comparison type must be completely
// illegal; expand it into a SELECT_CC.
EVT VT = Node->getValueType(0);
+ int TrueValue;
+ switch(TLI.getBooleanContents(VT.isVector())) {
+ default: assert(!"Unhandled BooleanContent value");
+ case TargetLowering::ZeroOrOneBooleanContent:
+ case TargetLowering::UndefinedBooleanContent:
+ TrueValue = 1;
+ break;
+ case TargetLowering::ZeroOrNegativeOneBooleanContent:
+ TrueValue = -1;
+ break;
+ }
Tmp1 = DAG.getNode(ISD::SELECT_CC, dl, VT, Tmp1, Tmp2,
- DAG.getConstant(1, VT), DAG.getConstant(0, VT), Tmp3);
+ DAG.getConstant(TrueValue, VT), DAG.getConstant(0, VT),
+ Tmp3);
Results.push_back(Tmp1);
break;
}
OpenPOWER on IntegriCloud