Makefile.in (IPA_TYPE_ESCAPE_H): Remove.

2011-03-23  Richard Guenther  <rguenther@suse.de>

	* Makefile.in (IPA_TYPE_ESCAPE_H): Remove.
	(OBJS-archive): Remove ipa-struct-reorg.o and ipa-type-escape.o.
	(tree-ssa-alias.o): Do not depend on IPA_TYPE_ESCAPE_H.
	(alias.o): Likewise.
	(ipa-type-escape.o): Remove.
	(ipa-struct-reorg.o): Likewise.
	(GTFILES): Remove ipa-struct-reorg.c.
	* alias.c: Do not include ipa-type-escape.h.
	* tree-ssa-alias.c: Likewise.
	* common.opt (fipa-struct-reorg): Preserve for backward compatibility.
	* opts.c (finish_options): Do not reset flag_ipa_struct_reorg.
	* passes.c (init_optimization_passes): Remove ipa-struct-reorg
	and ipa-type-escape passes.
	* tree-pass.h (pass_ipa_type_escape): Remove.
	(pass_ipa_struct_reorg): Likewise.
	* ipa-struct-reorg.h: Remove.
	* ipa-struct-reorg.c: Likewise.
	* ipa-type-escape.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* doc/invoke.texi (-fipa-struct-reorg): Remove.
	(--param struct-reorg-cold-struct-ratio): Likewise.
	* params.def (PARAM_STRUCT_REORG_COLD_STRUCT_RATIO): Likewise.
	* params.h (STRUCT_REORG_COLD_STRUCT_RATIO): Likewise.
	* timevar.def (TV_IPA_TYPE_ESCAPE): Likewise.

	* gcc.dg/struct: Remove directory and contents.

From-SVN: r171352
This commit is contained in:
Richard Guenther 2011-03-23 14:49:20 +00:00 committed by Richard Biener
parent 40fb503382
commit b8beb4d13e
45 changed files with 37 additions and 7581 deletions

View File

@ -1,3 +1,30 @@
2011-03-23 Richard Guenther <rguenther@suse.de>
* Makefile.in (IPA_TYPE_ESCAPE_H): Remove.
(OBJS-archive): Remove ipa-struct-reorg.o and ipa-type-escape.o.
(tree-ssa-alias.o): Do not depend on IPA_TYPE_ESCAPE_H.
(alias.o): Likewise.
(ipa-type-escape.o): Remove.
(ipa-struct-reorg.o): Likewise.
(GTFILES): Remove ipa-struct-reorg.c.
* alias.c: Do not include ipa-type-escape.h.
* tree-ssa-alias.c: Likewise.
* common.opt (fipa-struct-reorg): Preserve for backward compatibility.
* opts.c (finish_options): Do not reset flag_ipa_struct_reorg.
* passes.c (init_optimization_passes): Remove ipa-struct-reorg
and ipa-type-escape passes.
* tree-pass.h (pass_ipa_type_escape): Remove.
(pass_ipa_struct_reorg): Likewise.
* ipa-struct-reorg.h: Remove.
* ipa-struct-reorg.c: Likewise.
* ipa-type-escape.h: Likewise.
* ipa-type-escape.c: Likewise.
* doc/invoke.texi (-fipa-struct-reorg): Remove.
(--param struct-reorg-cold-struct-ratio): Likewise.
* params.def (PARAM_STRUCT_REORG_COLD_STRUCT_RATIO): Likewise.
* params.h (STRUCT_REORG_COLD_STRUCT_RATIO): Likewise.
* timevar.def (TV_IPA_TYPE_ESCAPE): Likewise.
2011-03-23 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/2084.md: Enable all insn reservations also for z9_ec

View File

