mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
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
This commit is contained in:
@@ -2965,8 +2965,9 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
|
||||
}
|
||||
|
||||
// Check that the instruction return type is vectorizable.
|
||||
if (!VectorType::isValidElementType(it->getType()) &&
|
||||
!it->getType()->isVoidTy()) {
|
||||
// Also, we can't vectorize extractelement instructions.
|
||||
if ((!VectorType::isValidElementType(it->getType()) &&
|
||||
!it->getType()->isVoidTy()) || isa<ExtractElementInst>(it)) {
|
||||
DEBUG(dbgs() << "LV: Found unvectorizable type.\n");
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user