forked from OSchip/llvm-project
ScopInfo: Get the isl_ctx always with getIslCtx()
llvm-svn: 141254
This commit is contained in:
parent
0e27e24751
commit
3c69fab0e8
|
@ -282,7 +282,7 @@ public:
|
|||
~ScopStmt();
|
||||
|
||||
/// @brief Get an isl_ctx pointer.
|
||||
isl_ctx *getIslContext();
|
||||
isl_ctx *getIslCtx() const;
|
||||
|
||||
/// @brief Get the iteration domain of this ScopStmt.
|
||||
///
|
||||
|
@ -536,7 +536,7 @@ public:
|
|||
/// @brief Get the isl context of this static control part.
|
||||
///
|
||||
/// @return The isl context of this static control part.
|
||||
isl_ctx *getCtx() const;
|
||||
isl_ctx *getIslCtx() const;
|
||||
};
|
||||
|
||||
/// @brief Print Scop scop to raw_ostream O.
|
||||
|
|
|
@ -302,7 +302,7 @@ bool Dependences::isParallelDimension(isl_set *loopDomain,
|
|||
|
||||
isl_union_set *distance_waw = isl_union_map_deltas(restrictedDeps_waw);
|
||||
|
||||
isl_space *Space = isl_space_set_alloc(S->getCtx(), 0, parallelDimension);
|
||||
isl_space *Space = isl_space_set_alloc(S->getIslCtx(), 0, parallelDimension);
|
||||
|
||||
// [0, 0, 0, 0] - All zero
|
||||
isl_basic_set *allZeroBS = isl_basic_set_universe(isl_space_copy(Space));
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
}
|
||||
|
||||
SCEVAffinator(const ScopStmt *stmt, const Value *baseAddress) :
|
||||
ctx(stmt->getParent()->getCtx()),
|
||||
ctx(stmt->getIslCtx()),
|
||||
NbLoopSpaces(stmt->getNumIterators()),
|
||||
scop(stmt->getParent()),
|
||||
baseAddress(baseAddress) {};
|
||||
|
@ -300,7 +300,7 @@ std::string MemoryAccess::getAccessFunctionStr() const {
|
|||
}
|
||||
|
||||
isl_basic_map *MemoryAccess::createBasicAccessMap(ScopStmt *Statement) {
|
||||
isl_space *Space = isl_space_alloc(Statement->getIslContext(), 0,
|
||||
isl_space *Space = isl_space_alloc(Statement->getIslCtx(), 0,
|
||||
Statement->getNumIterators(), 1);
|
||||
setBaseName();
|
||||
|
||||
|
@ -520,7 +520,7 @@ void ScopStmt::setScattering(isl_map *scattering) {
|
|||
void ScopStmt::buildScattering(SmallVectorImpl<unsigned> &Scatter) {
|
||||
unsigned NumberOfIterators = getNumIterators();
|
||||
unsigned ScatSpace = Parent.getMaxLoopDepth() * 2 + 1;
|
||||
isl_space *Space = isl_space_alloc(Parent.getCtx(), 0, NumberOfIterators,
|
||||
isl_space *Space = isl_space_alloc(getIslCtx(), 0, NumberOfIterators,
|
||||
ScatSpace);
|
||||
Space = isl_space_set_tuple_name(Space, isl_dim_out, "scattering");
|
||||
Space = isl_space_set_tuple_name(Space, isl_dim_in, getBaseName());
|
||||
|
@ -637,7 +637,7 @@ isl_set *ScopStmt::toUpperLoopBound(const SCEVAffFunc &UpperBound,
|
|||
}
|
||||
|
||||
void ScopStmt::buildIterationDomainFromLoops(TempScop &tempScop) {
|
||||
isl_space *Space = isl_space_set_alloc(getIslContext(), 0, getNumIterators());
|
||||
isl_space *Space = isl_space_set_alloc(getIslCtx(), 0, getNumIterators());
|
||||
Space = isl_space_set_tuple_name(Space, isl_dim_set, getBaseName());
|
||||
|
||||
Domain = isl_set_universe(isl_space_copy(Space));
|
||||
|
@ -734,14 +734,13 @@ ScopStmt::ScopStmt(Scop &parent, SmallVectorImpl<unsigned> &Scatter)
|
|||
|
||||
// Build iteration domain.
|
||||
std::string IterationDomainString = "{[i0] : i0 = 0}";
|
||||
Domain = isl_set_read_from_str(Parent.getCtx(),
|
||||
IterationDomainString.c_str());
|
||||
Domain = isl_set_read_from_str(getIslCtx(), IterationDomainString.c_str());
|
||||
Domain = isl_set_set_tuple_name(Domain, getBaseName());
|
||||
Domain = isl_set_align_params(Domain, parent.getParamSpace());
|
||||
|
||||
// Build scattering.
|
||||
unsigned ScatSpace = Parent.getMaxLoopDepth() * 2 + 1;
|
||||
isl_space *Space = isl_space_alloc(Parent.getCtx(), 0, 1, ScatSpace);
|
||||
isl_space *Space = isl_space_alloc(getIslCtx(), 0, 1, ScatSpace);
|
||||
Space = isl_space_set_tuple_name(Space, isl_dim_out, "scattering");
|
||||
Space = isl_space_set_tuple_name(Space, isl_dim_in, getBaseName());
|
||||
isl_basic_map *bmap = isl_basic_map_universe(isl_space_copy(Space));
|
||||
|
@ -825,8 +824,8 @@ const SCEVAddRecExpr *ScopStmt::getSCEVForDimension(unsigned Dimension)
|
|||
return cast<SCEVAddRecExpr>(getParent()->getSE()->getSCEV(PN));
|
||||
}
|
||||
|
||||
isl_ctx *ScopStmt::getIslContext() {
|
||||
return Parent.getCtx();
|
||||
isl_ctx *ScopStmt::getIslCtx() const {
|
||||
return Parent.getIslCtx();
|
||||
}
|
||||
|
||||
isl_set *ScopStmt::getDomain() const {
|
||||
|
@ -970,7 +969,7 @@ void Scop::print(raw_ostream &OS) const {
|
|||
|
||||
void Scop::dump() const { print(dbgs()); }
|
||||
|
||||
isl_ctx *Scop::getCtx() const { return isl_set_get_ctx(Context); }
|
||||
isl_ctx *Scop::getIslCtx() const { return isl_set_get_ctx(Context); }
|
||||
|
||||
ScalarEvolution *Scop::getSE() const { return SE; }
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ bool ScopPass::runOnRegion(Region *R, RGPassManager &RGM) {
|
|||
|
||||
isl_ctx *ScopPass::getIslContext() {
|
||||
assert(S && "Not in on a Scop!");
|
||||
return S->getCtx();
|
||||
return S->getIslCtx();
|
||||
}
|
||||
|
||||
void ScopPass::print(raw_ostream &OS, const Module *M) const {
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
};
|
||||
|
||||
Cloog::Cloog(Scop *Scop) : S(Scop) {
|
||||
State = cloog_isl_state_malloc(Scop->getCtx());
|
||||
State = cloog_isl_state_malloc(Scop->getIslCtx());
|
||||
buildCloogOptions();
|
||||
ClastRoot = cloog_clast_create_from_input(buildCloogInput(), Options);
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ bool JSONImporter::runOnScop(Scop &scop) {
|
|||
continue;
|
||||
Json::Value schedule = jscop["statements"][index]["schedule"];
|
||||
|
||||
isl_map *m = isl_map_read_from_str(S->getCtx(), schedule.asCString());
|
||||
isl_map *m = isl_map_read_from_str(S->getIslCtx(), schedule.asCString());
|
||||
NewScattering[*SI] = m;
|
||||
index++;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ bool JSONImporter::runOnScop(Scop &scop) {
|
|||
ME = Stmt->memacc_end(); MI != ME; ++MI) {
|
||||
Json::Value accesses = jscop["statements"][statementIdx]
|
||||
["accesses"][memoryAccessIdx]["relation"];
|
||||
isl_map *newAccessMap = isl_map_read_from_str(S->getCtx(),
|
||||
isl_map *newAccessMap = isl_map_read_from_str(S->getIslCtx(),
|
||||
accesses.asCString());
|
||||
isl_map *currentAccessMap = (*MI)->getAccessFunction();
|
||||
if (!isl_map_has_equal_space(currentAccessMap, newAccessMap)) {
|
||||
|
|
Loading…
Reference in New Issue