summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-05 22:56:26 +0000
committerChris Lattner <sabre@nondot.org>2006-05-05 22:56:26 +0000
commitb72773bb88859633c62bc4938d05aafedb1442f1 (patch)
tree7ef72e30f6793570cfdf84b246ed2df13d75bf5a /lib/CodeGen
parent06afe070371c5bdcdc76d90d9e13f8532d9f95aa (diff)
downloadllvm-b72773bb88859633c62bc4938d05aafedb1442f1.tar.gz
llvm-b72773bb88859633c62bc4938d05aafedb1442f1.tar.bz2
llvm-b72773bb88859633c62bc4938d05aafedb1442f1.tar.xz
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/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 1175f527ac..b967855eee 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));