/* Scalar Replacement of Aggregates (SRA) converts some structure
references into scalar references, exposing them to the scalar
optimizers.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
*/
+/* The set of todo flags to return from tree_sra. */
+static unsigned int todoflags;
+
/* The set of aggregate variables that are candidates for scalarization. */
static bitmap sra_candidates;
enum tree_code code = TREE_CODE (type);
return (code == INTEGER_TYPE || code == REAL_TYPE || code == VECTOR_TYPE
|| code == ENUMERAL_TYPE || code == BOOLEAN_TYPE
- || code == CHAR_TYPE || code == POINTER_TYPE || code == OFFSET_TYPE
+ || code == POINTER_TYPE || code == OFFSET_TYPE
|| code == REFERENCE_TYPE);
}
bitmap_and_compl_into (needs_copy_in, &done_head);
}
bitmap_clear (&done_head);
+
+ if (!bitmap_empty_p (sra_candidates))
+ todoflags |= TODO_update_smt_usage;
mark_set_for_renaming (sra_candidates);
}
case ARRAY_TYPE:
+ todoflags |= TODO_update_smt_usage;
return build4 (ARRAY_REF, elt->type, base, elt->element, NULL, NULL);
case COMPLEX_TYPE:
/* Main entry point. */
-static void
+static unsigned int
tree_sra (void)
{
/* Initialize local variables. */
+ todoflags = 0;
gcc_obstack_init (&sra_obstack);
sra_candidates = BITMAP_ALLOC (NULL);
needs_copy_in = BITMAP_ALLOC (NULL);
BITMAP_FREE (sra_type_decomp_cache);
BITMAP_FREE (sra_type_inst_cache);
obstack_free (&sra_obstack, NULL);
+ return todoflags;
}
static bool
TV_TREE_SRA, /* tv_id */
PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
0, /* properties_provided */
- 0, /* properties_destroyed */
+ PROP_smt_usage, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_update_ssa
- | TODO_ggc_collect | TODO_verify_ssa, /* todo_flags_finish */
+ TODO_dump_func /* todo_flags_finish */
+ | TODO_update_ssa
+ | TODO_ggc_collect | TODO_verify_ssa,
0 /* letter */
};