diff options
| author | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-04-16 08:04:42 +0000 |
|---|---|---|
| committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-04-16 08:04:42 +0000 |
| commit | 8edce4ee6276df36969283bf98b8bef898fb548c (patch) | |
| tree | 5aa55acb4e699d80be44b1257b6309c554daddc1 /polly/lib/CodeGen/CodeGeneration.cpp | |
| parent | 5e77d76c953d915bfbbdc8c719e91e6fbc32e1f1 (diff) | |
| download | llvm-8edce4ee6276df36969283bf98b8bef898fb548c.zip llvm-8edce4ee6276df36969283bf98b8bef898fb548c.tar.gz llvm-8edce4ee6276df36969283bf98b8bef898fb548c.tar.bz2 | |
Support SCoPs with multiple entry edges.
Regions that have multiple entry edges are very common. A simple if condition
yields e.g. such a region:
if
/ \
then else
\ /
for_region
This for_region contains two entry edges 'then' -> 'for_region' and 'else' -> 'for_region'.
Previously we scheduled the RegionSimplify pass to translate such regions into
simple regions. With this patch, we now support them natively when the region is
in -loop-simplify form, which means the entry block should not be a loop header.
Contributed by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 179586
Diffstat (limited to 'polly/lib/CodeGen/CodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/CodeGeneration.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index 833d20b..ad9b6e2 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -986,16 +986,10 @@ public: bool runOnScop(Scop &S) { ParallelLoops.clear(); - Region &R = S.getRegion(); + assert(!S.getRegion().isTopLevelRegion() + && "Top level regions are not supported"); - assert(!R.isTopLevelRegion() && "Top level regions are not supported"); - assert(R.getEnteringBlock() && "Only support regions with a single entry"); - - if (!R.getExitingBlock()) { - BasicBlock *newExit = createSingleExitEdge(&R, this); - for (Region::const_iterator RI = R.begin(), RE = R.end(); RI != RE; ++RI) - (*RI)->replaceExitRecursive(newExit); - } + simplifyRegion(&S, this); BasicBlock *StartBlock = executeScopConditionally(S, this); |
