diff options
| -rwxr-xr-x | polly/include/polly/ScopInfo.h | 6 | ||||
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index d7f608b5804..9fc370ce5ce 100755 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -340,8 +340,10 @@ public: /// @return The BasicBlock represented by this ScopStmt. BasicBlock *getBasicBlock() const { return BB; } - MemoryAccess &getAccessFor(const Instruction *Inst) { - return *InstructionToAccess[Inst]; + const MemoryAccess &getAccessFor(const Instruction *Inst) const { + MemoryAccess *A = lookupAccessFor(Inst); + assert(A && "Cannot get memory access because it does not exist!"); + return *A; } MemoryAccess *lookupAccessFor(const Instruction *Inst) const { diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index c5cd612aa40..a89de743a2c 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -281,7 +281,7 @@ Value *BlockGenerator::generateLocationAccessed(const Instruction *Inst, ValueMapT &BBMap, ValueMapT &GlobalMap, LoopToScevMapT <S) { - MemoryAccess &Access = Statement.getAccessFor(Inst); + const MemoryAccess &Access = Statement.getAccessFor(Inst); isl_map *CurrentAccessRelation = Access.getAccessRelation(); isl_map *NewAccessRelation = Access.getNewAccessRelation(); @@ -494,7 +494,7 @@ void VectorBlockGenerator::generateLoad(const LoadInst *Load, return; } - MemoryAccess &Access = Statement.getAccessFor(Load); + const MemoryAccess &Access = Statement.getAccessFor(Load); Value *NewLoad; if (Access.isStrideZero(isl_map_copy(Schedule))) @@ -542,7 +542,7 @@ void VectorBlockGenerator::copyStore(const StoreInst *Store, VectorValueMapT &ScalarMaps) { int VectorWidth = getVectorWidth(); - MemoryAccess &Access = Statement.getAccessFor(Store); + const MemoryAccess &Access = Statement.getAccessFor(Store); const Value *Pointer = Store->getPointerOperand(); Value *Vector = getVectorValue(Store->getValueOperand(), VectorMap, |

