Assign meaningful name to MemoryAccess. NFC
authorHongbin Zheng <etherzhhb@gmail.com>
Sat, 20 Feb 2016 03:40:15 +0000 (03:40 +0000)
committerHongbin Zheng <etherzhhb@gmail.com>
Sat, 20 Feb 2016 03:40:15 +0000 (03:40 +0000)
Now the name of MemoryAccess is <StatementName>_[Read|Write|MayWrite]<Number>_<BaseName>,
e.g. Stmt_for_body_4_Read0_MemRef_A

llvm-svn: 261401

polly/include/polly/ScopInfo.h
polly/lib/Analysis/ScopInfo.cpp

index 4c75466..84af573 100644 (file)
@@ -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;
index 1452586..ab7aa1d 100644 (file)
@@ -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);
 }