@ -921,7 +921,6 @@ CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) $(RTL_H) vecprim.h double-int.h \
$(BITMAP_H) sbitmap.h
IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H)
IPA_REFERENCE_H = ipa-reference.h $(BITMAP_H) $(TREE_H)
IPA_TYPE_ESCAPE_H = ipa-type-escape.h $(TREE_H)
CGRAPH_H = cgraph.h $(VEC_H) $(TREE_H) $(BASIC_BLOCK_H) $(FUNCTION_H) \
cif-code.def ipa-ref.h ipa-ref-inline.h $(LINKER_PLUGIN_API_H)
DF_H = df.h $(BITMAP_H) $(REGSET_H) sbitmap.h $(BASIC_BLOCK_H) \
@ -1467,8 +1466,6 @@ OBJS-archive = \
ipa-pure-const.o \
ipa-reference.o \
ipa-ref.o \
ipa-struct-reorg.o \
ipa-type-escape.o \
ipa-utils.o \
ipa.o \
matrix-reorg.o \
@ -2612,7 +2609,7 @@ tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(FUNCTION_H) $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h \
$(TREE_DUMP_H) $(TREE_PASS_H) $(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(GIMPLE_H) $(VEC_H) $(TARGET_H) \
$(IPA_TYPE_ESCAPE_H) vecprim.h pointer-set.h alloc-pool.h \
vecprim.h pointer-set.h alloc-pool.h \
tree-pretty-print.h
tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
@ -3034,19 +3031,6 @@ ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
$(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) $(TREE_PASS_H) $(TIMEVAR_H) \
$(DIAGNOSTIC_H) $(CFGLOOP_H) $(SCEV_H) $(LTO_STREAMER_H) \
gimple-pretty-print.h
ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_TYPE_ESCAPE_H) $(IPA_UTILS_H) $(SPLAY_TREE_H) \
$(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) $(TREE_PASS_H) \
$(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H) tree-pretty-print.h
ipa-struct-reorg.o: ipa-struct-reorg.c ipa-struct-reorg.h $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(GIMPLE_H) tree-inline.h \
$(TREE_FLOW_H) langhooks.h pointer-set.h $(HASHTAB_H) $(DIAGNOSTIC_CORE_H) \
$(FLAGS_H) debug.h $(TARGET_H) $(CGRAPH_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
$(PARAMS_H) $(FIBHEAP_H) intl.h $(FUNCTION_H) $(BASIC_BLOCK_H) tree-iterator.h \
$(TREE_PASS_H) $(OPTS_H) $(IPA_TYPE_ESCAPE_H) $(TREE_DUMP_H) \
$(GIMPLE_H) tree-pretty-print.h gimple-pretty-print.h
coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
$(FUNCTION_H) $(BASIC_BLOCK_H) toplev.h $(DIAGNOSTIC_CORE_H) $(GGC_H) langhooks.h $(COVERAGE_H) \
@ -3303,7 +3287,7 @@ alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) $(DIAGNOSTIC_CORE_H) output.h \
$(ALIAS_H) $(EMIT_RTL_H) $(GGC_H) $(FUNCTION_H) cselib.h $(TREE_H) $(TM_P_H) \
langhooks.h $(TARGET_H) gt-alias.h $(TIMEVAR_H) $(CGRAPH_H) \
$(SPLAY_TREE_H) $(IPA_TYPE_ESCAPE_H) $(DF_H) $(TREE_PASS_H) \
$(SPLAY_TREE_H) $(DF_H) $(TREE_PASS_H) \
tree-ssa-alias.h pointer-set.h $(TREE_FLOW_H)
stack-ptr-mod.o : stack-ptr-mod.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(RTL_H) $(REGS_H) $(EXPR_H) $(TREE_PASS_H) \
@ -3715,7 +3699,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/reload.h $(srcdir)/caller-save.c \
$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
$(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-inline.c $(srcdir)/matrix-reorg.c \
$(srcdir)/dbxout.c $(srcdir)/ipa-struct-reorg.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
$(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
$(srcdir)/tree-vect-generic.c \
$(srcdir)/dojump.c \
$(srcdir)/emit-rtl.c $(srcdir)/except.h $(srcdir)/explow.c $(srcdir)/expr.c \

View File

@ -43,7 +43,6 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "cgraph.h"
#include "tree-pass.h"
#include "ipa-type-escape.h"
#include "df.h"
#include "tree-ssa-alias.h"
#include "pointer-set.h"

View File

@ -1249,9 +1249,8 @@ Perform matrix layout flattening and transposing based
on profiling information.
fipa-struct-reorg
Common Report Var(flag_ipa_struct_reorg)
Perform structure layout optimizations based
on profiling information.
Common Ignore
Does nothing. Preserved for backward compatibility.
fira-algorithm=
Common Joined RejectNegative Enum(ira_algorithm) Var(flag_ira_algorithm) Init(IRA_ALGORITHM_CB)

View File

@ -351,7 +351,7 @@ Objective-C and Objective-C++ Dialects}.
-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
-fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
-fipa-struct-reorg -fira-algorithm=@var{algorithm} @gol
-fira-algorithm=@var{algorithm} @gol
-fira-region=@var{region} @gol
-fira-loop-pressure -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
@ -6766,19 +6766,6 @@ Discover which static variables do not escape cannot escape the
compilation unit.
Enabled by default at @option{-O} and higher.
@item -fipa-struct-reorg
@opindex fipa-struct-reorg
Perform structure reorganization optimization, that change C-like structures
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} to be
enabled. Structures considered @samp{cold} by this transformation are not
affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
With this flag, the program debug info reflects a new structure layout.
@item -fipa-pta
@opindex fipa-pta
Perform interprocedural pointer analysis and interprocedural modification
@ -8216,15 +8203,6 @@ In each case, the @var{value} is an integer. The allowable choices for
@var{name} are given in the following table:
@table @gcctabopt
@item struct-reorg-cold-struct-ratio
The threshold ratio (as a percentage) between a structure frequency
and the frequency of the hottest structure in the program. This parameter
is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
We say that if the ratio of a structure frequency, calculated by profiling,
to the hottest structure frequency in the program is less than this
parameter, then structure reorganization is not applied to this structure.
The default is 10.
@item predictable-branch-outcome
When branch is predicted to be taken with probability lower than this threshold
(in percent), then it is considered well predictable. The default is 10.

