OSDN Git Service

Fix assert in X86 backend.
authorJames Y Knight <jyknight@google.com>
Fri, 9 Oct 2015 20:10:14 +0000 (20:10 +0000)
committerJames Y Knight <jyknight@google.com>
Fri, 9 Oct 2015 20:10:14 +0000 (20:10 +0000)
commitbf3b1ac771196ea2d89e44ffb82815ac7df9e50b
treed957cfefce07d9767fd364a506e98fbd4a2575ac
parent262f354157a7e5349d9eee15e0636eba034d640e
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249891 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/Generic/vector.ll