aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-parloops.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-05-03 14:37:22 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-05-03 12:37:22 +0000
commitb119c05542a9574a1c27f9bba63efbafc12b248b (patch)
treec74567ce247b0b3ab51c2b111256694ba980a0b5 /gcc/tree-parloops.c
parent3353ebf0d9a20f07597b90943664f10557488ea8 (diff)
downloadgcc-b119c05542a9574a1c27f9bba63efbafc12b248b.zip
gcc-b119c05542a9574a1c27f9bba63efbafc12b248b.tar.gz
gcc-b119c05542a9574a1c27f9bba63efbafc12b248b.tar.bz2
Come up with is_empty for hash_{table,map,set}.
2019-05-03 Martin Liska <mliska@suse.cz> * hash-map.h: Add is_empty function. * hash-set.h: Likewise. * hash-table.h: Likewise. * dwarf2out.c (dwarf2out_finish): Use is_empty instead of elements () == 0 (and similar usages). * gimple-ssa-store-merging.c (pass_store_merging::terminate_and_process_all_chains): Likewise. * gimplify.c (gimplify_bind_expr): Likewise. (gimplify_switch_expr): Likewise. * hash-map-tests.c (test_map_of_strings_to_int): Likewise. * ipa-icf.c (sem_item_optimizer::remove_symtab_node): Likewise. * postreload-gcse.c (dump_hash_table): Likewise. (gcse_after_reload_main): Likewise. * predict.c (combine_predictions_for_bb): Likewise. * tree-parloops.c (reduction_phi): Likewise. (separate_decls_in_region): Likewise. (transform_to_exit_first_loop): Likewise. (gen_parallel_loop): Likewise. (gather_scalar_reductions): Likewise. (try_create_reduction_list): Likewise. * var-tracking.c (dump_vars): Likewise. (emit_notes_for_changes): Likewise. (vt_emit_notes): Likewise. 2019-05-03 Martin Liska <mliska@suse.cz> * call.c (build_aggr_conv): Use is_empty instead of elements () == 0 (and similar usages). * parser.c (cp_parser_lambda_introducer): Likewise. From-SVN: r270851
Diffstat (limited to 'gcc/tree-parloops.c')
-rw-r--r--gcc/tree-parloops.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 2fddc59..968368f 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -238,7 +238,7 @@ reduction_phi (reduction_info_table_type *reduction_list, gimple *phi)
{
struct reduction_info tmpred, *red;
- if (reduction_list->elements () == 0 || phi == NULL)
+ if (reduction_list->is_empty () || phi == NULL)
return NULL;
if (gimple_uid (phi) == (unsigned int)-1
@@ -1390,7 +1390,7 @@ separate_decls_in_region (edge entry, edge exit,
}
}
- if (name_copies.elements () == 0 && reduction_list->elements () == 0)
+ if (name_copies.is_empty () && reduction_list->is_empty ())
{
/* It may happen that there is nothing to copy (if there are only
loop carried and external variables in the loop). */
@@ -1407,7 +1407,7 @@ separate_decls_in_region (edge entry, edge exit,
TYPE_NAME (type) = type_name;
name_copies.traverse <tree, add_field_for_name> (type);
- if (reduction_list && reduction_list->elements () > 0)
+ if (reduction_list && !reduction_list->is_empty ())
{
/* Create the fields for reductions. */
reduction_list->traverse <tree, add_field_for_reduction> (type);
@@ -1430,7 +1430,7 @@ separate_decls_in_region (edge entry, edge exit,
/* Load the calculation from memory (after the join of the threads). */
- if (reduction_list && reduction_list->elements () > 0)
+ if (reduction_list && !reduction_list->is_empty ())
{
reduction_list
->traverse <struct clsn_data *, create_stores_for_reduction>
@@ -1991,7 +1991,7 @@ transform_to_exit_first_loop (struct loop *loop,
PHI_RESULT of this phi is the resulting value of the reduction
variable when exiting the loop. */
- if (reduction_list->elements () > 0)
+ if (!reduction_list->is_empty ())
{
struct reduction_info *red;
@@ -2440,7 +2440,7 @@ gen_parallel_loop (struct loop *loop,
}
/* Generate initializations for reductions. */
- if (reduction_list->elements () > 0)
+ if (!reduction_list->is_empty ())
reduction_list->traverse <struct loop *, initialize_reductions> (loop);
/* Eliminate the references to local variables from the loop. */
@@ -2476,7 +2476,7 @@ gen_parallel_loop (struct loop *loop,
loc = gimple_location (cond_stmt);
create_parallel_loop (loop, create_loop_fn (loc), arg_struct, new_arg_struct,
n_threads, loc, oacc_kernels_p);
- if (reduction_list->elements () > 0)
+ if (!reduction_list->is_empty ())
create_call_for_reduction (loop, reduction_list, &clsn_data);
scev_reset ();
@@ -2679,7 +2679,7 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
}
gather_done:
- if (reduction_list->elements () == 0)
+ if (reduction_list->is_empty ())
return;
/* As gimple_uid is used by the vectorizer in between vect_analyze_loop_form
@@ -2806,7 +2806,7 @@ try_create_reduction_list (loop_p loop,
fprintf (dump_file,
" checking if it is part of reduction pattern:\n");
}
- if (reduction_list->elements () == 0)
+ if (reduction_list->is_empty ())
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,