File diff suppressed because it is too large Load Diff

View File

@ -1,112 +0,0 @@
/* Struct-reorg optimization.
Copyright (C) 2002, 2003-2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Olga Golovanevsky <olga@il.ibm.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef IPA_STRUCT_REORG_H
#define IPA_STRUCT_REORG_H
/* This file contains data structures and interfaces required
for struct-reorg optimizations. */
/* An access site of the structure field.
We consider an access to be of the following form:
D.2166_21 = i.6_20 * 8;
D.2167_22 = (struct str_t *) D.2166_21;
D.2168_24 = D.2167_22 + p.5_23;
D.2169_25 = D.2168_24->b;
*/
struct field_access_site
{
/* Statement in which the access site occurs. */
gimple stmt; /* D.2169_25 = D.2168_24->b; */
tree comp_ref; /* D.2168_24->b */
tree field_decl; /* b */
tree ref; /* D.2168_24 */
tree num; /* i.6_20 */
tree offset; /* D2167_22 */
tree base; /* p.5_23 */
gimple ref_def_stmt; /* D.2168_24 = D.2167_22 + p.5_23; */
gimple cast_stmt; /* D.2167_22 = (struct str_t *) D.2166_21;
This statement is not always present. */
};
/* A non-field structure access site. */
struct access_site
{
/* A statement in which the access site occurs. */
gimple stmt;
/* A list of structure variables in the access site. */
VEC (tree, heap) *vars;
};
/* A field of the structure. */
struct field_entry
{
/* A field index. */
int index;
/* Number of times the field is accessed (according to profiling). */
gcov_type count;
tree decl;
/* A type of a new structure this field belongs to. */
tree field_mapping;
htab_t acc_sites;
};
/* This structure represents a result of the structure peeling.
The original structure is decomposed into substructures, or clusters. */
struct field_cluster
{
/* A bitmap of field indices. The set bit indicates that the field
corresponding to it is a part of this cluster. */
sbitmap fields_in_cluster;
struct field_cluster *sibling;
};
/* An information about an individual structure type (RECORD_TYPE) required
by struct-reorg optimizations to perform a transformation. */
struct data_structure
{
/* A main variant of the structure type. */
tree decl;
/* Number of fields in the structure. */
int num_fields;
/* A structure access count collected through profiling. */
gcov_type count;
/* An array of the structure fields, indexed by field ID. */
struct field_entry *fields;
/* Non-field accesses of the structure. */
htab_t accs;
/* A data structure representing a reorganization decision. */
struct field_cluster *struct_clustering;
/* New types to replace the original structure type. */
VEC(tree, heap) *new_types;
};
typedef struct data_structure * d_str;
#endif /* IPA_STRUCT_REORG_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +0,0 @@
/* Type based alias analysis.
Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_IPA_TYPE_ESCAPE_H
#define GCC_IPA_TYPE_ESCAPE_H
#include "tree.h"
bool ipa_type_escape_type_contained_p (tree type);
bool ipa_type_escape_field_does_not_clobber_p (tree, tree);
int ipa_type_escape_star_count_of_interesting_type (tree type);
int ipa_type_escape_star_count_of_interesting_or_array_type (tree type);
bool is_array_access_through_pointer_and_index (enum tree_code, tree, tree,
tree *, tree *, gimple *);
#endif /* GCC_IPA_TYPE_ESCAPE_H */

