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

Nate Begeman natebegeman at mac.com
Sun Apr 3 17:57:19 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.72 -> 1.73
---
Log message:

Handle expanding arguments to ISD::TRUNCATE.  This happens on PowerPC when
you have something like i16 = truncate i64.  This fixes Regression/C/casts


---
Diffs of the changes:  (+3 -1)

 LegalizeDAG.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.72 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.73
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.72	Sun Apr  3 18:41:52 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Sun Apr  3 19:57:08 2005
@@ -1126,7 +1126,9 @@
       Result = PromoteOp(Node->getOperand(0));
       break;
     case Expand:
-      assert(0 && "Cannot handle expand yet");
+      ExpandOp(Node->getOperand(0), Tmp1, Tmp2);
+      // Truncate the low part of the expanded value to the result type
+      Result = DAG.getNode(ISD::TRUNCATE, VT, Tmp1); 
     }
     break;
   case ISD::SIGN_EXTEND:






More information about the llvm-commits mailing list