diff options
author | James Y Knight <jyknight@google.com> | 2015-10-09 20:10:14 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2015-10-09 20:10:14 +0000 |
commit | 5b8217bc054f19b3f08f8d711151ca0053663e4c (patch) | |
tree | 0bab9acc6b80317c98944281461713641f178f5b /llvm/test | |
parent | a6e8ebb0d9f45a7e56dc82a814210784b5e891c0 (diff) | |
download | bcm5719-llvm-5b8217bc054f19b3f08f8d711151ca0053663e4c.tar.gz bcm5719-llvm-5b8217bc054f19b3f08f8d711151ca0053663e4c.zip |
Fix assert in X86 backend.
When running combine on an extract_vector_elt, it wants to look through
a bitcast to check if the argument to the bitcast was itself an
extract_vector_elt with particular operands.
However, it called getOperand() on the argument to the bitcast *before*
checking that the opcode was EXTRACT_VECTOR_ELT, assert-failing if there
were zero operands for the actual opcode.
Fix, and add trivial test.
llvm-svn: 249891
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/Generic/vector.ll | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Generic/vector.ll b/llvm/test/CodeGen/Generic/vector.ll index 962b1295b5d..2d4dc501a53 100644 --- a/llvm/test/CodeGen/Generic/vector.ll +++ b/llvm/test/CodeGen/Generic/vector.ll @@ -156,3 +156,9 @@ define <2 x i32*> @vector_gep(<2 x [3 x {i32, i32}]*> %a) { %w = getelementptr [3 x {i32, i32}], <2 x [3 x {i32, i32}]*> %a, <2 x i32> <i32 1, i32 2>, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 1, i32 1> ret <2 x i32*> %w } + +define i32 @extractelt_constant_bitcast() { + %1 = bitcast i64 4 to <2 x i32> + %2 = extractelement <2 x i32> %1, i32 0 + ret i32 %2 +} |