View File

@ -777,7 +777,6 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
{
/* These passes are not WHOPR compatible yet. */
opts->x_flag_ipa_pta = 0;
opts->x_flag_ipa_struct_reorg = 0;
}
if (opts->x_flag_lto)

View File

@ -39,16 +39,6 @@ along with GCC; see the file COPYING3. If not see
Be sure to add an entry to invoke.texi summarizing the parameter. */
/* The threshold ratio between current and hottest structure counts.
We say that if the ratio of the current structure count,
calculated by profiling, to the hottest structure count
in the program is less than this parameter, then structure
reorganization is not applied. The default is 10%. */
DEFPARAM (PARAM_STRUCT_REORG_COLD_STRUCT_RATIO,
"struct-reorg-cold-struct-ratio",
"The threshold ratio between current and hottest structure counts",
10, 0, 100)
/* When branch is predicted to be taken with probability lower than this
threshold (in percent), then it is considered well predictable. */
DEFPARAM (PARAM_PREDICTABLE_BRANCH_OUTCOME,

View File

@ -118,8 +118,6 @@ extern int default_param_value (compiler_param num);
extern void init_param_values (int *params);
/* Macros for the various parameters. */
#define STRUCT_REORG_COLD_STRUCT_RATIO \
PARAM_VALUE (PARAM_STRUCT_REORG_COLD_STRUCT_RATIO)
#define MAX_INLINE_INSNS_SINGLE \
PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SINGLE)
#define MAX_INLINE_INSNS \

View File

@ -798,9 +798,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_ipa_inline);
NEXT_PASS (pass_ipa_pure_const);
NEXT_PASS (pass_ipa_reference);
NEXT_PASS (pass_ipa_type_escape);
NEXT_PASS (pass_ipa_pta);
NEXT_PASS (pass_ipa_struct_reorg);
*p = NULL;
p = &all_lto_gen_passes;

View File

@ -1,3 +1,7 @@
2011-03-23 Richard Guenther <rguenther@suse.de>
* gcc.dg/struct: Remove directory and contents.
2011-03-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR testsuite/48251

View File

@ -1,75 +0,0 @@
# Copyright (C) 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
# Test the functionality of programs compiled with profile-directed structure
# rearrangement using -fprofile-generate followed by -fprofile-use.
load_lib gcc-dg.exp
load_lib target-supports.exp
set STRUCT_REORG_CFLAGS "-O3 -fipa-struct-reorg -fdump-ipa-all -fwhole-program"
# Initialize `dg'.
dg-init
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wo_prof_*.c]] "" $STRUCT_REORG_CFLAGS
dg-final
# Some targets don't support tree profiling.
if { ![check_profiling_available ""] } {
return
}
# The procedures in profopt.exp need these parameters.
set tool gcc
set prof_ext "gcda"
# Override the list defined in profopt.exp.
set PROFOPT_OPTIONS [list {}]
if $tracelevel then {
strace $tracelevel
}
# Load support procs.
load_lib profopt.exp
# 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"
set profile_option [concat $common " -fprofile-generate"]
set feedback_option [concat $common " -fprofile-use -fipa-struct-reorg -fdump-ipa-all"]
foreach src [lsort [glob -nocomplain $srcdir/$subdir/w_prof_*.c]] {
# If we're only testing specific files and this isn't one of them, skip it.
if ![runtest_file_p $runtests $src] then {
continue
}
profopt-execute $src
}
set feedback_option [concat $feedback_option " --param struct-reorg-cold-struct-ratio=30"]
foreach src [lsort [glob -nocomplain $srcdir/$subdir/w_ratio_*.c]] {
# If we're only testing specific files and this isn't one of them, skip it.
if ![runtest_file_p $runtests $src] then {
continue
}
profopt-execute $src
}

View File

