diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-20 18:05:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-20 18:05:46 +0000 |
commit | 3676a994ca9dc82a23d67ebefa633780c932ad8b (patch) | |
tree | a68a67c34ca2583a9186a814a64468cc4f91c243 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | bffbec44828003a7ba0d1108c88d5b6563bb776c (diff) | |
download | bcm5719-llvm-3676a994ca9dc82a23d67ebefa633780c932ad8b.tar.gz bcm5719-llvm-3676a994ca9dc82a23d67ebefa633780c932ad8b.zip |
Fix PR1011 and CodeGen/Generic/2006-11-20-DAGCombineCrash.ll
llvm-svn: 31878
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index b74fbaece58..44990690b5d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2180,10 +2180,10 @@ SDOperand DAGCombiner::visitTRUNCATE(SDNode *N) { // 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 |