summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis/ScopBuilder.cpp')
-rw-r--r--polly/lib/Analysis/ScopBuilder.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index 44aec902c41..3c7f67be0ec 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -103,7 +103,7 @@ static cl::opt<bool> DisableMultiplicativeReductions(
cl::desc("Disable multiplicative reductions"), cl::Hidden, cl::ZeroOrMore,
cl::init(false), cl::cat(PollyCategory));
-enum class GranularityChoice { BasicBlocks, ScalarIndependence };
+enum class GranularityChoice { BasicBlocks, ScalarIndependence, Stores };
static cl::opt<GranularityChoice> StmtGranularity(
"polly-stmt-granularity",
@@ -112,7 +112,9 @@ static cl::opt<GranularityChoice> StmtGranularity(
cl::values(clEnumValN(GranularityChoice::BasicBlocks, "bb",
"One statement per basic block"),
clEnumValN(GranularityChoice::ScalarIndependence, "scalar-indep",
- "Scalar independence heuristic")),
+ "Scalar independence heuristic"),
+ clEnumValN(GranularityChoice::Stores, "store",
+ "Store-level granularity")),
cl::init(GranularityChoice::BasicBlocks), cl::cat(PollyCategory));
void ScopBuilder::buildPHIAccesses(ScopStmt *PHIStmt, PHINode *PHI,
@@ -686,7 +688,7 @@ bool ScopBuilder::shouldModelInst(Instruction *Inst, Loop *L) {
!canSynthesize(Inst, *scop, &SE, L);
}
-void ScopBuilder::buildSequentialBlockStmts(BasicBlock *BB) {
+void ScopBuilder::buildSequentialBlockStmts(BasicBlock *BB, bool SplitOnStore) {
Loop *SurroundingLoop = LI.getLoopFor(BB);
int Count = 0;
@@ -694,7 +696,8 @@ void ScopBuilder::buildSequentialBlockStmts(BasicBlock *BB) {
for (Instruction &Inst : *BB) {
if (shouldModelInst(&Inst, SurroundingLoop))
Instructions.push_back(&Inst);
- if (Inst.getMetadata("polly_split_after")) {
+ if (Inst.getMetadata("polly_split_after") ||
+ (SplitOnStore && isa<StoreInst>(Inst))) {
scop->addScopStmt(BB, SurroundingLoop, Instructions, Count);
Count++;
Instructions.clear();
@@ -900,6 +903,9 @@ void ScopBuilder::buildStmts(Region &SR) {
case GranularityChoice::ScalarIndependence:
buildEqivClassBlockStmts(BB);
break;
+ case GranularityChoice::Stores:
+ buildSequentialBlockStmts(BB, true);
+ break;
}
}
}
OpenPOWER on IntegriCloud