[PATCH] D62265: [ScopBuilder] Move buildContext function from ScopInfo
Dominik Adamski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 22 11:37:52 PDT 2019
domada created this revision.
domada added a reviewer: Meinersbur.
Herald added a reviewer: bollu.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Move buildContext function from ScopInfo to ScopBuilder.
Repository:
rPLO Polly
https://reviews.llvm.org/D62265
Files:
polly/include/polly/ScopBuilder.h
polly/include/polly/ScopInfo.h
polly/lib/Analysis/ScopBuilder.cpp
polly/lib/Analysis/ScopInfo.cpp
Index: polly/lib/Analysis/ScopInfo.cpp
===================================================================
--- polly/lib/Analysis/ScopInfo.cpp
+++ polly/lib/Analysis/ScopInfo.cpp
@@ -2122,13 +2122,6 @@
}
}
-void Scop::buildContext() {
- isl::space Space = isl::space::params_alloc(getIslCtx(), 0);
- Context = isl::set::universe(Space);
- InvalidContext = isl::set::empty(Space);
- AssumedContext = isl::set::universe(Space);
-}
-
void Scop::addParameterBounds() {
unsigned PDim = 0;
for (auto *Parameter : Parameters) {
@@ -3273,7 +3266,6 @@
ID(getNextID((*R.getEntry()->getParent()).getName().str())) {
if (IslOnErrorAbort)
isl_options_set_on_error(getIslCtx().get(), ISL_ON_ERROR_ABORT);
- buildContext();
}
Scop::~Scop() = default;
Index: polly/lib/Analysis/ScopBuilder.cpp
===================================================================
--- polly/lib/Analysis/ScopBuilder.cpp
+++ polly/lib/Analysis/ScopBuilder.cpp
@@ -105,6 +105,13 @@
"Store-level granularity")),
cl::init(GranularityChoice::ScalarIndependence), cl::cat(PollyCategory));
+void ScopBuilder::buildContext() {
+ isl::space Space = isl::space::params_alloc(scop->getIslCtx(), 0);
+ scop->Context = isl::set::universe(Space);
+ scop->InvalidContext = isl::set::empty(Space);
+ scop->AssumedContext = isl::set::universe(Space);
+}
+
void ScopBuilder::buildPHIAccesses(ScopStmt *PHIStmt, PHINode *PHI,
Region *NonAffineSubRegion,
bool IsExitBlock) {
@@ -1435,6 +1442,8 @@
OptimizationRemarkEmitter &ORE) {
scop.reset(new Scop(R, SE, LI, DT, *SD.getDetectionContext(&R), ORE));
+ buildContext();
+
buildStmts(R);
// Create all invariant load instructions first. These are categorized as
Index: polly/include/polly/ScopInfo.h
===================================================================
--- polly/include/polly/ScopInfo.h
+++ polly/include/polly/ScopInfo.h
@@ -2127,9 +2127,6 @@
/// Create an id for @p Param and store it in the ParameterIds map.
void createParameterId(const SCEV *Param);
- /// Build the Context of the Scop.
- void buildContext();
-
/// Add user provided parameter constraints to context (source code).
void addUserAssumptions(AssumptionCache &AC, DominatorTree &DT, LoopInfo &LI,
DenseMap<BasicBlock *, isl::set> &InvalidDomainMap);
Index: polly/include/polly/ScopBuilder.h
===================================================================
--- polly/include/polly/ScopBuilder.h
+++ polly/include/polly/ScopBuilder.h
@@ -120,6 +120,9 @@
void buildScop(Region &R, AssumptionCache &AC,
OptimizationRemarkEmitter &ORE);
+ /// Build the Context of the Scop.
+ void buildContext();
+
/// Try to build a multi-dimensional fixed sized MemoryAccess from the
/// Load/Store instruction.
///
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62265.200780.patch
Type: text/x-patch
Size: 2946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190522/b2c30e9d/attachment.bin>
More information about the llvm-commits
mailing list