Teach legalize to promote SetCC results.
authorChris Lattner <sabre@nondot.org>
Tue, 18 Jan 2005 02:59:52 +0000 (02:59 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 18 Jan 2005 02:59:52 +0000 (02:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19657 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index b975e5859ecec9fa868d091fc764928e694912e1..46db8580533ad68e815c81b0c8ad25956a2ac579 100644 (file)
@@ -917,6 +917,14 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
     Result = DAG.getNode(ISD::FP_EXTEND, NVT, Op);
     assert(isa<ConstantFPSDNode>(Result) && "Didn't constant fold fp_extend?");
     break;
+  case ISD::SETCC:
+    assert(getTypeAction(TLI.getSetCCResultTy()) == Legal &&
+           "SetCC type is not legal??");
+    Result = DAG.getSetCC(cast<SetCCSDNode>(Node)->getCondition(),
+                          TLI.getSetCCResultTy(), Node->getOperand(0),
+                          Node->getOperand(1));
+    Result = LegalizeOp(Result);
+    break;
 
   case ISD::TRUNCATE:
     switch (getTypeAction(Node->getOperand(0).getValueType())) {