summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-23 18:51:17 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-23 18:51:17 +0000
commit0cb057cb45a7da7e21d222a4866f99e4de947aa9 (patch)
tree417f4807f2ac303fb2e45ded4d924d1d329be5e0
parentb308229e57ac8c702a7bd095b496ff17249862e1 (diff)
downloadgcc-0cb057cb45a7da7e21d222a4866f99e4de947aa9.tar.gz
2011-11-23 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/48455 * doc/invoke.texi (-fira-region): Document default values. * flags-types.h (enum ira_region): Add new value IRA_REGION_AUTODETECT. * common.opt (fira-region): Set up initial value to IRA_REGION_AUTODETECT. * toplev.c (process_options): Set up flag_ira_region depending on -O options. * ira.c (ira.c): Remove optimize guard for ira_build. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181675 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/common.opt2
-rw-r--r--gcc/doc/invoke.texi17
-rw-r--r--gcc/flag-types.h6
-rw-r--r--gcc/ira.c5
-rw-r--r--gcc/toplev.c5
6 files changed, 39 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4e574a03086..96a74f05e36 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+2011-11-23 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/48455
+ * doc/invoke.texi (-fira-region): Document default values.
+
+ * flags-types.h (enum ira_region): Add new value
+ IRA_REGION_AUTODETECT.
+
+ * common.opt (fira-region): Set up initial value to
+ IRA_REGION_AUTODETECT.
+
+ * toplev.c (process_options): Set up flag_ira_region depending on
+ -O options.
+
+ * ira.c (ira.c): Remove optimize guard for ira_build.
+
2011-11-23 Chung-Lin Tang <cltang@codesourcery.com>
PR rtl-optimization/50496
diff --git a/gcc/common.opt b/gcc/common.opt
index 4eb5b30b1c4..55d3f2d44d1 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1337,7 +1337,7 @@ EnumValue
Enum(ira_algorithm) String(priority) Value(IRA_ALGORITHM_PRIORITY)
fira-region=
-Common Joined RejectNegative Enum(ira_region) Var(flag_ira_region) Init(IRA_REGION_MIXED)
+Common Joined RejectNegative Enum(ira_region) Var(flag_ira_region) Init(IRA_REGION_AUTODETECT)
-fira-region=[one|all|mixed] Set regions for IRA
Enum
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e58ed1b4ac5..4e6edb9414e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6731,13 +6731,16 @@ rule generates a better code.
Use specified regions for the integrated register allocator. The
@var{region} argument should be one of @code{all}, @code{mixed}, or
@code{one}. The first value means using all loops as register
-allocation regions, the second value which is the default means using
-all loops except for loops with small register pressure as the
-regions, and third one means using all function as a single region.
-The first value can give best result for machines with small size and
-irregular register set, the third one results in faster and generates
-decent code and the smallest size code, and the default value usually
-give the best results in most cases and for most architectures.
+allocation regions, the second value which is enabled by default when
+compiling with optimization for speed (@option{-O}, @option{-O2},
+@dots{}) means using all loops except for loops with small register
+pressure as the regions, and third one which is enabled by default for
+@option{-Os} or @option{-O0} means using all function as a single
+region. The first value can give best result for machines with small
+size and irregular register set, the third one results in faster and
+generates decent code and the smallest size code, and the second value
+usually give the best results in most cases and for most
+architectures.
@item -fira-loop-pressure
@opindex fira-loop-pressure
diff --git a/gcc/flag-types.h b/gcc/flag-types.h
index 430ac93805c..f757423e56a 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -118,7 +118,11 @@ enum ira_region
{
IRA_REGION_ONE,
IRA_REGION_ALL,
- IRA_REGION_MIXED
+ IRA_REGION_MIXED,
+ /* This value means that there were no options -fira-region on the
+ command line and that we should choose a value depending on the
+ used -O option. */
+ IRA_REGION_AUTODETECT
};
/* The options for excess precision. */
diff --git a/gcc/ira.c b/gcc/ira.c
index 2ecb5a302b6..e3d3fe30385 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3621,9 +3621,8 @@ ira (FILE *f)
if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
fprintf (ira_dump_file, "Building IRA IR\n");
- loops_p = ira_build (optimize
- && (flag_ira_region == IRA_REGION_ALL
- || flag_ira_region == IRA_REGION_MIXED));
+ loops_p = ira_build (flag_ira_region == IRA_REGION_ALL
+ || flag_ira_region == IRA_REGION_MIXED);
ira_assert (ira_conflicts_p || !loops_p);
diff --git a/gcc/toplev.c b/gcc/toplev.c
index de255b4c3f7..9be910970b4 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1333,6 +1333,11 @@ process_options (void)
"and -ftree-loop-linear)");
#endif
+ /* One region RA really helps to decrease the code size. */
+ if (flag_ira_region == IRA_REGION_AUTODETECT)
+ flag_ira_region
+ = optimize_size || !optimize ? IRA_REGION_ONE : IRA_REGION_MIXED;
+
/* Unrolling all loops implies that standard loop unrolling must also
be done. */
if (flag_unroll_all_loops)