public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/slp-function-v2)] Introduce flag_cunroll_grow_size for cunroll
@ 2020-06-11 9:59 Martin Liska
0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2020-06-11 9:59 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:71489d8e7572388c6e9528a45e4942b7c7b67e4f
commit 71489d8e7572388c6e9528a45e4942b7c7b67e4f
Author: guojiufu <guojiufu@linux.ibm.com>
Date: Thu May 28 13:42:23 2020 +0800
Introduce flag_cunroll_grow_size for cunroll
Currently GIMPLE complete unroller(cunroll) is checking
flag_unroll_loops and flag_peel_loops to see if allow size growth.
Beside affects curnoll, flag_unroll_loops also controls RTL unroler.
To have more freedom to control cunroll and RTL unroller, this patch
introduces flag_cunroll_grow_size. With this patch, we can control
cunroll and RTL unroller indepently.
gcc/ChangeLog
2020-06-07 Jiufu Guo <guojiufu@linux.ibm.com>
* common.opt (flag_cunroll_grow_size): New flag.
* toplev.c (process_options): Set flag_cunroll_grow_size.
* tree-ssa-loop-ivcanon.c (pass_complete_unroll::execute):
Use flag_cunroll_grow_size.
Diff:
---
gcc/common.opt | 4 ++++
gcc/toplev.c | 5 +++++
gcc/tree-ssa-loop-ivcanon.c | 5 ++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index 1b770bc11a9..df8af365d1b 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2863,6 +2863,10 @@ funroll-all-loops
Common Report Var(flag_unroll_all_loops) Optimization
Perform loop unrolling for all loops.
+funroll-completely-grow-size
+Undocumented Var(flag_cunroll_grow_size) Init(2) Optimization
+; Internal undocumented flag, allow size growth during complete unrolling
+
; Nonzero means that loop optimizer may assume that the induction variables
; that control loops do not overflow and that the loops with nontrivial
; exit condition are not infinite
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 1a75485f574..95eea63380f 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1482,6 +1482,11 @@ process_options (void)
if (flag_unroll_all_loops)
flag_unroll_loops = 1;
+ /* Allow cunroll to grow size accordingly. */
+ if (flag_cunroll_grow_size == AUTODETECT_VALUE)
+ flag_cunroll_grow_size
+ = flag_unroll_loops || flag_peel_loops || optimize >= 3;
+
/* web and rename-registers help when run after loop unrolling. */
if (flag_web == AUTODETECT_VALUE)
flag_web = flag_unroll_loops;
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 8ab6ab3330c..298ab215530 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -1603,9 +1603,8 @@ pass_complete_unroll::execute (function *fun)
re-peeling the same loop multiple times. */
if (flag_peel_loops)
peeled_loops = BITMAP_ALLOC (NULL);
- unsigned int val = tree_unroll_loops_completely (flag_unroll_loops
- || flag_peel_loops
- || optimize >= 3, true);
+ unsigned int val = tree_unroll_loops_completely (flag_cunroll_grow_size,
+ true);
if (peeled_loops)
{
BITMAP_FREE (peeled_loops);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-11 9:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 9:59 [gcc(refs/users/marxin/heads/slp-function-v2)] Introduce flag_cunroll_grow_size for cunroll Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).