construct pet_scop from intermediate pet_tree data structure
commit242226495650be1395ccbe12de42c047e4eb6236
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 31 Dec 2013 11:00:45 +0000 (31 12:00 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 25 Mar 2014 13:33:11 +0000 (25 14:33 +0100)
tree68490d858a1efcc9057375b5a07b1f4871069388
parenta6706e1b674bedfc375be00660671d4d0528a599
construct pet_scop from intermediate pet_tree data structure

In particular, break up the extraction of a pet_scop into two phases,
a first phase that detects the part of the clang AST that can be
converted to a polyhedral model and a second phase that performs
the actual construction of the pet_scop.
The first phase constructs a pet_tree from the bottom up,
collecting all the information extracted during this first phase.
An alternative would have been to recompute this information
in the second phase, but this would have required further
refactorings to make the extraction of this information
callable from different contexts.
An additional advantage of the separate data structure is
that it makes the second phase largely independent of the
clang AST.

The second phase currently also works bottom-up, but one of
the main motivations of breaking up the extraction into two phases
is that we can later transform the second phase into a top-down process.
This will then allow us to exploit context information during
the construction of the pet_scop.

We try to stay as close as possible to the original implementation
in this commit.  However, the sequence number in the statement level
dimensions of the schedule is no longer derived from the sequence number
in the StmtRange, but from the sequence number
in the actually extracted statements.  This only has an effect
when autodetection is turned on since we may then choose
to only extract part of a range of statements.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
16 files changed:
Makefile.am
scan.cc
scan.h
state.h [new file with mode: 0644]
tests/autodetect/decl.scop
tests/autodetect/if1.scop
tests/autodetect/if2.scop
tests/autodetect/if3.scop
tests/autodetect/loop1.scop
tests/autodetect/loop2.scop
tests/autodetect/loop3.scop
tests/autodetect/loop4.scop
tests/autodetect/loop5.scop
tests/autodetect/scalar.scop
tests/autodetect/while.scop
tree2scop.h [new file with mode: 0644]