mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
[CodeGen] Fix getArrayAccessFor crashes as in bug 32534 with -polly-vectorizer=polly.
Root cause is VectorBlockGenerator::copyStmt iterates all instructions in basic block, however some load instructions may be not unnecessary thus removed by simplification. As a result, these load instructions don't have a corresponding array. Looking at BlockGenerator::copyBB, it only iterates instructions list of ScopStmt. Given it must be a block type scop in case of vectorization, I think we should do the same in VectorBlockGenerator::copyStmt. Patch by bin.narwal <bin.narwal@gmail.com> Differential Revision: https://reviews.llvm.org/D70076
This commit is contained in:
@@ -1391,8 +1391,8 @@ void VectorBlockGenerator::copyStmt(
|
||||
|
||||
generateScalarVectorLoads(Stmt, VectorBlockMap);
|
||||
|
||||
for (Instruction &Inst : *BB)
|
||||
copyInstruction(Stmt, &Inst, VectorBlockMap, ScalarBlockMap, NewAccesses);
|
||||
for (Instruction *Inst : Stmt.getInstructions())
|
||||
copyInstruction(Stmt, Inst, VectorBlockMap, ScalarBlockMap, NewAccesses);
|
||||
|
||||
verifyNoScalarStores(Stmt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user