diff options
author | Chris Lattner <sabre@nondot.org> | 2006-05-05 22:56:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-05-05 22:56:26 +0000 |
commit | 907e392dba70942766dcfed98dc2e9c56bdf10e5 (patch) | |
tree | e435e01ee3233a14ec016fa12fe6de459093c796 /llvm/lib | |
parent | 57f8c5a3874f6062f17e7c7e8f602ea042acb159 (diff) | |
download | bcm5719-llvm-907e392dba70942766dcfed98dc2e9c56bdf10e5.tar.gz bcm5719-llvm-907e392dba70942766dcfed98dc2e9c56bdf10e5.zip |
Fold trunc(any_ext). This gives stuff like:
27,28c27
< movzwl %di, %edi
< movl %edi, %ebx
---
> movw %di, %bx
llvm-svn: 28137
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 1175f527acb..b967855eeeb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2005,7 +2005,8 @@ SDOperand DAGCombiner::visitTRUNCATE(SDNode *N) { 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)); |