[PATCH] LoopVectorizer: Don't attempt to vectorize extractelement instructions

Hal Finkel hfinkel at anl.gov
Fri Oct 25 13:01:11 PDT 2013


Nadav, Arnold,

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. Later passes (or the verifier) would then crash.

We could teach the vectorizer to handle this case when vectorizing, but I think that might be a task better associated with a larger effort in vectorizing vectorized loops. Please review.

Thanks again,
Hal

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list