LoopVectorizer: Don't attempt to vectorize extractelement instructions
authorHal Finkel <hfinkel@anl.gov>
Fri, 25 Oct 2013 20:40:15 +0000 (20:40 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 25 Oct 2013 20:40:15 +0000 (20:40 +0000)
commit006183a9364660daba786d352df720e079412d60
tree3230591282fa4be644177cc652f3699b4d881ad3
parent7c0c2e56b09fee406ca0bb6e3ac840a3a6ed1160
LoopVectorizer: Don't attempt to vectorize extractelement instructions

The loop vectorizer does not currently understand how to vectorize
extractelement instructions. The existing check, which excluded all
vector-valued instructions, did not catch extractelement instructions because
it checked only the return value. As a result, vectorization would proceed,
producing illegal instructions like this:

  %58 = extractelement <2 x i32> %15, i32 0
  %59 = extractelement i32 %58, i32 0

where the second extractelement is illegal because its first operand is not a vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193434 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/ee-crash.ll [new file with mode: 0644]