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

Chris Lattner sabre at nondot.org
Mon Nov 20 10:06:01 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.253 -> 1.254
---
Log message:

Fix PR1011: http://llvm.org/PR1011  and CodeGen/Generic/2006-11-20-DAGCombineCrash.ll


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

 DAGCombiner.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.253 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.254
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.253	Wed Nov 15 18:08:20 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Mon Nov 20 12:05:46 2006
@@ -2180,10 +2180,10 @@
   // fold (truncate (ext x)) -> (ext x) or (truncate x) or x
   if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::SIGN_EXTEND||
       N0.getOpcode() == ISD::ANY_EXTEND) {
-    if (N0.getValueType() < VT)
+    if (N0.getOperand(0).getValueType() < VT)
       // if the source is smaller than the dest, we still need an extend
       return DAG.getNode(N0.getOpcode(), VT, N0.getOperand(0));
-    else if (N0.getValueType() > VT)
+    else if (N0.getOperand(0).getValueType() > VT)
       // if the source is larger than the dest, than we just need the truncate
       return DAG.getNode(ISD::TRUNCATE, VT, N0.getOperand(0));
     else






More information about the llvm-commits mailing list