Re: [PATCH 56/89] Various gimple to gimple_call conversions in IPA

2014-05-12 Thread Jeff Law

On 04/21/14 10:57, David Malcolm wrote:

gcc/
* ipa-prop.c (detect_type_change): Require a gimple_call rather
than a plain gimple.
(detect_type_change_ssa): Likewise.
(compute_complex_assign_jump_func): Likewise.
(compute_complex_ancestor_jump_func): Likewise.
(compute_known_type_jump_func): Likewise.
(determine_known_aggregate_parts): Likewise.
(ipa_compute_jump_functions_for_edge): Strengthen local call to
a gimple_call; add checked cast to gimple_phi.
(ipa_note_param_call): Require a gimple_call rather than a plain
gimple.
(ipa_analyze_indirect_call_uses): Likewise.
(ipa_analyze_virtual_call_uses): Likewise.
(ipa_analyze_call_uses): Likewise.
(ipa_analyze_stmt_uses):Add checked cast to gimple_call.
(ipa_intraprocedural_devirtualization): Require a gimple_call
rather than a plain gimple.

* ipa-prop.h (ipa_intraprocedural_devirtualization): Require a
gimple_call rather than a plain gimple.

* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Replace use of is_gimple_call with dyn_cast_gimple_call and a
new local call_stmt.
---

OK once prereqs go in.
Jeff



[PATCH 56/89] Various gimple to gimple_call conversions in IPA

2014-04-21 Thread David Malcolm
gcc/
* ipa-prop.c (detect_type_change): Require a gimple_call rather
than a plain gimple.
(detect_type_change_ssa): Likewise.
(compute_complex_assign_jump_func): Likewise.
(compute_complex_ancestor_jump_func): Likewise.
(compute_known_type_jump_func): Likewise.
(determine_known_aggregate_parts): Likewise.
(ipa_compute_jump_functions_for_edge): Strengthen local call to
a gimple_call; add checked cast to gimple_phi.
(ipa_note_param_call): Require a gimple_call rather than a plain
gimple.
(ipa_analyze_indirect_call_uses): Likewise.
(ipa_analyze_virtual_call_uses): Likewise.
(ipa_analyze_call_uses): Likewise.
(ipa_analyze_stmt_uses):Add checked cast to gimple_call.
(ipa_intraprocedural_devirtualization): Require a gimple_call
rather than a plain gimple.

* ipa-prop.h (ipa_intraprocedural_devirtualization): Require a
gimple_call rather than a plain gimple.

* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Replace use of is_gimple_call with dyn_cast_gimple_call and a
new local call_stmt.
---
 gcc/ipa-prop.c | 33 +++--
 gcc/ipa-prop.h |  2 +-
 gcc/tree-ssa-pre.c | 10 +-
 3 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 45d540e..5f2f02f 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -679,7 +679,7 @@ check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, 
tree vdef, void *data)
returned by get_ref_base_and_extent, as is the offset.  */
 
 static bool
-detect_type_change (tree arg, tree base, tree comp_type, gimple call,
+detect_type_change (tree arg, tree base, tree comp_type, gimple_call call,
struct ipa_jump_func *jfunc, HOST_WIDE_INT offset)
 {
   struct type_change_info tci;
@@ -744,7 +744,7 @@ detect_type_change (tree arg, tree base, tree comp_type, 
gimple call,
 
 static bool
 detect_type_change_ssa (tree arg, tree comp_type,
-   gimple call, struct ipa_jump_func *jfunc)
+   gimple_call call, struct ipa_jump_func *jfunc)
 {
   gcc_checking_assert (TREE_CODE (arg) == SSA_NAME);
   if (!flag_devirtualize
@@ -1034,7 +1034,7 @@ static void
 compute_complex_assign_jump_func (struct ipa_node_params *info,
  struct param_analysis_info *parms_ainfo,
  struct ipa_jump_func *jfunc,
- gimple call, gimple stmt, tree name,
+ gimple_call call, gimple stmt, tree name,
  tree param_type)
 {
   HOST_WIDE_INT offset, size, max_size;
@@ -1190,7 +1190,8 @@ static void
 compute_complex_ancestor_jump_func (struct ipa_node_params *info,
struct param_analysis_info *parms_ainfo,
struct ipa_jump_func *jfunc,
-   gimple call, gimple phi, tree param_type)
+   gimple_call call, gimple_phi phi,
+   tree param_type)
 {
   HOST_WIDE_INT offset;
   gimple assign, cond;
@@ -1259,7 +1260,7 @@ compute_complex_ancestor_jump_func (struct 
ipa_node_params *info,
 
 static void
 compute_known_type_jump_func (tree op, struct ipa_jump_func *jfunc,
- gimple call, tree expected_type)
+ gimple_call call, tree expected_type)
 {
   HOST_WIDE_INT offset, size, max_size;
   tree base;
@@ -1363,7 +1364,7 @@ struct ipa_known_agg_contents_list
JFUNC is the jump function into which the constants are subsequently 
stored.  */
 
 static void
-determine_known_aggregate_parts (gimple call, tree arg, tree arg_type,
+determine_known_aggregate_parts (gimple_call call, tree arg, tree arg_type,
 struct ipa_jump_func *jfunc)
 {
   struct ipa_known_agg_contents_list *list = NULL;
@@ -1599,7 +1600,7 @@ ipa_compute_jump_functions_for_edge (struct 
param_analysis_info *parms_ainfo,
 {
   struct ipa_node_params *info = IPA_NODE_REF (cs-caller);
   struct ipa_edge_args *args = IPA_EDGE_REF (cs);
-  gimple call = cs-call_stmt;
+  gimple_call call = cs-call_stmt;
   int n, arg_num = gimple_call_num_args (call);
 
   if (arg_num == 0 || args-jump_functions)
@@ -1662,7 +1663,9 @@ ipa_compute_jump_functions_for_edge (struct 
param_analysis_info *parms_ainfo,
  call, stmt, arg, param_type);
  else if (gimple_code (stmt) == GIMPLE_PHI)
compute_complex_ancestor_jump_func (info, parms_ainfo, jfunc,
-   call, stmt, param_type);
+   call,
+   stmt-as_a_gimple_phi (),
+