diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-14 14:16:18 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-14 14:16:18 +0000 |
commit | 7c782c9bbcbd04c8c9d8636e592f1a5add925a8b (patch) | |
tree | b38a67eaafc48783434ab6dd1c724690d27e7f87 /gcc | |
parent | 2ce053a0f4bd1c85bcb87f3d28b6e0caad5ae59c (diff) | |
download | gcc-7c782c9bbcbd04c8c9d8636e592f1a5add925a8b.tar.gz |
2012-08-14 Richard Guenther <rguenther@suse.de>
* cfgexpand.c (expand_used_vars): Use virtual_operand_p.
* gimple-pretty-print.c (dump_phi_nodes): Likewise.
* gimple-streamer-out.c (output_bb): Likewise.
* graphite-sese-to-poly.c (scalar_close_phi_node_p): Likewise.
(rewrite_reductions_out_of_ssa): Likewise.
(rewrite_commutative_reductions_out_of_ss): Likewise.
* ipa-split.c (verify_non_ssa_vars): Likewise.
(consider_split): Likewise.
(visit_bb): Likewise.
(split_function): Likewise.
* lto-streamer-out.c (output_ssa_names): Likewise.
* sese.c (rename_uses): Likewise.
* tree-cfg.c (replace_uses_by): Likewise.
(gimple_merge_blocks): Likewise.
(gimple_cfg2dot): Likewise.
(verify_gimple_phi): Likewise.
(replace_ssa_name): Likewise.
(move_block_to_fn): Likewise.
* tree-eh.c (cleanup_empty_eh_merge_phis): Likewise.
* tree-if-conv.c (if_convertible_phi_p): Likewise.
(predicate_scalar_phi): Likewise.
* tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
(copy_phis_for_bb): Likewise.
* tree-loop-distribution.c (generate_loops_for_partition): Likewise.
(destroy_loop): Likewise.
* tree-outof-ssa.c (eliminate_useless_phis): Likewise.
(insert_backedge_copies): Likewise.
* tree-parloops.c (transform_to_exit_first_loop): Likewise.
(gather_scalar_reductions): Likewise.
(try_create_reduction_list): Likewise.
* tree-scalar-evolution.c (analyze_scalar_evolution_for_all_loop_ph):
Likewise.
(scev_const_prop): Likewise.
* tree-ssa-ccp.c (debug_lattice_value): Likewise.
(get_default_value): Likewise.
(ccp_initialize): Likewise.
* tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
* tree-ssa-copy.c (may_propagate_copy): Likewise.
(init_copy_prop): Likewise.
* tree-ssa-dce.c (propagate_necessity): Likewise.
(remove_dead_phis): Likewise.
(forward_edge_to_pdom): Likewise.
(eliminate_unnecessary_stmts): Likewise.
* tree-ssa-live.c (partition_view_init): Likewise.
(remove_unused_locals): Likewise.
(register_ssa_partition_check): Likewise.
* tree-ssa-loop-im.c (movement_possibility): Likewise.
(move_computations_stmt): Likewise.
* tree-ssa-loop-ivopts.c (determine_biv_step): Likewise.
(record_invariant): Likewise.
(find_interesting_uses_outside): Likewise.
(determine_set_costs): Likewise.
* tree-ssa-loop-manip.c (add_exit_phis_var): Likewise.
(find_uses_to_rename_use): Likewise.
(check_loop_closed_ssa_use): Likewise.
(rewrite_phi_with_iv): Likewise.
(canonicalize_loop_ivs): Likewise.
* tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
* tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
* tree-ssa-pre.c (make_values_for_phi): Likewise.
(compute_avail): Likewise.
(eliminate): Likewise.
* tree-ssa-propagate.c (substitute_and_fold): Likewise.
* tree-ssa-reassoc.c (phi_rank): Likewise.
* tree-ssa-strlen.c (strlen_enter_block): Likewise.
* tree-ssa-structalias.c (compute_points_to_sets): Likewise.
(ipa_pta_execute): Likewise.
* tree-ssa-tail-merge.c (same_succ_hash): Likewise.
(release_last_vdef): Likewise.
(same_phi_alternatives_1): Likewise.
(bb_has_non_vop_phi): Likewise.
(vop_phi): Likewise.
* tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
Likewise.
* tree-ssa-uninit.c (warn_uninitialized_phi): Likewise.
(execute_late_warn_uninitialized): Likewise.
* tree-ssa.c (verify_ssa_name): Likewise.
(verify_phi_args): Likewise.
(verify_ssa): Likewise.
* tree-stdarg.c (execute_optimize_stdarg): Likewise.
* tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1): Likewise.
(slpeel_tree_peel_loop_to_edge): Likewise.
(vect_can_advance_ivs_p): Likewise.
(vect_update_ivs_after_vectorizer): Likewise.
* tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
* tree-vrp.c (remove_range_assertions): Likewise.
* value-prof.c (gimple_divmod_values_to_profile): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190385 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
40 files changed, 204 insertions, 120 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e6b279b1d90..bc539945b23 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,95 @@ 2012-08-14 Richard Guenther <rguenther@suse.de> + * cfgexpand.c (expand_used_vars): Use virtual_operand_p. + * gimple-pretty-print.c (dump_phi_nodes): Likewise. + * gimple-streamer-out.c (output_bb): Likewise. + * graphite-sese-to-poly.c (scalar_close_phi_node_p): Likewise. + (rewrite_reductions_out_of_ssa): Likewise. + (rewrite_commutative_reductions_out_of_ss): Likewise. + * ipa-split.c (verify_non_ssa_vars): Likewise. + (consider_split): Likewise. + (visit_bb): Likewise. + (split_function): Likewise. + * lto-streamer-out.c (output_ssa_names): Likewise. + * sese.c (rename_uses): Likewise. + * tree-cfg.c (replace_uses_by): Likewise. + (gimple_merge_blocks): Likewise. + (gimple_cfg2dot): Likewise. + (verify_gimple_phi): Likewise. + (replace_ssa_name): Likewise. + (move_block_to_fn): Likewise. + * tree-eh.c (cleanup_empty_eh_merge_phis): Likewise. + * tree-if-conv.c (if_convertible_phi_p): Likewise. + (predicate_scalar_phi): Likewise. + * tree-inline.c (update_ssa_across_abnormal_edges): Likewise. + (copy_phis_for_bb): Likewise. + * tree-loop-distribution.c (generate_loops_for_partition): Likewise. + (destroy_loop): Likewise. + * tree-outof-ssa.c (eliminate_useless_phis): Likewise. + (insert_backedge_copies): Likewise. + * tree-parloops.c (transform_to_exit_first_loop): Likewise. + (gather_scalar_reductions): Likewise. + (try_create_reduction_list): Likewise. + * tree-scalar-evolution.c (analyze_scalar_evolution_for_all_loop_ph): + Likewise. + (scev_const_prop): Likewise. + * tree-ssa-ccp.c (debug_lattice_value): Likewise. + (get_default_value): Likewise. + (ccp_initialize): Likewise. + * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. + * tree-ssa-copy.c (may_propagate_copy): Likewise. + (init_copy_prop): Likewise. + * tree-ssa-dce.c (propagate_necessity): Likewise. + (remove_dead_phis): Likewise. + (forward_edge_to_pdom): Likewise. + (eliminate_unnecessary_stmts): Likewise. + * tree-ssa-live.c (partition_view_init): Likewise. + (remove_unused_locals): Likewise. + (register_ssa_partition_check): Likewise. + * tree-ssa-loop-im.c (movement_possibility): Likewise. + (move_computations_stmt): Likewise. + * tree-ssa-loop-ivopts.c (determine_biv_step): Likewise. + (record_invariant): Likewise. + (find_interesting_uses_outside): Likewise. + (determine_set_costs): Likewise. + * tree-ssa-loop-manip.c (add_exit_phis_var): Likewise. + (find_uses_to_rename_use): Likewise. + (check_loop_closed_ssa_use): Likewise. + (rewrite_phi_with_iv): Likewise. + (canonicalize_loop_ivs): Likewise. + * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. + * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. + * tree-ssa-pre.c (make_values_for_phi): Likewise. + (compute_avail): Likewise. + (eliminate): Likewise. + * tree-ssa-propagate.c (substitute_and_fold): Likewise. + * tree-ssa-reassoc.c (phi_rank): Likewise. + * tree-ssa-strlen.c (strlen_enter_block): Likewise. + * tree-ssa-structalias.c (compute_points_to_sets): Likewise. + (ipa_pta_execute): Likewise. + * tree-ssa-tail-merge.c (same_succ_hash): Likewise. + (release_last_vdef): Likewise. + (same_phi_alternatives_1): Likewise. + (bb_has_non_vop_phi): Likewise. + (vop_phi): Likewise. + * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis): + Likewise. + * tree-ssa-uninit.c (warn_uninitialized_phi): Likewise. + (execute_late_warn_uninitialized): Likewise. + * tree-ssa.c (verify_ssa_name): Likewise. + (verify_phi_args): Likewise. + (verify_ssa): Likewise. + * tree-stdarg.c (execute_optimize_stdarg): Likewise. + * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1): Likewise. + (slpeel_tree_peel_loop_to_edge): Likewise. + (vect_can_advance_ivs_p): Likewise. + (vect_update_ivs_after_vectorizer): Likewise. + * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise. + * tree-vrp.c (remove_range_assertions): Likewise. + * value-prof.c (gimple_divmod_values_to_profile): Likewise. + +2012-08-14 Richard Guenther <rguenther@suse.de> + PR tree-optimization/54146 * tree-ssa-pre.c (do_regular_insertion): Use a VEC indexed by pred edge index for avail. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 6793ba68daf..da383a932f3 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1471,7 +1471,7 @@ expand_used_vars (void) { tree var = partition_to_var (SA.map, i); - gcc_assert (is_gimple_reg (var)); + gcc_assert (!virtual_operand_p (var)); /* Assign decls to each SSA name partition, share decls for partitions we could have coalesced (those with the same type). */ diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c index ccf995c4a5d..3b25020340c 100644 --- a/gcc/gimple-pretty-print.c +++ b/gcc/gimple-pretty-print.c @@ -2128,7 +2128,7 @@ dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags) for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i)) { gimple phi = gsi_stmt (i); - if (is_gimple_reg (gimple_phi_result (phi)) || (flags & TDF_VOPS)) + if (!virtual_operand_p (gimple_phi_result (phi)) || (flags & TDF_VOPS)) { INDENT (indent); pp_string (buffer, "# "); diff --git a/gcc/gimple-streamer-out.c b/gcc/gimple-streamer-out.c index b7e840844da..5be8567d69a 100644 --- a/gcc/gimple-streamer-out.c +++ b/gcc/gimple-streamer-out.c @@ -210,7 +210,7 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn) /* Only emit PHIs for gimple registers. PHI nodes for .MEM will be filled in on reading when the SSA form is updated. */ - if (is_gimple_reg (gimple_phi_result (phi))) + if (!virtual_operand_p (gimple_phi_result (phi))) output_phi (ob, phi); } diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index c1686221187..67412a0529f 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -2110,7 +2110,7 @@ static bool scalar_close_phi_node_p (gimple phi) { if (gimple_code (phi) != GIMPLE_PHI - || !is_gimple_reg (gimple_phi_result (phi))) + || virtual_operand_p (gimple_phi_result (phi))) return false; /* Note that loop close phi nodes should have a single argument @@ -2318,7 +2318,7 @@ rewrite_reductions_out_of_ssa (scop_p scop) { gimple phi = gsi_stmt (psi); - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) { gsi_next (&psi); continue; @@ -3079,7 +3079,7 @@ rewrite_commutative_reductions_out_of_ssa_loop (scop_p scop, for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi)) if ((res = gimple_phi_result (gsi_stmt (gsi))) - && is_gimple_reg (res) + && !virtual_operand_p (res) && !scev_analyzable_p (res, SCOP_REGION (scop))) changed |= rewrite_commutative_reductions_out_of_ssa_close_phi (scop, gsi_stmt (gsi)); diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 2b5bc22b60f..4e5a179bbca 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -258,7 +258,7 @@ verify_non_ssa_vars (struct split_point *current, bitmap non_ssa_vars, gimple stmt = gsi_stmt (bsi); tree op = gimple_phi_arg_def (stmt, e->dest_idx); - if (!is_gimple_reg (gimple_phi_result (stmt))) + if (virtual_operand_p (gimple_phi_result (stmt))) continue; if (TREE_CODE (op) != SSA_NAME && test_nonssa_use (stmt, op, non_ssa_vars)) @@ -402,7 +402,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, gimple stmt = gsi_stmt (bsi); tree val = NULL; - if (!is_gimple_reg (gimple_phi_result (stmt))) + if (virtual_operand_p (gimple_phi_result (stmt))) continue; for (i = 0; i < gimple_phi_num_args (stmt); i++) { @@ -553,7 +553,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, gimple_stmt_iterator psi; for (psi = gsi_start_phis (return_bb); !gsi_end_p (psi); gsi_next (&psi)) - if (is_gimple_reg (gimple_phi_result (gsi_stmt (psi))) + if (!virtual_operand_p (gimple_phi_result (gsi_stmt (psi))) && !(retval && current->split_part_set_retval && TREE_CODE (retval) == SSA_NAME @@ -804,9 +804,7 @@ visit_bb (basic_block bb, basic_block return_bb, gimple stmt = gsi_stmt (bsi); unsigned int i; - if (is_gimple_debug (stmt)) - continue; - if (!is_gimple_reg (gimple_phi_result (stmt))) + if (virtual_operand_p (gimple_phi_result (stmt))) continue; bitmap_set_bit (set_ssa_names, SSA_NAME_VERSION (gimple_phi_result (stmt))); @@ -830,9 +828,7 @@ visit_bb (basic_block bb, basic_block return_bb, gimple stmt = gsi_stmt (bsi); tree op = gimple_phi_arg_def (stmt, e->dest_idx); - if (is_gimple_debug (stmt)) - continue; - if (!is_gimple_reg (gimple_phi_result (stmt))) + if (virtual_operand_p (gimple_phi_result (stmt))) continue; if (TREE_CODE (op) == SSA_NAME) bitmap_set_bit (used_ssa_names, SSA_NAME_VERSION (op)); @@ -1158,7 +1154,7 @@ split_function (struct split_point *split_point) for (gsi = gsi_start_phis (return_bb); !gsi_end_p (gsi);) { gimple stmt = gsi_stmt (gsi); - if (is_gimple_reg (gimple_phi_result (stmt))) + if (!virtual_operand_p (gimple_phi_result (stmt))) { gsi_next (&gsi); continue; @@ -1275,7 +1271,7 @@ split_function (struct split_point *split_point) /* See if there is PHI defining return value. */ for (psi = gsi_start_phis (return_bb); !gsi_end_p (psi); gsi_next (&psi)) - if (is_gimple_reg (gimple_phi_result (gsi_stmt (psi)))) + if (!virtual_operand_p (gimple_phi_result (gsi_stmt (psi)))) break; /* When there is PHI, just update its value. */ diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index f5532d039a7..2adae7445a2 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -613,7 +613,7 @@ output_ssa_names (struct output_block *ob, struct function *fn) if (ptr == NULL_TREE || SSA_NAME_IN_FREE_LIST (ptr) - || !is_gimple_reg (ptr)) + || virtual_operand_p (ptr)) continue; streamer_write_uhwi (ob, i); diff --git a/gcc/sese.c b/gcc/sese.c index 44bc74044b6..bfb797150ba 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -480,14 +480,13 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt, return false; } - FOR_EACH_SSA_USE_OPERAND (use_p, copy, op_iter, SSA_OP_ALL_USES) + FOR_EACH_SSA_USE_OPERAND (use_p, copy, op_iter, SSA_OP_USE) { tree old_name = USE_FROM_PTR (use_p); tree new_expr, scev; gimple_seq stmts; if (TREE_CODE (old_name) != SSA_NAME - || !is_gimple_reg (old_name) || SSA_NAME_IS_DEFAULT_DEF (old_name)) continue; @@ -499,8 +498,7 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt, tree type_new_expr = TREE_TYPE (new_expr); if (type_old_name != type_new_expr - || (TREE_CODE (new_expr) != SSA_NAME - && is_gimple_reg (old_name))) + || TREE_CODE (new_expr) != SSA_NAME) { tree var = create_tmp_var (type_old_name, "var"); diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index f1e9ddf52b2..6ee01a36ef2 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1589,7 +1589,7 @@ replace_uses_by (tree name, tree val) /* This can only occur for virtual operands, since for the real ones SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name)) would prevent replacement. */ - gcc_checking_assert (!is_gimple_reg (name)); + gcc_checking_assert (virtual_operand_p (name)); SSA_NAME_OCCURS_IN_ABNORMAL_PHI (val) = 1; } } @@ -1664,21 +1664,21 @@ gimple_merge_blocks (basic_block a, basic_block b) gimple phi = gsi_stmt (psi); tree def = gimple_phi_result (phi), use = gimple_phi_arg_def (phi, 0); gimple copy; - bool may_replace_uses = !is_gimple_reg (def) - || may_propagate_copy (def, use); + bool may_replace_uses = (virtual_operand_p (def) + || may_propagate_copy (def, use)); /* In case we maintain loop closed ssa form, do not propagate arguments of loop exit phi nodes. */ if (current_loops && loops_state_satisfies_p (LOOP_CLOSED_SSA) - && is_gimple_reg (def) + && !virtual_operand_p (def) && TREE_CODE (use) == SSA_NAME && a->loop_father != b->loop_father) may_replace_uses = false; if (!may_replace_uses) { - gcc_assert (is_gimple_reg (def)); + gcc_assert (!virtual_operand_p (def)); /* Note that just emitting the copies is fine -- there is no problem with ordering of phi nodes. This is because A is the single @@ -1693,7 +1693,7 @@ gimple_merge_blocks (basic_block a, basic_block b) /* If we deal with a PHI for virtual operands, we can simply propagate these without fussing with folding or updating the stmt. */ - if (!is_gimple_reg (def)) + if (virtual_operand_p (def)) { imm_use_iterator iter; use_operand_p use_p; @@ -4357,7 +4357,7 @@ verify_gimple_phi (gimple phi) return true; } - virtual_p = !is_gimple_reg (phi_result); + virtual_p = virtual_operand_p (phi_result); if (TREE_CODE (phi_result) != SSA_NAME || (virtual_p && SSA_NAME_VAR (phi_result) != gimple_vop (cfun))) @@ -4379,7 +4379,7 @@ verify_gimple_phi (gimple phi) /* Addressable variables do have SSA_NAMEs but they are not considered gimple values. */ else if ((TREE_CODE (t) == SSA_NAME - && virtual_p != !is_gimple_reg (t)) + && virtual_p != virtual_operand_p (t)) || (virtual_p && (TREE_CODE (t) != SSA_NAME || SSA_NAME_VAR (t) != gimple_vop (cfun))) @@ -5948,7 +5948,7 @@ replace_ssa_name (tree name, struct pointer_map_t *vars_map, void **loc; tree new_name; - gcc_assert (is_gimple_reg (name)); + gcc_assert (!virtual_operand_p (name)); loc = pointer_map_contains (vars_map, name); @@ -6235,7 +6235,7 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb, tree op = PHI_RESULT (phi); ssa_op_iter oi; - if (!is_gimple_reg (op)) + if (virtual_operand_p (op)) { /* Remove the phi nodes for virtual operands (alias analysis will be run for the new function, anyway). */ diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index bd9294dedc5..9220931ffff 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -3857,7 +3857,7 @@ cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb, } /* If we didn't find the PHI, but it's a VOP, remember to rename it later, assuming all other tests succeed. */ - else if (!is_gimple_reg (nresult)) + else if (virtual_operand_p (nresult)) bitmap_set_bit (rename_virts, SSA_NAME_VERSION (nresult)); /* If we didn't find the PHI, and it's a real variable, we know from the fact that OLD_BB is tree_empty_eh_handler_p that the diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 828969103a3..1086004d3fb 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -410,7 +410,7 @@ if_convertible_phi_p (struct loop *loop, basic_block bb, gimple phi) /* When the flag_tree_loop_if_convert_stores is not set, check that there are no memory writes in the branches of the loop to be if-converted. */ - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) { imm_use_iterator imm_iter; use_operand_p use_p; @@ -1262,7 +1262,7 @@ predicate_scalar_phi (gimple phi, tree cond, res = gimple_phi_result (phi); /* Do not handle virtual phi nodes. */ - if (!is_gimple_reg (res)) + if (virtual_operand_p (res)) return; bb = gimple_bb (phi); diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 879292b72e1..fe46e5d5353 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1830,7 +1830,7 @@ update_ssa_across_abnormal_edges (basic_block bb, basic_block ret_bb, gcc_assert ((e->flags & EDGE_EH) || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi))); - if (!is_gimple_reg (PHI_RESULT (phi))) + if (virtual_operand_p (PHI_RESULT (phi))) { mark_virtual_operands_for_renaming (cfun); continue; @@ -1970,7 +1970,7 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id) phi = gsi_stmt (si); res = PHI_RESULT (phi); new_res = res; - if (is_gimple_reg (res)) + if (!virtual_operand_p (res)) { walk_tree (&new_res, copy_tree_body_r, id, NULL); new_phi = create_phi_node (new_res, new_bb); diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 377b544b40d..f340eab2a0f 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -288,7 +288,7 @@ generate_loops_for_partition (struct loop *loop, partition_t partition, if (!bitmap_bit_p (partition->stmts, x++)) { gimple phi = gsi_stmt (bsi); - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) mark_virtual_phi_result_for_renaming (phi); remove_phi_node (&bsi, true); } @@ -492,7 +492,7 @@ destroy_loop (struct loop *loop) for (gsi = gsi_start_phis (bbs[i]); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple phi = gsi_stmt (gsi); - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) mark_virtual_phi_result_for_renaming (phi); } for (gsi = gsi_start_bb (bbs[i]); !gsi_end_p (gsi); gsi_next (&gsi)) diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c index 5d5d323a07b..5c2e93b9317 100644 --- a/gcc/tree-outof-ssa.c +++ b/gcc/tree-outof-ssa.c @@ -762,7 +762,7 @@ eliminate_useless_phis (void) { gimple phi = gsi_stmt (gsi); result = gimple_phi_result (phi); - if (!is_gimple_reg (result)) + if (virtual_operand_p (result)) { #ifdef ENABLE_CHECKING size_t i; @@ -772,7 +772,7 @@ eliminate_useless_phis (void) { tree arg = PHI_ARG_DEF (phi, i); if (TREE_CODE (arg) == SSA_NAME - && is_gimple_reg (arg)) + && !virtual_operand_p (arg)) { fprintf (stderr, "Argument of PHI is not virtual ("); print_generic_expr (stderr, arg, TDF_SLIM); @@ -1032,7 +1032,7 @@ insert_backedge_copies (void) tree result = gimple_phi_result (phi); size_t i; - if (!is_gimple_reg (result)) + if (virtual_operand_p (result)) continue; for (i = 0; i < gimple_phi_num_args (phi); i++) diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 224d546b755..76bb265954e 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1517,7 +1517,7 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit { phi = gsi_stmt (gsi); res = PHI_RESULT (phi); - if (!is_gimple_reg (res)) + if (virtual_operand_p (res)) { gsi_next (&gsi); continue; @@ -1953,7 +1953,7 @@ gather_scalar_reductions (loop_p loop, htab_t reduction_list) tree res = PHI_RESULT (phi); bool double_reduc; - if (!is_gimple_reg (res)) + if (virtual_operand_p (res)) continue; if (!simple_iv (loop, loop, res, &iv, true) @@ -2019,7 +2019,7 @@ try_create_reduction_list (loop_p loop, htab_t reduction_list) gimple reduc_phi; tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit); - if (is_gimple_reg (val)) + if (!virtual_operand_p (val)) { if (dump_file && (dump_flags & TDF_DETAILS)) { @@ -2074,7 +2074,7 @@ try_create_reduction_list (loop_p loop, htab_t reduction_list) tree def = PHI_RESULT (phi); affine_iv iv; - if (is_gimple_reg (def) && !simple_iv (loop, loop, def, &iv, true)) + if (!virtual_operand_p (def) && !simple_iv (loop, loop, def, &iv, true)) { struct reduction_info *red; diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index c1e0736e0b0..d88bb1aa861 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -3039,7 +3039,7 @@ analyze_scalar_evolution_for_all_loop_phi_nodes (VEC(gimple,heap) **exit_conditi for (psi = gsi_start_phis (bb); !gsi_end_p (psi); gsi_next (&psi)) { phi = gsi_stmt (psi); - if (is_gimple_reg (PHI_RESULT (phi))) + if (!virtual_operand_p (PHI_RESULT (phi))) { chrec = instantiate_parameters (loop, @@ -3328,7 +3328,7 @@ scev_const_prop (void) phi = gsi_stmt (psi); name = PHI_RESULT (phi); - if (!is_gimple_reg (name)) + if (virtual_operand_p (name)) continue; type = TREE_TYPE (name); @@ -3404,7 +3404,7 @@ scev_const_prop (void) phi = gsi_stmt (psi); rslt = PHI_RESULT (phi); def = PHI_ARG_DEF_FROM_EDGE (phi, exit); - if (!is_gimple_reg (def)) + if (virtual_operand_p (def)) { gsi_next (&psi); continue; diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 83ed653ac03..8e42a51d53d 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -236,7 +236,6 @@ debug_lattice_value (prop_value_t val) static prop_value_t get_default_value (tree var) { - tree sym = SSA_NAME_VAR (var); prop_value_t val = { UNINITIALIZED, NULL_TREE, { 0, 0 } }; gimple stmt; @@ -248,8 +247,8 @@ get_default_value (tree var) before being initialized. If VAR is a local variable, we can assume initially that it is UNDEFINED, otherwise we must consider it VARYING. */ - if (is_gimple_reg (sym) - && TREE_CODE (sym) == VAR_DECL) + if (!virtual_operand_p (var) + && TREE_CODE (SSA_NAME_VAR (var)) == VAR_DECL) val.lattice_val = UNDEFINED; else { @@ -762,7 +761,7 @@ ccp_initialize (void) { gimple phi = gsi_stmt (i); - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) prop_set_simulate_again (phi, false); else prop_set_simulate_again (phi, true); diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index b8b1a51dd72..f4f5eb3373c 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -1101,7 +1101,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy) for (i = 1; i < num_ssa_names; i++) { var = ssa_name (i); - if (var != NULL_TREE && is_gimple_reg (var)) + if (var != NULL_TREE && !virtual_operand_p (var)) { /* Add coalesces between all the result decls. */ if (SSA_NAME_VAR (var) diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index b53abb1d0d2..04a376ed970 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -74,10 +74,10 @@ may_propagate_copy (tree dest, tree orig) return false; /* Propagating virtual operands is always ok. */ - if (TREE_CODE (dest) == SSA_NAME && !is_gimple_reg (dest)) + if (TREE_CODE (dest) == SSA_NAME && virtual_operand_p (dest)) { /* But only between virtual operands. */ - gcc_assert (TREE_CODE (orig) == SSA_NAME && !is_gimple_reg (orig)); + gcc_assert (TREE_CODE (orig) == SSA_NAME && virtual_operand_p (orig)); return true; } @@ -713,7 +713,7 @@ init_copy_prop (void) tree def; def = gimple_phi_result (phi); - if (!is_gimple_reg (def)) + if (virtual_operand_p (def)) prop_set_simulate_again (phi, false); else prop_set_simulate_again (phi, true); diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index c1db16b7fec..0112fc4c1c3 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -720,7 +720,7 @@ propagate_necessity (struct edge_list *el) if (gimple_code (stmt) == GIMPLE_PHI /* We do not process virtual PHI nodes nor do we track their necessity. */ - && is_gimple_reg (gimple_phi_result (stmt))) + && !virtual_operand_p (gimple_phi_result (stmt))) { /* PHI nodes are somewhat special in that each PHI alternative has data and control dependencies. All the statements feeding the @@ -1052,7 +1052,7 @@ remove_dead_phis (basic_block bb) /* We do not track necessity of virtual PHI nodes. Instead do very simple dead PHI removal here. */ - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) { /* Virtual PHI nodes with one or identical arguments can be removed. */ @@ -1130,7 +1130,7 @@ forward_edge_to_pdom (edge e, basic_block post_dom_bb) /* PHIs for virtuals have no control dependency relation on them. We are lost here and must force renaming of the symbol. */ - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) { mark_virtual_phi_result_for_renaming (phi); remove_phi_node (&gsi, true); @@ -1391,7 +1391,7 @@ eliminate_unnecessary_stmts (void) || !(bb->flags & BB_REACHABLE)) { for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - if (!is_gimple_reg (gimple_phi_result (gsi_stmt (gsi)))) + if (virtual_operand_p (gimple_phi_result (gsi_stmt (gsi)))) { bool found = false; imm_use_iterator iter; diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index 85c71fc4ad7..bd6ac9a76db 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -240,7 +240,7 @@ partition_view_init (var_map map) for (x = 0; x < map->partition_size; x++) { tmp = partition_find (map->var_partition, x); - if (ssa_name (tmp) != NULL_TREE && is_gimple_reg (ssa_name (tmp)) + if (ssa_name (tmp) != NULL_TREE && !virtual_operand_p (ssa_name (tmp)) && (!has_zero_uses (ssa_name (tmp)) || !SSA_NAME_IS_DEFAULT_DEF (ssa_name (tmp)))) bitmap_set_bit (used, tmp); @@ -750,7 +750,7 @@ remove_unused_locals (void) tree def; gimple phi = gsi_stmt (gsi); - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) continue; def = gimple_phi_result (phi); @@ -1216,7 +1216,7 @@ void register_ssa_partition_check (tree ssa_var) { gcc_assert (TREE_CODE (ssa_var) == SSA_NAME); - if (!is_gimple_reg (ssa_var)) + if (virtual_operand_p (ssa_var)) { fprintf (stderr, "Illegally registering a virtual SSA name :"); print_generic_expr (stderr, ssa_var, TDF_SLIM); diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 618233aa3ba..e40a6e4098d 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -356,7 +356,7 @@ movement_possibility (gimple stmt) if (gimple_code (stmt) == GIMPLE_PHI && gimple_phi_num_args (stmt) <= 2 - && is_gimple_reg (gimple_phi_result (stmt)) + && !virtual_operand_p (gimple_phi_result (stmt)) && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_phi_result (stmt))) return MOVE_POSSIBLE; @@ -1327,7 +1327,7 @@ move_computations_stmt (struct dom_walk_data *dw_data, !gsi_end_p (gsi2); gsi_next (&gsi2)) { gimple phi = gsi_stmt (gsi2); - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) { gimple_set_vuse (stmt, PHI_ARG_DEF_FROM_EDGE (phi, e)); break; diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 81271a705ba..9e0c40a7347 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -980,7 +980,7 @@ determine_biv_step (gimple phi) tree name = PHI_RESULT (phi); affine_iv iv; - if (!is_gimple_reg (name)) + if (virtual_operand_p (name)) return NULL_TREE; if (!simple_iv (loop, loop, name, &iv, true)) @@ -1225,7 +1225,7 @@ record_invariant (struct ivopts_data *data, tree op, bool nonlinear_use) struct version_info *info; if (TREE_CODE (op) != SSA_NAME - || !is_gimple_reg (op)) + || virtual_operand_p (op)) return; bb = gimple_bb (SSA_NAME_DEF_STMT (op)); @@ -1927,7 +1927,7 @@ find_interesting_uses_outside (struct ivopts_data *data, edge exit) { phi = gsi_stmt (psi); def = PHI_ARG_DEF_FROM_EDGE (phi, exit); - if (is_gimple_reg (def)) + if (!virtual_operand_p (def)) find_interesting_uses_op (data, def); } } @@ -5048,7 +5048,7 @@ determine_set_costs (struct ivopts_data *data) phi = gsi_stmt (psi); op = PHI_RESULT (phi); - if (!is_gimple_reg (op)) + if (virtual_operand_p (op)) continue; if (get_iv (data, op)) diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index 31d4a6c7c9f..5045eccd55d 100644 --- a/gcc/tree-ssa-loop-manip.c +++ b/gcc/tree-ssa-loop-manip.c @@ -169,7 +169,7 @@ add_exit_phis_var (tree var, bitmap livein, bitmap exits) basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (var)); bitmap_iterator bi; - gcc_checking_assert (is_gimple_reg (var)); + gcc_checking_assert (! virtual_operand_p (var)); bitmap_clear_bit (livein, def_bb->index); def = BITMAP_ALLOC (&loop_renamer_obstack); @@ -243,7 +243,7 @@ find_uses_to_rename_use (basic_block bb, tree use, bitmap *use_blocks, return; /* We don't need to keep virtual operands in loop-closed form. */ - if (!is_gimple_reg (use)) + if (virtual_operand_p (use)) return; ver = SSA_NAME_VERSION (use); @@ -417,7 +417,7 @@ check_loop_closed_ssa_use (basic_block bb, tree use) gimple def; basic_block def_bb; - if (TREE_CODE (use) != SSA_NAME || !is_gimple_reg (use)) + if (TREE_CODE (use) != SSA_NAME || virtual_operand_p (use)) return; def = SSA_NAME_DEF_STMT (use); @@ -1121,7 +1121,7 @@ rewrite_phi_with_iv (loop_p loop, gimple stmt, phi = gsi_stmt (*psi); tree atype, mtype, val, res = PHI_RESULT (phi); - if (!is_gimple_reg (res) || res == main_iv) + if (virtual_operand_p (res) || res == main_iv) { gsi_next (psi); return; @@ -1205,7 +1205,7 @@ canonicalize_loop_ivs (struct loop *loop, tree *nit, bool bump_in_latch) bool uns; type = TREE_TYPE (res); - if (!is_gimple_reg (res) + if (virtual_operand_p (res) || (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type)) || TYPE_PRECISION (type) < precision) diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 2eed792da01..0d6eeb69055 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -531,8 +531,8 @@ execute_cse_reciprocals (void) { phi = gsi_stmt (gsi); def = PHI_RESULT (phi); - if (FLOAT_TYPE_P (TREE_TYPE (def)) - && is_gimple_reg (def)) + if (! virtual_operand_p (def) + && FLOAT_TYPE_P (TREE_TYPE (def))) execute_cse_reciprocals_1 (NULL, def); } diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 05166eb8c90..0dcfbc7a8bc 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -1820,7 +1820,8 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1, gimple_stmt_iterator gsi2; basic_block bb_for_def1, bb_for_def2; - if (gimple_phi_num_args (phi_stmt) != 2) + if (gimple_phi_num_args (phi_stmt) != 2 + || virtual_operand_p (gimple_phi_result (phi_stmt))) continue; arg1 = gimple_phi_arg_def (phi_stmt, 0); @@ -1829,9 +1830,7 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1, if (TREE_CODE (arg1) != SSA_NAME || TREE_CODE (arg2) != SSA_NAME || SSA_NAME_IS_DEFAULT_DEF (arg1) - || SSA_NAME_IS_DEFAULT_DEF (arg2) - || !is_gimple_reg (arg1) - || !is_gimple_reg (arg2)) + || SSA_NAME_IS_DEFAULT_DEF (arg2)) continue; def1 = SSA_NAME_DEF_STMT (arg1); diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 83dded2e7cc..3571479102a 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3803,7 +3803,7 @@ make_values_for_phi (gimple phi, basic_block block) /* We have no need for virtual phis, as they don't represent actual computations. */ - if (is_gimple_reg (result)) + if (!virtual_operand_p (result)) { pre_expr e = get_or_alloc_expr_for_name (result); add_to_value (get_expr_value_id (e), e); @@ -3853,7 +3853,7 @@ compute_avail (void) if (!name || !SSA_NAME_IS_DEFAULT_DEF (name) || has_zero_uses (name) - || !is_gimple_reg (name)) + || virtual_operand_p (name)) continue; e = get_or_alloc_expr_for_name (name); @@ -4456,7 +4456,7 @@ eliminate (void) replacing the PHI with a single copy if possible. Do not touch inserted, single-argument or virtual PHIs. */ if (gimple_phi_num_args (phi) == 1 - || !is_gimple_reg (res)) + || virtual_operand_p (res)) { gsi_next (&gsi); continue; diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index f5643b619a9..e56b012cd61 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -1028,7 +1028,7 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn, gimple_stmt_iterator gsi; if (!name - || !is_gimple_reg (name)) + || virtual_operand_p (name)) continue; def_stmt = SSA_NAME_DEF_STMT (name); diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index ebe2dc3fc92..9c85391218a 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -234,7 +234,7 @@ phi_rank (gimple stmt) /* Ignore virtual SSA_NAMEs. */ res = gimple_phi_result (stmt); - if (!is_gimple_reg (res)) + if (virtual_operand_p (res)) return bb_rank[bb->index]; /* The phi definition must have a single use, and that use must be diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index 3a60a0a1ba0..d2b6e25f138 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -1890,7 +1890,7 @@ strlen_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple phi = gsi_stmt (gsi); - if (!is_gimple_reg (gimple_phi_result (phi))) + if (virtual_operand_p (gimple_phi_result (phi))) { bitmap visited = BITMAP_ALLOC (NULL); int count_vdef = 100; @@ -1908,7 +1908,7 @@ strlen_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, { gimple phi = gsi_stmt (gsi); tree result = gimple_phi_result (phi); - if (is_gimple_reg (result) && POINTER_TYPE_P (TREE_TYPE (result))) + if (!virtual_operand_p (result) && POINTER_TYPE_P (TREE_TYPE (result))) { int idx = get_stridx (gimple_phi_arg_def (phi, 0)); if (idx != 0) diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 5b185b6e129..6c60e002532 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -6589,7 +6589,7 @@ compute_points_to_sets (void) { gimple phi = gsi_stmt (gsi); - if (is_gimple_reg (gimple_phi_result (phi))) + if (! virtual_operand_p (gimple_phi_result (phi))) find_func_aliases (phi); } @@ -6966,7 +6966,7 @@ ipa_pta_execute (void) { gimple phi = gsi_stmt (gsi); - if (is_gimple_reg (gimple_phi_result (phi))) + if (! virtual_operand_p (gimple_phi_result (phi))) find_func_aliases (phi); } diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index a2d4633e993..8d55030e071 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -480,7 +480,7 @@ same_succ_hash (const void *ve) tree lhs = gimple_phi_result (phi); tree val = gimple_phi_arg_def (phi, n); - if (!is_gimple_reg (lhs)) + if (virtual_operand_p (lhs)) continue; update_dep_bb (bb, val); } @@ -834,7 +834,7 @@ release_last_vdef (basic_block bb) gimple phi = gsi_stmt (i); tree res = gimple_phi_result (phi); - if (is_gimple_reg (res)) + if (!virtual_operand_p (res)) continue; mark_virtual_phi_result_for_renaming (phi); @@ -1252,7 +1252,7 @@ same_phi_alternatives_1 (basic_block dest, edge e1, edge e2) tree val1 = gimple_phi_arg_def (phi, n1); tree val2 = gimple_phi_arg_def (phi, n2); - if (!is_gimple_reg (lhs)) + if (virtual_operand_p (lhs)) continue; if (operand_equal_for_phi_arg_p (val1, val2)) @@ -1310,7 +1310,7 @@ bb_has_non_vop_phi (basic_block bb) return true; phi = gimple_seq_first_stmt (phis); - return is_gimple_reg (gimple_phi_result (phi)); + return !virtual_operand_p (gimple_phi_result (phi)); } /* Returns true if redirecting the incoming edges of FROM to TO maintains the @@ -1432,7 +1432,7 @@ vop_phi (basic_block bb) for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { stmt = gsi_stmt (gsi); - if (is_gimple_reg (gimple_phi_result (stmt))) + if (! virtual_operand_p (gimple_phi_result (stmt))) continue; return stmt; } diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 65b27e62b3f..105e3abdec3 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -204,7 +204,7 @@ record_temporary_equivalences_from_phis (edge e, VEC(tree, heap) **stack) /* We consider any non-virtual PHI as a statement since it count result in a constant assignment or copy operation. */ - if (is_gimple_reg (dst)) + if (!virtual_operand_p (dst)) stmt_count++; record_temporary_equivalence (dst, src, stack); diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index c65c58ccf30..cc58870c7d8 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -1923,8 +1923,8 @@ warn_uninitialized_phi (gimple phi, VEC(gimple, heap) **worklist, gimple uninit_use_stmt = 0; tree uninit_op; - /* Don't look at memory tags. */ - if (!is_gimple_reg (gimple_phi_result (phi))) + /* Don't look at virtual operands. */ + if (virtual_operand_p (gimple_phi_result (phi))) return; uninit_opnds = compute_uninit_opnds_pos (phi); @@ -1988,8 +1988,8 @@ execute_late_warn_uninitialized (void) n = gimple_phi_num_args (phi); - /* Don't look at memory tags. */ - if (!is_gimple_reg (gimple_phi_result (phi))) + /* Don't look at virtual operands. */ + if (virtual_operand_p (gimple_phi_result (phi))) continue; for (i = 0; i < n; ++i) diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 5ea3bfd87f4..97a8ba5eb60 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -642,7 +642,7 @@ verify_ssa_name (tree ssa_name, bool is_virtual) return true; } - if (is_virtual && is_gimple_reg (ssa_name)) + if (is_virtual && !virtual_operand_p (ssa_name)) { error ("found a virtual definition for a GIMPLE register"); return true; @@ -654,7 +654,7 @@ verify_ssa_name (tree ssa_name, bool is_virtual) return true; } - if (!is_virtual && !is_gimple_reg (ssa_name)) + if (!is_virtual && virtual_operand_p (ssa_name)) { error ("found a real definition for a non-register"); return true; @@ -864,7 +864,7 @@ verify_phi_args (gimple phi, basic_block bb, basic_block *definition_block) if (TREE_CODE (op) == SSA_NAME) { - err = verify_ssa_name (op, !is_gimple_reg (gimple_phi_result (phi))); + err = verify_ssa_name (op, virtual_operand_p (gimple_phi_result (phi))); err |= verify_use (e->src, definition_block[SSA_NAME_VERSION (op)], op_p, phi, e->flags & EDGE_ABNORMAL, NULL); } @@ -938,14 +938,14 @@ verify_ssa (bool check_modified_stmt) gimple stmt; TREE_VISITED (name) = 0; - verify_ssa_name (name, !is_gimple_reg (name)); + verify_ssa_name (name, virtual_operand_p (name)); stmt = SSA_NAME_DEF_STMT (name); if (!gimple_nop_p (stmt)) { basic_block bb = gimple_bb (stmt); verify_def (bb, definition_block, - name, stmt, !is_gimple_reg (name)); + name, stmt, virtual_operand_p (name)); } } diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c index 16c3bee6993..8965ca3790c 100644 --- a/gcc/tree-stdarg.c +++ b/gcc/tree-stdarg.c @@ -791,7 +791,7 @@ execute_optimize_stdarg (void) gimple phi = gsi_stmt (i); lhs = PHI_RESULT (phi); - if (!is_gimple_reg (lhs)) + if (virtual_operand_p (lhs)) continue; FOR_EACH_PHI_ARG (uop, phi, soi, SSA_OP_USE) diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index e0b68c71cfa..29ed23fd65e 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -545,7 +545,7 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop, /** 2. Handle loop-closed-ssa-form phis **/ - if (!is_gimple_reg (PHI_RESULT (orig_phi))) + if (virtual_operand_p (PHI_RESULT (orig_phi))) continue; /* 2.1. Generate new phi node in NEW_EXIT_BB: */ @@ -1176,12 +1176,12 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, in the same form). Doing this early simplifies the checking what uses should be renamed. */ for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) - if (!is_gimple_reg (gimple_phi_result (gsi_stmt (gsi)))) + if (virtual_operand_p (gimple_phi_result (gsi_stmt (gsi)))) { gimple phi = gsi_stmt (gsi); for (gsi = gsi_start_phis (exit_e->dest); !gsi_end_p (gsi); gsi_next (&gsi)) - if (!is_gimple_reg (gimple_phi_result (gsi_stmt (gsi)))) + if (virtual_operand_p (gimple_phi_result (gsi_stmt (gsi)))) break; if (gsi_end_p (gsi)) { @@ -1659,7 +1659,7 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo) /* Skip virtual phi's. The data dependences that are associated with virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */ - if (!is_gimple_reg (PHI_RESULT (phi))) + if (virtual_operand_p (PHI_RESULT (phi))) { if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "virtual phi. skip."); @@ -1789,7 +1789,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters, } /* Skip virtual phi's. */ - if (!is_gimple_reg (PHI_RESULT (phi))) + if (virtual_operand_p (PHI_RESULT (phi))) { if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "virtual phi. skip."); diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 48d75a48a31..67d0eb17d13 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -555,7 +555,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop) /* Skip virtual phi's. The data dependences that are associated with virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */ - if (!is_gimple_reg (def)) + if (virtual_operand_p (def)) continue; STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_unknown_def_type; @@ -604,8 +604,8 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop) print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM); } - gcc_assert (is_gimple_reg (def)); - gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_unknown_def_type); + gcc_assert (!virtual_operand_p (def) + && STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_unknown_def_type); nested_cycle = (loop != LOOP_VINFO_LOOP (loop_vinfo)); reduc_stmt = vect_force_simple_reduction (loop_vinfo, phi, !nested_cycle, diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 65aa6c1169b..156bdd4730e 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -6142,11 +6142,13 @@ remove_range_assertions (void) static bool stmt_interesting_for_vrp (gimple stmt) { - if (gimple_code (stmt) == GIMPLE_PHI - && is_gimple_reg (gimple_phi_result (stmt)) - && (INTEGRAL_TYPE_P (TREE_TYPE (gimple_phi_result (stmt))) - || POINTER_TYPE_P (TREE_TYPE (gimple_phi_result (stmt))))) - return true; + if (gimple_code (stmt) == GIMPLE_PHI) + { + tree res = gimple_phi_result (stmt); + return (!virtual_operand_p (res) + && (INTEGRAL_TYPE_P (TREE_TYPE (res)) + || POINTER_TYPE_P (TREE_TYPE (res)))); + } else if (is_gimple_assign (stmt) || is_gimple_call (stmt)) { tree lhs = gimple_get_lhs (stmt); diff --git a/gcc/value-prof.c b/gcc/value-prof.c index e210881289e..25445a10924 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -1669,7 +1669,7 @@ gimple_divmod_values_to_profile (gimple stmt, histogram_values *values) VEC_reserve (histogram_value, heap, *values, 3); - if (is_gimple_reg (divisor)) + if (TREE_CODE (divisor) == SSA_NAME) /* Check for the case where the divisor is the same value most of the time. */ VEC_quick_push (histogram_value, *values, |