Add an Instruction member to MemoryAccess Class.

Patched by TangKK <dengjunqi06323011@hotmail.com>.

llvm-svn: 159808
This commit is contained in:
Hongbin Zheng 2012-07-06 06:47:03 +00:00
parent cb93f785de
commit cea35f60d5
2 changed files with 10 additions and 3 deletions

View File

@ -102,6 +102,8 @@ private:
void setBaseName();
ScopStmt *statement;
const Instruction *Inst;
/// Updated access relation read from JSCOP file.
isl_map *newAccessRelation;
public:
@ -110,7 +112,7 @@ public:
// @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 @@ public:
return BaseName;
}
const Instruction *getAccessInstruction() const {
return Inst;
}
/// @brief Get the new access function imported from JSCOP file
isl_map *getNewAccessRelation() const;

View File

@ -276,7 +276,8 @@ isl_basic_map *MemoryAccess::createBasicAccessMap(ScopStmt *Statement) {
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 @@ void ScopStmt::buildAccesses(TempScop &tempScop, const Region &CurRegion) {
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();
}
}