/* Interprocedural constant propagation
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Razya Ladelsky <RAZYA@il.ibm.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 2, or (at your option) any later
+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
for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/* Interprocedural constant propagation.
The aim of interprocedural constant propagation (IPCP) is to find which
arguments
of the callsite. There are three types of values :
Formal - the caller's formal parameter is passed as an actual argument.
- Constant - a constant is passed as a an actual argument.
+ Constant - a constant is passed as an actual argument.
Unknown - neither of the above.
In order to compute the jump functions, we need the modify information for
tree init_stmt = NULL;
edge e_step;
- init_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, parm1, val);
+ init_stmt = build_gimple_modify_stmt (parm1, val);
if (init_stmt)
{
ipcp_propagate_stage (void)
{
int i;
- struct ipcp_formal cval1 = { 0, {0} }, cval = { 0,{0} };
+ struct ipcp_formal cval1 = { BOTTOM, {0} }, cval = { BOTTOM, {0} };
struct ipcp_formal *cval2;
struct cgraph_node *mt, *callee;
struct cgraph_edge *cs;
ENTRY_BLOCK_PTR_FOR_FUNCTION (DECL_STRUCT_FUNCTION (node->decl));
fprintf (f, "ENTRY: Count");
fprintf (f, " " HOST_WIDE_INT_PRINT_DEC
- " Frquency %d\n", (HOST_WIDE_INT) bb->count,
+ " Frequency %d\n", (HOST_WIDE_INT) bb->count,
bb->frequency);
FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (node->decl))
if (ipcp_redirect (cs))
{
cgraph_redirect_edge_callee (cs, orig_callee);
- TREE_OPERAND (TREE_OPERAND
- (get_call_expr_in (cs->call_stmt), 0), 0) =
+ TREE_OPERAND (CALL_EXPR_FN (get_call_expr_in (cs->call_stmt)),
+ 0) =
orig_callee->decl;
}
}
return flag_ipa_cp;
}
-struct tree_opt_pass pass_ipa_cp = {
+struct simple_ipa_opt_pass pass_ipa_cp =
+{
+ {
+ SIMPLE_IPA_PASS,
"cp", /* name */
cgraph_gate_cp, /* gate */
ipcp_driver, /* execute */
PROP_trees, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_cgraph | TODO_dump_func, /* todo_flags_finish */
- 0 /* letter */
+ TODO_dump_cgraph | TODO_dump_func /* todo_flags_finish */
+ }
};