diff options
author | Michael Kruse <llvm-project@meinersbur.de> | 2019-11-12 13:48:07 -0600 |
---|---|---|
committer | Michael Kruse <llvm-project@meinersbur.de> | 2019-11-12 13:58:28 -0600 |
commit | 0aff3174dcc00516fd26c6554266b05a236166bb (patch) | |
tree | ef2606fb110365f5cbb176e6d75cb33418879219 /polly/lib | |
parent | 964842861c8acd53b8df8799f7c3800c5528fb72 (diff) | |
download | bcm5719-llvm-0aff3174dcc00516fd26c6554266b05a236166bb.tar.gz bcm5719-llvm-0aff3174dcc00516fd26c6554266b05a236166bb.zip |
[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
Diffstat (limited to 'polly/lib')
-rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 599ae6cda3d..ca8d80f608c 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -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); } |