make it possible to custom lower TRUNCATE (needed for the CellSPU target)
authorTilmann Scheller <tilmann.scheller@googlemail.com>
Tue, 2 Dec 2008 12:12:25 +0000 (12:12 +0000)
committerTilmann Scheller <tilmann.scheller@googlemail.com>
Tue, 2 Dec 2008 12:12:25 +0000 (12:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60409 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 9c5745755f2ebf36a7f6259bb91d24e976a4bc6b..cd90f672513efa31637509f92408ab61d82244cb 100644 (file)
@@ -3904,6 +3904,11 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
     case Legal:
       Tmp1 = LegalizeOp(Node->getOperand(0));
       Result = DAG.UpdateNodeOperands(Result, Tmp1);
+      if (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)) ==
+          TargetLowering::Custom) {
+        Tmp1 = TLI.LowerOperation(Result, DAG);
+        if (Tmp1.getNode()) Result = Tmp1;
+      }
       break;
     case Expand:
       ExpandOp(Node->getOperand(0), Tmp1, Tmp2);