Fix Regression/CodeGen/SparcV8/2006-01-22-BitConvertLegalize.ll by making
authorChris Lattner <sabre@nondot.org>
Mon, 23 Jan 2006 07:30:46 +0000 (07:30 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 23 Jan 2006 07:30:46 +0000 (07:30 +0000)
sure that the result of expanding a BIT_CONVERT node is itself legalized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25538 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 245f847748583e886036701d63379023e066ead4..77e721e8b76d1d757cc398110a0716db909633e8 100644 (file)
@@ -2501,14 +2501,16 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
     break;
     
   case ISD::BIT_CONVERT:
-    if (!isTypeLegal(Node->getOperand(0).getValueType()))
+    if (!isTypeLegal(Node->getOperand(0).getValueType())) {
       Result = ExpandBIT_CONVERT(Node->getValueType(0), Node->getOperand(0));
-    else {
+      Result = LegalizeOp(Result);
+    } else {
       switch (TLI.getOperationAction(ISD::BIT_CONVERT,
                                      Node->getOperand(0).getValueType())) {
       default: assert(0 && "Unknown operation action!");
       case TargetLowering::Expand:
         Result = ExpandBIT_CONVERT(Node->getValueType(0), Node->getOperand(0));
+        Result = LegalizeOp(Result);
         break;
       case TargetLowering::Legal:
         Tmp1 = LegalizeOp(Node->getOperand(0));