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 | b72773bb88859633c62bc4938d05aafedb1442f1 (patch) | |
tree | 7ef72e30f6793570cfdf84b246ed2df13d75bf5a /lib | |
parent | 06afe070371c5bdcdc76d90d9e13f8532d9f95aa (diff) | |
download | external_llvm-b72773bb88859633c62bc4938d05aafedb1442f1.zip external_llvm-b72773bb88859633c62bc4938d05aafedb1442f1.tar.gz external_llvm-b72773bb88859633c62bc4938d05aafedb1442f1.tar.bz2 |
Fold trunc(any_ext). This gives stuff like:
27,28c27
< movzwl %di, %edi
< movl %edi, %ebx
---
> movw %di, %bx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 1175f52..b967855 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/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)); |