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

Chris Lattner lattner at cs.uiuc.edu
Fri May 5 15:56:38 PDT 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.158 -> 1.159
---
Log message:

Fold trunc(any_ext).  This gives stuff like:

27,28c27
<       movzwl %di, %edi
<       movl %edi, %ebx
---
>       movw %di, %bx



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

 DAGCombiner.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.158 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.159
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.158	Fri May  5 17:53:17 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Fri May  5 17:56:26 2006
@@ -2005,7 +2005,8 @@
   if (N0.getOpcode() == ISD::TRUNCATE)
     return DAG.getNode(ISD::TRUNCATE, VT, N0.getOperand(0));
   // fold (truncate (ext x)) -> (ext x) or (truncate x) or x
-  if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::SIGN_EXTEND){
+  if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::SIGN_EXTEND||
+      N0.getOpcode() == ISD::ANY_EXTEND) {
     if (N0.getValueType() < VT)
       // if the source is smaller than the dest, we still need an extend
       return DAG.getNode(N0.getOpcode(), VT, N0.getOperand(0));






More information about the llvm-commits mailing list