diff options
author | Bob Wilson <bob.wilson@apple.com> | 2011-10-18 17:34:47 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2011-10-18 17:34:47 +0000 |
commit | 681561901dbb9804c9eded96363971a49da6a747 (patch) | |
tree | ebc7a492a1fde289f0882b5e045cca684de54879 /llvm/test/CodeGen/ARM/vector-DAGCombine.ll | |
parent | 06ac75c8e330214c552ffc445485daa684877ec3 (diff) | |
download | bcm5719-llvm-681561901dbb9804c9eded96363971a49da6a747.tar.gz bcm5719-llvm-681561901dbb9804c9eded96363971a49da6a747.zip |
Fix a DAG combiner assertion failure when constant folding BUILD_VECTORS.
svn r139159 caused SelectionDAG::getConstant() to promote BUILD_VECTOR operands
with illegal types, even before type legalization. For this testcase, that led
to one BUILD_VECTOR with i16 operands and another with promoted i32 operands,
which triggered the assertion.
llvm-svn: 142370
Diffstat (limited to 'llvm/test/CodeGen/ARM/vector-DAGCombine.ll')
-rw-r--r-- | llvm/test/CodeGen/ARM/vector-DAGCombine.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/vector-DAGCombine.ll b/llvm/test/CodeGen/ARM/vector-DAGCombine.ll index 81bdc44863b..1a97982eb0a 100644 --- a/llvm/test/CodeGen/ARM/vector-DAGCombine.ll +++ b/llvm/test/CodeGen/ARM/vector-DAGCombine.ll @@ -123,3 +123,13 @@ define void @orVec(<3 x i8>* %A) nounwind { ret void } +; The following test was hitting an assertion in the DAG combiner when +; constant folding the multiply because the "sext undef" was translated to +; a BUILD_VECTOR with i32 0 operands, which did not match the i16 operands +; of the other BUILD_VECTOR. +define i16 @foldBuildVectors() { + %1 = sext <8 x i8> undef to <8 x i16> + %2 = mul <8 x i16> %1, <i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255, i16 255> + %3 = extractelement <8 x i16> %2, i32 0 + ret i16 %3 +} |