aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2010-02-01 19:03:18 +0000
committerMon P Wang <wangmp@apple.com>2010-02-01 19:03:18 +0000
commitc6654ec498698919ae8388c53fe91d0366ac24c7 (patch)
treec3608b4f5d1cf0405958b6e73288a8c83a750884 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parenta00ef1122c6364c7f54a1c428654fea5d9097e56 (diff)
downloadexternal_llvm-c6654ec498698919ae8388c53fe91d0366ac24c7.zip
external_llvm-c6654ec498698919ae8388c53fe91d0366ac24c7.tar.gz
external_llvm-c6654ec498698919ae8388c53fe91d0366ac24c7.tar.bz2
Fixed a couple of optimization with EXTRACT_VECTOR_ELT that assumes the result
type is the same as the element type of the vector. EXTRACT_VECTOR_ELT can be used to extended the width of an integer type. This fixes a bug for Generic/vector-casts.ll on a ppc750. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 4f26cde..2e92f8f 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2765,7 +2765,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
// operations are lowered to scalars.
if (N1.getOpcode() == ISD::INSERT_VECTOR_ELT) {
// If the indices are the same, return the inserted element.
- if (N1.getOperand(2) == N2)
+ if (N1.getOperand(2) == N2 && VT == N1.getOperand(1).getValueType())
return N1.getOperand(1);
// If the indices are known different, extract the element from
// the original vector.