[PATCH] Remove -fipa-type-escape flag
Richard Guenther
rguenther@suse.de
Sun May 16 20:02:00 GMT 2010
This patch removes -fipa-type-escape and instead compute it
when it's needed (when -fipa-struct-reorg is enabled).
-fipa-type-escape was not documented so I don't think we need
to preserve it for backwards compatibility.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2010-05-16 Richard Guenther <rguenther@suse.de>
* doc/invoke.texi (-fipa-struct-reorg): Do not mention
-fipa-type-escape.
* ipa-type-escape.c (gate_type_escape_vars): Run when
-fipa-struct-reorg runs.
* opts.c (decode_options): Do not unset flag_ipa_type_escape.
* common.opt (fipa-type-escape): Remove.
* gcc.dg/pr43317.c: Do not pass -fipa-type-escape.
* gcc.dg/pr43084.c: Likewise.
* gcc.dg/pr42250.c: Pass -fipa-struct-reorg instead of
-fipa-type-escape.
* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Do not pass
-fipa-type-escape.
* gcc.dg/struct/struct-reorg.exp: Likewise.
* gcc.dg/struct/wo_prof_empty_str.c: Likewise.
* gcc.dg/struct/wo_prof_escape_return.c: Likewise.
Index: gcc/doc/invoke.texi
===================================================================
*** gcc/doc/invoke.texi (revision 159459)
--- gcc/doc/invoke.texi (working copy)
*************** Objective-C and Objective-C++ Dialects}.
*** 346,352 ****
-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
-fipa-profile -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
! -fipa-type-escape -fira-algorithm=@var{algorithm} @gol
-fira-region=@var{region} -fira-coalesce @gol
-fira-loop-pressure -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
--- 346,352 ----
-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
-fipa-profile -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
! -fira-algorithm=@var{algorithm} @gol
-fira-region=@var{region} -fira-coalesce @gol
-fira-loop-pressure -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
*************** Perform structure reorganization optimiz
*** 6633,6640 ****
layout in order to better utilize spatial locality. This transformation is
affective for programs containing arrays of structures. Available in two
compilation modes: profile-based (enabled with @option{-fprofile-generate})
! or static (which uses built-in heuristics). Require @option{-fipa-type-escape}
! to provide the safety of this transformation. It works only in whole program
mode, so it requires @option{-fwhole-program} and @option{-combine} to be
enabled. Structures considered @samp{cold} by this transformation are not
affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
--- 6633,6639 ----
layout in order to better utilize spatial locality. This transformation is
affective for programs containing arrays of structures. Available in two
compilation modes: profile-based (enabled with @option{-fprofile-generate})
! or static (which uses built-in heuristics). It works only in whole program
mode, so it requires @option{-fwhole-program} and @option{-combine} to be
enabled. Structures considered @samp{cold} by this transformation are not
affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
Index: gcc/testsuite/gcc.dg/pr43317.c
===================================================================
*** gcc/testsuite/gcc.dg/pr43317.c (revision 159459)
--- gcc/testsuite/gcc.dg/pr43317.c (working copy)
***************
*** 1,5 ****
/* { dg-do compile } */
! /* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-type-escape -g" } */
extern void *malloc(__SIZE_TYPE__);
--- 1,5 ----
/* { dg-do compile } */
! /* { dg-options "-O -fipa-struct-reorg -fwhole-program -g" } */
extern void *malloc(__SIZE_TYPE__);
Index: gcc/testsuite/gcc.dg/pr43084.c
===================================================================
*** gcc/testsuite/gcc.dg/pr43084.c (revision 159459)
--- gcc/testsuite/gcc.dg/pr43084.c (working copy)
***************
*** 1,6 ****
/* PR debug/43084 */
/* { dg-do compile } */
! /* { dg-options "-O1 -fipa-struct-reorg -fwhole-program -fipa-type-escape -fcompare-debug" } */
struct S
{
--- 1,6 ----
/* PR debug/43084 */
/* { dg-do compile } */
! /* { dg-options "-O1 -fipa-struct-reorg -fwhole-program -fcompare-debug" } */
struct S
{
Index: gcc/testsuite/gcc.dg/pr42250.c
===================================================================
*** gcc/testsuite/gcc.dg/pr42250.c (revision 159459)
--- gcc/testsuite/gcc.dg/pr42250.c (working copy)
***************
*** 1,5 ****
/* { dg-do compile } */
! /* { dg-options "-O2 -fipa-type-escape" } */
extern double log10 (double __x);
extern double ceil (double __x);
--- 1,5 ----
/* { dg-do compile } */
! /* { dg-options "-O2 -fipa-struct-reorg" } */
extern double log10 (double __x);
extern double ceil (double __x);
Index: gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c
===================================================================
*** gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c (revision 159459)
--- gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c (working copy)
***************
*** 1,4 ****
! /* { dg-options "-O3 -fno-inline -fno-ipa-sra -fipa-type-escape -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
/* { dg-do compile } */
/* { dg-do run } */
--- 1,4 ----
! /* { dg-options "-O3 -fno-inline -fno-ipa-sra -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
/* { dg-do compile } */
/* { dg-do run } */
Index: gcc/testsuite/gcc.dg/struct/struct-reorg.exp
===================================================================
*** gcc/testsuite/gcc.dg/struct/struct-reorg.exp (revision 159459)
--- gcc/testsuite/gcc.dg/struct/struct-reorg.exp (working copy)
***************
*** 20,26 ****
load_lib gcc-dg.exp
load_lib target-supports.exp
! set STRUCT_REORG_CFLAGS "-O3 -fipa-struct-reorg -fdump-ipa-all -fwhole-program -combine -fipa-type-escape"
# Initialize `dg'.
dg-init
--- 20,26 ----
load_lib gcc-dg.exp
load_lib target-supports.exp
! set STRUCT_REORG_CFLAGS "-O3 -fipa-struct-reorg -fdump-ipa-all -fwhole-program -combine"
# Initialize `dg'.
dg-init
*************** load_lib profopt.exp
*** 51,57 ****
# These are globals used by profopt-execute. The first is options
# needed to generate profile data, the second is options to use the
# profile data.
! set common "-O3 -fwhole-program -combine -fipa-type-escape"
set profile_option [concat $common " -fprofile-generate"]
set feedback_option [concat $common " -fprofile-use -fipa-struct-reorg -fdump-ipa-all"]
--- 51,57 ----
# These are globals used by profopt-execute. The first is options
# needed to generate profile data, the second is options to use the
# profile data.
! set common "-O3 -fwhole-program -combine"
set profile_option [concat $common " -fprofile-generate"]
set feedback_option [concat $common " -fprofile-use -fipa-struct-reorg -fdump-ipa-all"]
Index: gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c
===================================================================
*** gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c (revision 159459)
--- gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c (working copy)
***************
*** 1,4 ****
! /* { dg-options "-O3 -fno-inline -fipa-type-escape -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
/* { dg-do compile } */
/* { dg-do run } */
--- 1,4 ----
! /* { dg-options "-O3 -fno-inline -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
/* { dg-do compile } */
/* { dg-do run } */
Index: gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c
===================================================================
*** gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c (revision 159459)
--- gcc/testsuite/gcc.dg/struct/wo_prof_escape_return.c (working copy)
***************
*** 1,4 ****
! /* { dg-options "-O3 -fno-inline -fipa-type-escape -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
/* { dg-do compile } */
/* { dg-do run } */
--- 1,4 ----
! /* { dg-options "-O3 -fno-inline -fdump-ipa-all -fipa-struct-reorg -fwhole-program -combine" } */
/* { dg-do compile } */
/* { dg-do run } */
Index: gcc/ipa-type-escape.c
===================================================================
*** gcc/ipa-type-escape.c (revision 159459)
--- gcc/ipa-type-escape.c (working copy)
***************
*** 1,4 ****
! /* Type based alias analysis.
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010
Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
--- 1,4 ----
! /* Escape analysis for types.
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010
Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
*************** type_escape_execute (void)
*** 2112,2120 ****
static bool
gate_type_escape_vars (void)
{
! return (flag_ipa_type_escape
! /* Don't bother doing anything if the program has errors. */
! && !(errorcount || sorrycount));
}
struct simple_ipa_opt_pass pass_ipa_type_escape =
--- 2112,2118 ----
static bool
gate_type_escape_vars (void)
{
! return flag_ipa_struct_reorg && flag_whole_program && (optimize > 0);
}
struct simple_ipa_opt_pass pass_ipa_type_escape =
Index: gcc/common.opt
===================================================================
*** gcc/common.opt (revision 159459)
--- gcc/common.opt (working copy)
*************** fipa-reference
*** 717,726 ****
Common Report Var(flag_ipa_reference) Init(0) Optimization
Discover readonly and non addressable static variables
- fipa-type-escape
- Common Report Var(flag_ipa_type_escape) Init(0) Optimization
- Type based escape and alias analysis
-
fipa-matrix-reorg
Common Report Var(flag_ipa_matrix_reorg) Optimization
Perform matrix layout flattening and transposing based
--- 717,722 ----
Index: gcc/opts.c
===================================================================
*** gcc/opts.c (revision 159459)
--- gcc/opts.c (working copy)
*************** decode_options (unsigned int argc, const
*** 1143,1149 ****
{
/* These passes are not WHOPR compatible yet. */
flag_ipa_cp = 0;
- flag_ipa_type_escape = 0;
flag_ipa_pta = 0;
flag_ipa_struct_reorg = 0;
}
--- 1143,1148 ----
More information about the Gcc-patches
mailing list