From 86f43eab8b8d05e406390f6c9bee4826e81a2617 Mon Sep 17 00:00:00 2001 From: Hongbin Zheng Date: Sat, 20 Feb 2016 03:40:15 +0000 Subject: [PATCH] Assign meaningful name to MemoryAccess. NFC Now the name of MemoryAccess is _[Read|Write|MayWrite]_, e.g. Stmt_for_body_4_Read0_MemRef_A llvm-svn: 261401 --- polly/include/polly/ScopInfo.h | 1 + polly/lib/Analysis/ScopInfo.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 4c75466..84af573 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -1155,6 +1155,7 @@ public: iterator end() { return MemAccs.end(); } const_iterator begin() const { return MemAccs.begin(); } const_iterator end() const { return MemAccs.end(); } + size_t size() const { return MemAccs.size(); } unsigned getNumParams() const; unsigned getNumIterators() const; diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 1452586..ab7aa1d 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -775,8 +775,11 @@ MemoryAccess::MemoryAccess(ScopStmt *Stmt, Instruction *AccessInst, AccessValue(AccessValue), IsAffine(Affine), Subscripts(Subscripts.begin(), Subscripts.end()), AccessRelation(nullptr), NewAccessRelation(nullptr) { + static const std::string TypeStrings[] = {"", "_Read", "_Write", "_MayWrite"}; + const std::string Access = TypeStrings[Type] + utostr(Stmt->size()) + "_"; - std::string IdName = "__polly_array_ref"; + std::string IdName = + getIslCompatibleName(Stmt->getBaseName(), Access, BaseName); Id = isl_id_alloc(Stmt->getParent()->getIslCtx(), IdName.c_str(), this); } -- 2.7.4