[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 28 14:53:06 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.55 -> 1.56
---
Log message:

implement legalization of truncates whose results and sources need to be
truncated, e.g. (truncate:i8 something:i16) on a 32 or 64-bit RISC.


---
Diffs of the changes:  (+5 -2)

 LegalizeDAG.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.55 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.56
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.55	Fri Jan 28 16:29:18 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Fri Jan 28 16:52:50 2005
@@ -1035,10 +1035,13 @@
       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:






More information about the llvm-commits mailing list