Commit 98035a75 by Daniel Berlin Committed by Daniel Berlin

re PR tree-optimization/26260 (PTA is slow with large structs (hits clisp))

2006-02-14  Daniel Berlin  <dberlin@dberlin.org>

	Fix PR tree-optimization/26260

	* doc/invoke.texi (max-fields-for-field-sensitive): Document
	param.
	* params.h (MAX_FIELDS_FOR_FIELD_SENSITIVE): New.
	* params.def (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE): Ditto.
	* tree-ssa-structalias.c (create_variable_info_for): Use
	MAX_FIELDS_FOR_FIELD_SENSITIVE.

From-SVN: r110972
parent b076a3fd
2006-02-14 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/26260
* doc/invoke.texi (max-fields-for-field-sensitive): Document
param.
* params.h (MAX_FIELDS_FOR_FIELD_SENSITIVE): New.
* params.def (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE): Ditto.
* tree-ssa-structalias.c (create_variable_info_for): Use
MAX_FIELDS_FOR_FIELD_SENSITIVE.
2006-02-14 Zdenek Dvorak <dvorakz@suse.cz> 2006-02-14 Zdenek Dvorak <dvorakz@suse.cz>
* doc/invoke.texi (-fprefetch-loop-arrays, -fprefetch-loop-arrays-rtl): * doc/invoke.texi (-fprefetch-loop-arrays, -fprefetch-loop-arrays-rtl):
......
...@@ -6195,6 +6195,11 @@ protection when @option{-fstack-protection} is used. ...@@ -6195,6 +6195,11 @@ protection when @option{-fstack-protection} is used.
@item max-jump-thread-duplication-stmts @item max-jump-thread-duplication-stmts
Maximum number of statements allowed in a block that needs to be Maximum number of statements allowed in a block that needs to be
duplicated when threading jumps. duplicated when threading jumps.
@item max-fields-for-field-sensitive
Maximum number of fields in a structure we will treat in
a field sensitive manner during pointer analysis.
@end table @end table
@end table @end table
......
...@@ -559,6 +559,14 @@ DEFPARAM (PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS, ...@@ -559,6 +559,14 @@ DEFPARAM (PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS,
"Maximum number of statements allowed in a block that needs to be duplicated when threading jumps", "Maximum number of statements allowed in a block that needs to be duplicated when threading jumps",
15, 0, 0) 15, 0, 0)
/* This is the maximum number of fields a variable may have before the pointer analysis machinery
will stop trying to treat it in a field-sensitive manner.
There are programs out there with thousands of fields per structure, and handling them
field-sensitively is not worth the cost. */
DEFPARAM (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE,
"max-fields-for-field-sensitive",
"Maximum number of fields in a structure before pointer analysis treats the structure as a single variable",
100, 0, 0)
/* /*
Local variables: Local variables:
mode:c mode:c
......
...@@ -147,4 +147,6 @@ typedef enum compiler_param ...@@ -147,4 +147,6 @@ typedef enum compiler_param
PARAM_VALUE (PARAM_MIN_VIRTUAL_MAPPINGS) PARAM_VALUE (PARAM_MIN_VIRTUAL_MAPPINGS)
#define VIRTUAL_MAPPINGS_TO_SYMS_RATIO \ #define VIRTUAL_MAPPINGS_TO_SYMS_RATIO \
PARAM_VALUE (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO) PARAM_VALUE (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO)
#define MAX_FIELDS_FOR_FIELD_SENSITIVE \
((size_t) PARAM_VALUE (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE))
#endif /* ! GCC_PARAMS_H */ #endif /* ! GCC_PARAMS_H */
...@@ -3881,7 +3881,6 @@ check_for_overlaps (VEC (fieldoff_s,heap) *fieldstack) ...@@ -3881,7 +3881,6 @@ check_for_overlaps (VEC (fieldoff_s,heap) *fieldstack)
} }
return false; return false;
} }
/* Create a varinfo structure for NAME and DECL, and add it to VARMAP. /* Create a varinfo structure for NAME and DECL, and add it to VARMAP.
This will also create any varinfo structures necessary for fields This will also create any varinfo structures necessary for fields
of DECL. */ of DECL. */
...@@ -3945,7 +3944,8 @@ create_variable_info_for (tree decl, const char *name) ...@@ -3945,7 +3944,8 @@ create_variable_info_for (tree decl, const char *name)
if (use_field_sensitive if (use_field_sensitive
&& !notokay && !notokay
&& !vi->is_unknown_size_var && !vi->is_unknown_size_var
&& var_can_have_subvars (decl)) && var_can_have_subvars (decl)
&& VEC_length (fieldoff_s, fieldstack) <= MAX_FIELDS_FOR_FIELD_SENSITIVE)
{ {
unsigned int newindex = VEC_length (varinfo_t, varmap); unsigned int newindex = VEC_length (varinfo_t, varmap);
fieldoff_s *fo = NULL; fieldoff_s *fo = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment