[gcc(refs/users/guojiufu/heads/guojiufu-branch)] unroll param for calls and branches
Jiu Fu Guo
guojiufu@gcc.gnu.org
Mon Jul 20 08:03:47 GMT 2020
https://gcc.gnu.org/g:aabf7bfd48c37c77f01f62a076f22d93b7670f81
commit aabf7bfd48c37c77f01f62a076f22d93b7670f81
Author: guojiufu <guojiufu@linux.ibm.com>
Date: Mon Jul 20 16:03:41 2020 +0800
unroll param for calls and branches
Diff:
---
gcc/config/rs6000/rs6000.c | 4 ++--
gcc/params.opt | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 397ec8a4954..fcb4e782f96 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -5155,8 +5155,8 @@ num_loop_calls (struct loop *loop)
static bool
rs6000_complex_loop_p (struct loop *loop)
{
- return num_loop_calls (loop) > 0
- || num_loop_branches (loop) > 2 || !single_exit (loop);
+ return num_loop_calls (loop) > param_max_unrolled_calls
+ || num_loop_branches (loop) > param_max_unrolled_branches;
}
/* Implement targetm.loop_unroll_adjust. */
diff --git a/gcc/params.opt b/gcc/params.opt
index e29a44e7712..142ba989998 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -638,6 +638,15 @@ The maximum number of unrollings of a single loop.
Common Joined UInteger Var(param_max_unrolled_insns) Init(200) Param Optimization
The maximum number of instructions to consider to unroll in a loop.
+-param=max-unrolled-calls=
+Common Joined UInteger Var(param_max_unrolled_calls) Init(2) Param Optimization
+The maximum number of calls to consider to unroll in a loop.
+
+-param=max-unrolled-branches=
+Common Joined UInteger Var(param_max_unrolled_branches) Init(4) Param Optimization
+The maximum number of branches to consider to unroll in a loop.
+
+
-param=max-unswitch-insns=
Common Joined UInteger Var(param_max_unswitch_insns) Init(50) Param Optimization
The maximum number of insns of an unswitched loop.
More information about the Gcc-cvs
mailing list