forked from OSchip/llvm-project
Add an Instruction member to MemoryAccess Class.
Patched by TangKK <dengjunqi06323011@hotmail.com>. llvm-svn: 159808
This commit is contained in:
parent
cb93f785de
commit
cea35f60d5
|
@ -102,6 +102,8 @@ private:
|
||||||
void setBaseName();
|
void setBaseName();
|
||||||
ScopStmt *statement;
|
ScopStmt *statement;
|
||||||
|
|
||||||
|
const Instruction *Inst;
|
||||||
|
|
||||||
/// Updated access relation read from JSCOP file.
|
/// Updated access relation read from JSCOP file.
|
||||||
isl_map *newAccessRelation;
|
isl_map *newAccessRelation;
|
||||||
public:
|
public:
|
||||||
|
@ -110,7 +112,7 @@ public:
|
||||||
// @param Access The memory access.
|
// @param Access The memory access.
|
||||||
// @param Statement The statement that contains the access.
|
// @param Statement The statement that contains the access.
|
||||||
// @param SE The ScalarEvolution analysis.
|
// @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.
|
// @brief Create a memory access that reads a complete memory object.
|
||||||
//
|
//
|
||||||
|
@ -136,6 +138,10 @@ public:
|
||||||
return BaseName;
|
return BaseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Instruction *getAccessInstruction() const {
|
||||||
|
return Inst;
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief Get the new access function imported from JSCOP file
|
/// @brief Get the new access function imported from JSCOP file
|
||||||
isl_map *getNewAccessRelation() const;
|
isl_map *getNewAccessRelation() const;
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,8 @@ isl_basic_map *MemoryAccess::createBasicAccessMap(ScopStmt *Statement) {
|
||||||
isl_basic_set_universe(Space));
|
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;
|
newAccessRelation = NULL;
|
||||||
Type = Access.isRead() ? Read : Write;
|
Type = Access.isRead() ? Read : Write;
|
||||||
statement = Statement;
|
statement = Statement;
|
||||||
|
@ -487,7 +488,7 @@ void ScopStmt::buildAccesses(TempScop &tempScop, const Region &CurRegion) {
|
||||||
|
|
||||||
for (AccFuncSetType::const_iterator I = AccFuncs->begin(),
|
for (AccFuncSetType::const_iterator I = AccFuncs->begin(),
|
||||||
E = AccFuncs->end(); I != E; ++I) {
|
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();
|
InstructionToAccess[I->second] = MemAccs.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue