[llvm-commits] [polly] r159808 - in /polly/trunk: include/polly/ScopInfo.h lib/Analysis/ScopInfo.cpp

Hongbin Zheng etherzhhb at gmail.com
Thu Jul 5 23:47:03 PDT 2012


Author: ether
Date: Fri Jul  6 01:47:03 2012
New Revision: 159808

URL: http://llvm.org/viewvc/llvm-project?rev=159808&view=rev
Log:
Add an Instruction member to MemoryAccess Class.
  Patched by TangKK <dengjunqi06323011 at hotmail.com>.

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/ScopInfo.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=159808&r1=159807&r2=159808&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Fri Jul  6 01:47:03 2012
@@ -102,6 +102,8 @@
   void setBaseName();
   ScopStmt *statement;
 
+  const Instruction *Inst;
+
   /// Updated access relation read from JSCOP file.
   isl_map *newAccessRelation;
 public:
@@ -110,7 +112,7 @@
   // @param Access     The memory access.
   // @param Statement  The statement that contains the access.
   // @param SE         The ScalarEvolution analysis.
-  MemoryAccess(const IRAccess &Access, ScopStmt *Statement);
+  MemoryAccess(const IRAccess &Access, const Instruction *AccInst, ScopStmt *Statement);
 
   // @brief Create a memory access that reads a complete memory object.
   //
@@ -136,6 +138,10 @@
     return BaseName;
   }
 
+  const Instruction *getAccessInstruction() const {
+    return Inst;
+  }
+
   /// @brief Get the new access function imported from JSCOP file
   isl_map *getNewAccessRelation() const;
 

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=159808&r1=159807&r2=159808&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Fri Jul  6 01:47:03 2012
@@ -276,7 +276,8 @@
     isl_basic_set_universe(Space));
 }
 
-MemoryAccess::MemoryAccess(const IRAccess &Access, ScopStmt *Statement) {
+MemoryAccess::MemoryAccess(const IRAccess &Access, const Instruction *AccInst,
+                           ScopStmt *Statement) : Inst(AccInst) {
   newAccessRelation = NULL;
   Type = Access.isRead() ? Read : Write;
   statement = Statement;
@@ -487,7 +488,7 @@
 
   for (AccFuncSetType::const_iterator I = AccFuncs->begin(),
        E = AccFuncs->end(); I != E; ++I) {
-    MemAccs.push_back(new MemoryAccess(I->first, this));
+    MemAccs.push_back(new MemoryAccess(I->first, I->second, this));
     InstructionToAccess[I->second] = MemAccs.back();
   }
 }





More information about the llvm-commits mailing list