Commit 34d85166 by Jan Hubicka Committed by Jan Hubicka

value-prof.c (tree_stringops_transform): New.


	* value-prof.c (tree_stringops_transform): New.
	(tree_value_profile_transformations): Require count to be non-zero;
	call stringop transform; reset stmt BSI after BB changed.
	(tree_divmod_fixed_value, tree_mod_pow2): Don't emit unnecesary label.
	(interesting_stringop_to_profile_p, tree_stringop_fixed_value): New.
	(tree_stringops_values_to_profile): New.
	(tree_values_to_profile): Call tree_stringops_values_to_profile.
	* tree.h (build_string_literal): Tidy prototype.
	(validate_arglist, builtin_memset_read_str, get_pointer_alignment):
	Declare.
	* builtins.c (validate_arglist, builtin_memset_read_str,
	get_pointer_alignment): Export.

From-SVN: r119735
parent fa283935
2006-12-11 Jan Hubicka <jh@suse.cz>
* value-prof.c (tree_stringops_transform): New.
(tree_value_profile_transformations): Require count to be non-zero;
call stringop transform; reset stmt BSI after BB changed.
(tree_divmod_fixed_value, tree_mod_pow2): Don't emit unnecesary label.
(interesting_stringop_to_profile_p, tree_stringop_fixed_value): New.
(tree_stringops_values_to_profile): New.
(tree_values_to_profile): Call tree_stringops_values_to_profile.
* tree.h (build_string_literal): Tidy prototype.
(validate_arglist, builtin_memset_read_str, get_pointer_alignment):
Declare.
* builtins.c (validate_arglist, builtin_memset_read_str,
get_pointer_alignment): Export.
2006-12-11 Uros Bizjak <ubizjak@gmail.com>
PR target/30120
......
......@@ -72,7 +72,6 @@ tree built_in_decls[(int) END_BUILTINS];
required to implement the function call in all cases). */
tree implicit_built_in_decls[(int) END_BUILTINS];
static int get_pointer_alignment (tree, unsigned int);
static const char *c_getstr (tree);
static rtx c_readstr (const char *, enum machine_mode);
static int target_char_cast (tree, char *);
......@@ -118,7 +117,6 @@ static rtx expand_builtin_strcpy (tree, tree, rtx, enum machine_mode);
static rtx expand_builtin_stpcpy (tree, rtx, enum machine_mode);
static rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode);
static rtx expand_builtin_strncpy (tree, rtx, enum machine_mode);
static rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
static rtx builtin_memset_gen_str (void *, HOST_WIDE_INT, enum machine_mode);
static rtx expand_builtin_memset (tree, rtx, enum machine_mode, tree);
static rtx expand_builtin_bzero (tree);
......@@ -141,7 +139,6 @@ static tree fold_builtin_classify_type (tree);
static tree fold_builtin_strlen (tree);
static tree fold_builtin_inf (tree, int);
static tree fold_builtin_nan (tree, tree, int);
static int validate_arglist (tree, ...);
static bool integer_valued_real_p (tree);
static tree fold_trunc_transparent_mathfn (tree, tree);
static bool readonly_data_expr (tree);
......@@ -235,7 +232,7 @@ static bool called_as_built_in (tree node)
Otherwise, look at the expression to see if we can do better, i.e., if the
expression is actually pointing at an object whose alignment is tighter. */
static int
int
get_pointer_alignment (tree exp, unsigned int max_align)
{
unsigned int align, inner;
......@@ -3486,7 +3483,7 @@ expand_builtin_strncpy (tree exp, rtx target, enum machine_mode mode)
bytes from constant string DATA + OFFSET and return it as target
constant. */
static rtx
rtx
builtin_memset_read_str (void *data, HOST_WIDE_INT offset ATTRIBUTE_UNUSED,
enum machine_mode mode)
{
......@@ -9503,7 +9500,7 @@ build_function_call_expr (tree fn, tree arglist)
of tree_codes. If the last specifier is a 0, that represents an
ellipses, otherwise the last specifier must be a VOID_TYPE. */
static int
int
validate_arglist (tree arglist, ...)
{
enum tree_code code;
......
2006-12-11 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-prof/stringop-1.c: New test.
* gcc.dg/tree-prof/stringop-2.c: New test.
2006-12-11 Uros Bizjak <ubizjak@gmail.com>
PR target/30120
/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
int a[1000];
int b[1000];
int size=1;
int max=10000;
main()
{
int i;
for (i=0;i<max; i++)
{
__builtin_memcpy (a, b, size * sizeof (a[0]));
asm("");
}
return 0;
}
/* { dg-final-use { scan-tree-dump "Single value 4 stringop" "tree_profile"} } */
/* Really this ought to simplify into assignment, but we are not there yet. */
/* { dg-final-use { scan-tree-dump "memcpy.*4\\)" "optimized"} } */
/* { dg-final-use { cleanup-tree-dump "optimized" } } */
/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */
/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
int a[1000];
int b[1000];
int size=1;
int max=10000;
main()
{
int i;
for (i=0;i<max; i++)
{
__builtin_memset (a, 10, size * sizeof (a[0]));
asm("");
}
return 0;
}
/* { dg-final-use { scan-tree-dump "Single value 4 stringop" "tree_profile"} } */
/* Really this ought to simplify into assignment, but we are not there yet. */
/* { dg-final-use { scan-tree-dump "memset.*4\\)" "optimized"} } */
/* { dg-final-use { cleanup-tree-dump "optimized" } } */
/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */
......@@ -4362,7 +4362,10 @@ extern tree strip_float_extensions (tree);
extern tree c_strlen (tree, int);
extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *);
extern tree build_va_arg_indirect_ref (tree);
tree build_string_literal (int, const char *);
extern tree build_string_literal (int, const char *);
extern int validate_arglist (tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern int get_pointer_alignment (tree, unsigned int);
/* In convert.c */
extern tree strip_float_extensions (tree);
......
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