Scop *scop;
isl_ctx *ctx;
- /// @brief Return the SCoP region that is currently processed.
- Region *getRegion() const {
- if (!scop)
- return nullptr;
- return &scop->getRegion();
- }
-
// Clear the context.
void clear();
/// @brief Create ScopStmt for all BBs and non-affine subregions of @p SR.
///
+ /// @param R The SCoP region.
+ /// @param SR A subregion of @p R.
+ ///
/// Some of the statments might be optimized away later when they do not
/// access any memory and thus have no effect.
- void buildStmts(Region &SR);
+ void buildStmts(Region &R, Region &SR);
/// @brief Build the access functions for the basic block @p BB
///
buildAccessFunctions(R, *I->getNodeAs<BasicBlock>());
}
-void ScopInfo::buildStmts(Region &SR) {
- Region *R = getRegion();
+void ScopInfo::buildStmts(Region &R, Region &SR) {
- if (SD->isNonAffineSubRegion(&SR, R)) {
+ if (SD->isNonAffineSubRegion(&SR, &R)) {
scop->addScopStmt(nullptr, &SR);
return;
}
for (auto I = SR.element_begin(), E = SR.element_end(); I != E; ++I)
if (I->isSubRegion())
- buildStmts(*I->getNodeAs<Region>());
+ buildStmts(R, *I->getNodeAs<Region>());
else
scop->addScopStmt(I->getNodeAs<BasicBlock>(), nullptr);
}
unsigned MaxLoopDepth = getMaxLoopDepthInRegion(R, *LI, *SD);
scop = new Scop(R, AccFuncMap, *SD, *SE, *DT, *LI, ctx, MaxLoopDepth);
- buildStmts(R);
+ buildStmts(R, R);
buildAccessFunctions(R, R);
// In case the region does not have an exiting block we will later (during