@ -1,30 +0,0 @@
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#define N 1000
str_t A[N];
int
main ()
{
int i;
for (i = 0; i < N; i++)
{
A[i].a = 0;
}
for (i = 0; i < N; i++)
if (A[i].a != 0)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */

View File

@ -1,43 +0,0 @@
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
str_t *p;
int
main ()
{
int i, sum;
p = malloc (N * sizeof (str_t));
if (p == NULL)
return 0;
for (i = 0; i < N; i++)
p[i].b = i;
for (i = 0; i < N; i++)
p[i].a = p[i].b + 1;
for (i = 0; i < N; i++)
if (p[i].a != p[i].b + 1)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */

View File

@ -1,38 +0,0 @@
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
int
main ()
{
int i;
str_t A[N];
for (i = 0; i < N; i++)
{
A[i].a = 0;
}
for (i = 0; i < N; i++)
if (A[i].a != 0)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */

View File

@ -1,41 +0,0 @@
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
int
main ()
{
int i, sum;
str_t * p = malloc (N * sizeof (str_t));
if (p == NULL)
return 0;
for (i = 0; i < N; i++)
p[i].b = i;
for (i = 0; i < N; i++)
p[i].a = p[i].b + 1;
for (i = 0; i < N; i++)
if (p[i].a != p[i].b + 1)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */

View File

@ -1,33 +0,0 @@
#include <stdlib.h>
typedef struct
{
int a;
int b;
}str_t;
#define N 3
str_t str;
int
main ()
{
int i;
int res = 1<<(1<<N);
str.a = 2;
for (i = 0; i < N; i++)
str.a = str.a * str.a;
if (str.a != res)
abort ();
/* POSIX ignores all but the 8 low-order bits, but other
environments may not. */
return (str.a & 255);
}
/*--------------------------------------------------------------------------*/
/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */

View File

@ -1,66 +0,0 @@
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t1;
typedef struct
{
int c;
float d;
}str_t2;
#ifdef STACK_SIZE
#if STACK_SIZE > 16000
#define N 1000
#else
#define N (STACK_SIZE/16)
#endif
#else
#define N 1000
#endif
str_t1 *p1;
str_t2 *p2;
int num;
void
foo (void)
{
int i;
for (i=0; i < num; i++)
p2[i].c = 2;
}
int
main ()
{
int i, r;
r = rand ();
num = r > N ? N : r;
p1 = malloc (num * sizeof (str_t1));
p2 = malloc (num * sizeof (str_t2));
if (p1 == NULL || p2 == NULL)
return 0;
for (i = 0; i < num; i++)
p1[i].a = 1;
foo ();
for (i = 0; i < num; i++)
if (p1[i].a != 1 || p2[i].c != 2)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */

View File

@ -1,43 +0,0 @@
#include <stdlib.h>
typedef struct
{
int a;
int b;
}str_t1;
typedef struct
{
float a;
float b;
}str_t2;
#define N1 1000
#define N2 100
str_t1 A1[N1];
str_t2 A2[N2];
int
main ()
{
int i;
for (i = 0; i < N1; i++)
A1[i].a = 0;
for (i = 0; i < N2; i++)
A2[i].a = 0;
for (i = 0; i < N1; i++)
if (A1[i].a != 0)
abort ();
for (i = 0; i < N2; i++)
if (A2[i].a != 0)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final-use { cleanup-ipa-dump "*" } } */

View File

@ -1,27 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct basic
{
int a;
int b[10];
} type_struct;
type_struct *str1;
int main()
{
int i;
str1 = malloc (10 * sizeof (type_struct));
for (i=0; i<=9; i++)
str1[i].a = str1[i].b[0];
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,39 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
int
main ()
{
int i;
str_t A[N];
str_t *p = A;
for (i = 0; i < N; i++)
p[i].a = 0;
for (i = 0; i < N; i++)
if (p[i].a != 0)
abort ();
return 0;
}
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,30 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct test_struct
{
int a;
int b;
} type_struct;
typedef type_struct **struct_pointer2;
struct_pointer2 str1;
int main()
{
int i, j;
str1 = malloc (2 * sizeof (type_struct *));
for (i = 0; i <= 1; i++)
str1[i] = malloc (2 * sizeof (type_struct));
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,45 +0,0 @@
/* { dg-do run } */
#include <stdlib.h>
struct S { int a; struct V *b; };
typedef struct { int c; } T;
typedef struct { int d; int e; } U;
void *
fn (void *x)
{
return x;
}
int
foo (struct S *s)
{
T x;
T y = *(T *)fn (&x);
return y.c;
}
int
bar (struct S *s)
{
U x;
U y = *(U *)fn (&x);
return y.d + s->a;
}
int
main ()
{
struct S s;
foo(&s) + bar (&s);
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,44 +0,0 @@
/* { dg-do run } */
#include <stdlib.h>
struct str
{
int a;
float b;
};
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
int
foo (struct str * p_str)
{
static int sum = 0;
sum = sum + p_str->a;
return sum;
}
int
main ()
{
int i, sum;
struct str * p = malloc (N * sizeof (struct str));
if (p == NULL)
return 0;
for (i = 0; i < N; i++)
sum = foo (p+i);
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "is passed to local function...Excluded." "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,31 +0,0 @@
/* { dg-do run } */
#include <stdlib.h>
struct A {
int d;
};
struct A a;
struct A foo ()
{
a.d = 5;
return a;
}
int
main ()
{
a.d = 0;
foo ();
if (a.d != 5)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "is return type of function...Excluded" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,33 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
int b;
}str_t;
#define N 2
str_t A[2] = {{1,1},{2,2}};
int
main ()
{
int i;
for (i = 0; i < N; i++)
A[i].b = A[i].a;
for (i = 0; i < N; i++)
if (A[i].b != A[i].a)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "is initialized...Excluded" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,34 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#define N 1000
typedef struct
{
str_t A[N];
int c;
}str_with_substr_t;
str_with_substr_t a;
int
main ()
{
int i;
for (i = 0; i < N; i++)
a.A[i].b = 0;
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,49 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 16000
#define N 1000
#else
#define N (STACK_SIZE/16)
#endif
#else
#define N 1000
#endif
typedef struct
{
str_t * sub_str;
int c;
}str_with_substr_t;
int foo;
int
main (void)
{
int i;
str_with_substr_t A[N];
str_t a[N];
for (i=0; i < N; i++)
A[i].sub_str = &(a[i]);
for (i=0; i < N; i++)
A[i].sub_str->a = 5;
foo = A[56].sub_str->a;
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,46 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
typedef struct
{
str_t sub_str;
int c;
}str_with_substr_t;
int
main ()
{
int i;
str_with_substr_t A[N];
for (i = 0; i < N; i++)
A[i].sub_str.a = 5;
for (i = 0; i < N; i++)
if (A[i].sub_str.a != 5)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "is a field in the structure" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,33 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#define N 1000
str_t A[N];
int
main ()
{
int i;
for (i = 0; i < N; i++)
{
A[i].a = 0;
}
for (i = 0; i < N; i++)
if (A[i].a != 0)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,46 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
str_t *p;
int
main ()
{
int i, sum;
p = malloc (N * sizeof (str_t));
if (p == NULL)
return 0;
for (i = 0; i < N; i++)
p[i].b = i;
for (i = 0; i < N; i++)
p[i].b = p[i].a + 1;
for (i = 0; i < N; i++)
if (p[i].b != p[i].a + 1)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,41 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
int
main ()
{
int i;
str_t A[N];
for (i = 0; i < N; i++)
{
A[i].a = 0;
}
for (i = 0; i < N; i++)
if (A[i].a != 0)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,44 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
int
main ()
{
int i, sum;
str_t * p = malloc (N * sizeof (str_t));
if (p == NULL)
return 0;
for (i = 0; i < N; i++)
p[i].b = i;
for (i = 0; i < N; i++)
p[i].b = p[i].a + 1;
for (i = 0; i < N; i++)
if (p[i].b != p[i].a + 1)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,48 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 8000
#define N 1000
#else
#define N (STACK_SIZE/8)
#endif
#else
#define N 1000
#endif
int
main ()
{
int i, num;
num = rand();
num = num > N ? N : num;
str_t * p = malloc (num * sizeof (str_t));
if (p == 0)
return 0;
for (i = 0; i < num; i++)
p[i].b = i;
for (i = 0; i < num; i++)
p[i].a = p[i].b + 1;
for (i = 0; i < num; i++)
if (p[i].a != p[i].b + 1)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,43 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
int c;
float d;
}str_t;
#ifdef STACK_SIZE
#if STACK_SIZE > 1600
#define N 100
#else
#define N (STACK_SIZE/16)
#endif
#else
#define N 100
#endif
int
main ()
{
int i;
str_t *p = malloc (N * sizeof (str_t));
if (p == NULL)
return 0;
for (i = 0; i < N; i++)
p[i].a = 5;
for (i = 0; i < N; i++)
if (p[i].a != 5)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* The structure str_t is erroneously peeled into 4 structures instead of 2. */
/* { dg-final { scan-ipa-dump "the number of new types is 2" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,35 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
int b;
}str_t;
#define N 3
str_t str;
int
main ()
{
int i;
int res = 1<<(1<<N);
str.a = 2;
for (i = 0; i < N; i++)
str.a = str.a * str.a;
if (str.a != res)
abort ();
/* POSIX ignores all but the 8 low-order bits, but other
environments may not. */
return (str.a & 255);
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,35 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
int b;
}str_t;
#define N 3
int
main ()
{
int i;
int res = 1<<(1<<N);
str_t str;
str.a = 2;
for (i = 0; i < N; i++)
str.a = str.a * str.a;
if (str.a != res)
abort ();
/* POSIX ignores all but the 8 low-order bits, but other
environments may not. */
return (str.a & 255);
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "No structures to transform" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,40 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
int *b;
}str_t;
#define N 3
str_t *p;
int
main ()
{
str_t str;
int i;
int res = 1 << (1 << N);
p = &str;
str.a = 2;
p->b = &(p->a);
for (i=0; i < N; i++)
p->a = *(p->b)*(*(p->b));
if (p->a != res)
abort ();
/* POSIX ignores all but the 8 low-order bits, but other
environments may not. */
return (p->a & 255);
}
/*--------------------------------------------------------------------------*/
/* The access &(p->a) is handled incorrectly in ipa-struct-reorg.c. */
/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -1,68 +0,0 @@
/* { dg-do compile } */
/* { dg-do run } */
#include <stdlib.h>
typedef struct
{
int a;
float b;
}str_t1;
typedef struct
{
int c;
float d;
}str_t2;
#ifdef STACK_SIZE
#if STACK_SIZE > 16000
#define N 1000
#else
#define N (STACK_SIZE/16)
#endif
#else
#define N 1000
#endif
str_t1 *p1;
str_t2 *p2;
int num;
void
foo (void)
{
int i;
for (i=0; i < num; i++)
p2[i].c = 2;
}
int
main ()
{
int i, r;
r = rand ();
num = r > N ? N : r;
p1 = malloc (num * sizeof (str_t1));
p2 = malloc (num * sizeof (str_t2));
if (p1 == NULL || p2 == NULL)
return 0;
for (i = 0; i < num; i++)
p1[i].a = 1;
foo ();
for (i = 0; i < num; i++)
if (p1[i].a != 1 || p2[i].c != 2)
abort ();
return 0;
}
/*--------------------------------------------------------------------------*/
/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "ipa_struct_reorg" { xfail *-*-* } } } */
/* { dg-final { cleanup-ipa-dump "*" } } */

View File

@ -70,7 +70,6 @@ DEFTIMEVAR (TV_WHOPR_WPA_LTRANS_EXEC , "whopr wpa->ltrans")
DEFTIMEVAR (TV_IPA_REFERENCE , "ipa reference")
DEFTIMEVAR (TV_IPA_PROFILE , "ipa profile")
DEFTIMEVAR (TV_IPA_PURE_CONST , "ipa pure const")
DEFTIMEVAR (TV_IPA_TYPE_ESCAPE , "ipa type escape")
DEFTIMEVAR (TV_IPA_PTA , "ipa points-to")
DEFTIMEVAR (TV_IPA_SRA , "ipa SRA")
DEFTIMEVAR (TV_IPA_FREE_LANG_DATA , "ipa free lang data")

View File

@ -463,9 +463,7 @@ extern struct simple_ipa_opt_pass pass_ipa_free_lang_data;
extern struct ipa_opt_pass_d pass_ipa_cp;
extern struct ipa_opt_pass_d pass_ipa_reference;
extern struct ipa_opt_pass_d pass_ipa_pure_const;
extern struct simple_ipa_opt_pass pass_ipa_type_escape;
extern struct simple_ipa_opt_pass pass_ipa_pta;
extern struct simple_ipa_opt_pass pass_ipa_struct_reorg;
extern struct ipa_opt_pass_d pass_ipa_lto_wpa_fixup;
extern struct ipa_opt_pass_d pass_ipa_lto_finish_out;
extern struct ipa_opt_pass_d pass_ipa_profile;

View File

@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "convert.h"
#include "params.h"
#include "ipa-type-escape.h"
#include "vec.h"
#include "bitmap.h"
#include "vecprim.h"