diff options
| author | Tobias Grosser <tobias@grosser.es> | 2015-12-15 23:50:01 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2015-12-15 23:50:01 +0000 |
| commit | 184a4926b3f6740ecf4caa97b965ecf883ddf0eb (patch) | |
| tree | a7bc0765d6b184a3a23b4d7764fb3f0263cd76f2 | |
| parent | a69d4f0d83a15e2d2e26d0e2a109693b7138b334 (diff) | |
| download | bcm5719-llvm-184a4926b3f6740ecf4caa97b965ecf883ddf0eb.tar.gz bcm5719-llvm-184a4926b3f6740ecf4caa97b965ecf883ddf0eb.zip | |
BlockGenerator: Use getArrayAccessFor for vector code generation
getAccessFor does not guarantee a certain access to be returned in case an
instruction is related to multiple accesses. However, in the vector code
generation we want to know the stride of the array access of a store
instruction. By using getArrayAccessFor we ensure we always get the correct
memory access.
This patch fixes a potential bug, but I was unable to produce a failing test
case. Several existing test cases cover this code, but all of them already
passed out of luck (or the specific but not-guaranteed order in which we build
memory accesses).
llvm-svn: 255715
| -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 0fe0f28df52..ed1abc114fb 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -776,7 +776,7 @@ void VectorBlockGenerator::generateLoad( return; } - const MemoryAccess &Access = Stmt.getAccessFor(Load); + const MemoryAccess &Access = Stmt.getArrayAccessFor(Load); // Make sure we have scalar values available to access the pointer to // the data location. @@ -828,7 +828,7 @@ void VectorBlockGenerator::copyBinaryInst(ScopStmt &Stmt, BinaryOperator *Inst, void VectorBlockGenerator::copyStore( ScopStmt &Stmt, StoreInst *Store, ValueMapT &VectorMap, VectorValueMapT &ScalarMaps, __isl_keep isl_id_to_ast_expr *NewAccesses) { - const MemoryAccess &Access = Stmt.getAccessFor(Store); + const MemoryAccess &Access = Stmt.getArrayAccessFor(Store); auto *Pointer = Store->getPointerOperand(); Value *Vector = getVectorValue(Stmt, Store->getValueOperand(), VectorMap, |

