Index: include/polly/ScopInfo.h =================================================================== --- include/polly/ScopInfo.h +++ include/polly/ScopInfo.h @@ -142,6 +142,12 @@ /// Updated access relation read from JSCOP file. isl_map *newAccessRelation; + /// @brief Other memory effects which are linked to this one. + /// + /// If an instruction can cause multiple memory accesses or effects they are + /// linked together (linked list fashion). + MemoryAccess *NextMA; + void assumeNoOutOfBound(const IRAccess &Access); public: @@ -241,6 +247,12 @@ /// @brief Align the parameters in the access relation to the scop context void realignParams(); + /// @brief Set the next MemoryAccess (linked list fashion). + void setNextMA(MemoryAccess *MA) { NextMA = MA; } + + /// @brief Get the next MemoryAccess (linked list fashion). + MemoryAccess *setNextMA() const { return NextMA; } + /// @brief Print the MemoryAccess. /// /// @param OS The output stream the MemoryAccess is printed to. Index: lib/Analysis/ScopInfo.cpp =================================================================== --- lib/Analysis/ScopInfo.cpp +++ lib/Analysis/ScopInfo.cpp @@ -664,14 +664,11 @@ MemAccs.push_back(new MemoryAccess(Access.first, Access.second, this)); // We do not track locations for scalar memory accesses at the moment. - // - // We do not have a use for this information at the moment. If we need this - // at some point, the "instruction -> access" mapping needs to be enhanced - // as a single instruction could then possibly perform multiple accesses. if (!Access.first.isScalar()) { - assert(!InstructionToAccess.count(Access.second) && - "Unexpected 1-to-N mapping on instruction to access map!"); - InstructionToAccess[Access.second] = MemAccs.back(); + MemoryAccess *&MA = InstructionToAccess[Access.second]; + if (MA) + MemAccs.back()->setNextMA(MA); + MA = MemAccs.back(); } } }