diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-01 15:17:58 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-01 15:17:58 +0000 |
commit | 443b5bd0f31b03467c48502e164ebaf576abaaab (patch) | |
tree | 1aef56baeb80db4ce76b5b5c6737e4032b43b5dc /gcc/sese.c | |
parent | 75f966f746563c5ea158c137b9135e3c384d1661 (diff) | |
download | gcc-443b5bd0f31b03467c48502e164ebaf576abaaab.tar.gz |
call scev analysis in scop-detection as in sese-to-poly
Before our rewrite of the scop detection, we used to not have a valid SESE
region under hand, and so we used to do more ad-hoc analysis of data references
by trying to prove that at all levels of a loop nest the data references would
be still valid.
Now that we have a valid SESE region, we can call the scev analysis in the same
way on the same computed loop nest in the scop-detection as in the sese-to-poly.
Next step will be to cache the data references analyzed in the scop detection
and not compute the same info in sese-to-poly.
The patch fixes block-1.f90 that used to ICE on x86_64-linux when compiled with
-m32. Patch passed bootstrap with BOOT_CFLAGS="-g -O2 -fgraphite-identity
-floop-nest-optimize" and check on x86_64-linux using ISL-0.15.
2015-09-28 Sebastian Pop <s.pop@samsung.com>
Aditya Kumar <aditya.k7@samsung.com>
PR tree-optimization/67754
* graphite-scop-detection.c (stmt_has_simple_data_refs_p): Call
scev analysis on the same loop nest as analyze_drs_in_stmts.
* graphite-sese-to-poly.c (outermost_loop_in_sese_1): Moved and renamed...
(try_generate_gimple_bb): Call outermost_loop_in_sese.
(analyze_drs_in_stmts): Same.
* sese.c (outermost_loop_in_sese): ...here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sese.c')
-rw-r--r-- | gcc/sese.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/sese.c b/gcc/sese.c index ed45410fadd..803f519c1f5 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -615,7 +615,7 @@ copy_bb_and_scalar_dependences (basic_block bb, sese region, /* Returns the outermost loop in SCOP that contains BB. */ struct loop * -outermost_loop_in_sese (sese region, basic_block bb) +outermost_loop_in_sese_1 (sese region, basic_block bb) { struct loop *nest; @@ -627,6 +627,32 @@ outermost_loop_in_sese (sese region, basic_block bb) return nest; } +/* Same as outermost_loop_in_sese_1, returns the outermost loop + containing BB in REGION, but makes sure that the returned loop + belongs to the REGION, and so this returns the first loop in the + REGION when the loop containing BB does not belong to REGION. */ + +loop_p +outermost_loop_in_sese (sese region, basic_block bb) +{ + loop_p nest = outermost_loop_in_sese_1 (region, bb); + + if (loop_in_sese_p (nest, region)) + return nest; + + /* When the basic block BB does not belong to a loop in the region, + return the first loop in the region. */ + nest = nest->inner; + while (nest) + if (loop_in_sese_p (nest, region)) + break; + else + nest = nest->next; + + gcc_assert (nest); + return nest; +} + /* Sets the false region of an IF_REGION to REGION. */ void |