implement legalization of truncates whose results and sources need to be
authorChris Lattner <sabre@nondot.org>
Fri, 28 Jan 2005 22:52:50 +0000 (22:52 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 28 Jan 2005 22:52:50 +0000 (22:52 +0000)
truncated, e.g. (truncate:i8 something:i16) on a 32 or 64-bit RISC.

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

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 32cf5970726dc688d476dd2772158912db913017..e435bd609de8dd41321ac46f613132781e8720fa 100644 (file)
@@ -1035,10 +1035,13 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
       if (Result.getValueType() > NVT)    // Truncate to NVT instead of VT
         Result = DAG.getNode(ISD::TRUNCATE, NVT, Result);
       break;
+    case Promote:
+      // The truncation is not required, because we don't guarantee anything
+      // about high bits anyway.
+      Result = PromoteOp(Node->getOperand(0));
+      break;
     case Expand:
       assert(0 && "Cannot handle expand yet");
-    case Promote:
-      assert(0 && "Cannot handle promote-promote yet");
     }
     break;
   case ISD::SIGN_EXTEND: