Lines Matching refs:access

123 struct access  struct
143 struct access *next_grp; argument
147 struct access *group_representative; argument
151 struct access *first_child; argument
156 struct access *next_sibling; argument
163 struct access *next_queued; argument
251 typedef struct access *access_p; argument
264 struct access *lacc, *racc;
286 static struct access *work_queue_head;
312 static struct access no_accesses_representant;
317 no_accesses_p (struct access *access) in no_accesses_p() argument
319 return access == &no_accesses_representant; in no_accesses_p()
368 dump_access (FILE *f, struct access *access, bool grp) in dump_access() argument
371 fprintf (f, "base = (%d)'", DECL_UID (access->base)); in dump_access()
372 print_generic_expr (f, access->base, 0); in dump_access()
373 fprintf (f, "', offset = " HOST_WIDE_INT_PRINT_DEC, access->offset); in dump_access()
374 fprintf (f, ", size = " HOST_WIDE_INT_PRINT_DEC, access->size); in dump_access()
376 print_generic_expr (f, access->expr, 0); in dump_access()
378 print_generic_expr (f, access->type, 0); in dump_access()
388 access->grp_read, access->grp_write, access->grp_assignment_read, in dump_access()
389 access->grp_assignment_write, access->grp_scalar_read, in dump_access()
390 access->grp_scalar_write, access->grp_total_scalarization, in dump_access()
391 access->grp_hint, access->grp_covered, in dump_access()
392 access->grp_unscalarizable_region, access->grp_unscalarized_data, in dump_access()
393 access->grp_partial_lhs, access->grp_to_be_replaced, in dump_access()
394 access->grp_maybe_modified, in dump_access()
395 access->grp_not_necessarilly_dereferenced); in dump_access()
399 access->write, access->grp_total_scalarization, in dump_access()
400 access->grp_partial_lhs); in dump_access()
406 dump_access_tree_1 (FILE *f, struct access *access, int level) in dump_access_tree_1() argument
415 dump_access (f, access, true); in dump_access_tree_1()
417 if (access->first_child) in dump_access_tree_1()
418 dump_access_tree_1 (f, access->first_child, level + 1); in dump_access_tree_1()
420 access = access->next_sibling; in dump_access_tree_1()
422 while (access); in dump_access_tree_1()
429 dump_access_tree (FILE *f, struct access *access) in dump_access_tree() argument
431 for (; access; access = access->next_grp) in dump_access_tree()
432 dump_access_tree_1 (f, access, 0); in dump_access_tree()
438 access_has_children_p (struct access *acc) in access_has_children_p()
446 access_has_replacements_p (struct access *acc) in access_has_replacements_p()
448 struct access *child; in access_has_replacements_p()
475 static struct access *
476 find_access_in_subtree (struct access *access, HOST_WIDE_INT offset, in find_access_in_subtree() argument
479 while (access && (access->offset != offset || access->size != size)) in find_access_in_subtree()
481 struct access *child = access->first_child; in find_access_in_subtree()
485 access = child; in find_access_in_subtree()
488 return access; in find_access_in_subtree()
493 static struct access *
509 static struct access *
513 struct access *access; in get_var_base_offset_size_access() local
515 access = get_first_repr_for_decl (base); in get_var_base_offset_size_access()
516 while (access && (access->offset + access->size <= offset)) in get_var_base_offset_size_access()
517 access = access->next_grp; in get_var_base_offset_size_access()
518 if (!access) in get_var_base_offset_size_access()
521 return find_access_in_subtree (access, offset, size); in get_var_base_offset_size_access()
526 add_link_to_rhs (struct access *racc, struct assign_link *link) in add_link_to_rhs()
545 relink_to_new_repr (struct access *new_racc, struct access *old_racc) in relink_to_new_repr()
574 add_access_to_work_queue (struct access *access) in add_access_to_work_queue() argument
576 if (!access->grp_queued) in add_access_to_work_queue()
578 gcc_assert (!access->next_queued); in add_access_to_work_queue()
579 access->next_queued = work_queue_head; in add_access_to_work_queue()
580 access->grp_queued = 1; in add_access_to_work_queue()
581 work_queue_head = access; in add_access_to_work_queue()
587 static struct access *
590 struct access *access = work_queue_head; in pop_access_from_work_queue() local
592 work_queue_head = access->next_queued; in pop_access_from_work_queue()
593 access->next_queued = NULL; in pop_access_from_work_queue()
594 access->grp_queued = 0; in pop_access_from_work_queue()
595 return access; in pop_access_from_work_queue()
608 access_pool = create_alloc_pool ("SRA accesses", sizeof (struct access), 16); in sra_initialize()
788 static struct access *
792 struct access *access; in create_access_1() local
795 access = (struct access *) pool_alloc (access_pool); in create_access_1()
796 memset (access, 0, sizeof (struct access)); in create_access_1()
797 access->base = base; in create_access_1()
798 access->offset = offset; in create_access_1()
799 access->size = size; in create_access_1()
807 VEC_safe_push (access_p, heap, vec, access); in create_access_1()
812 return access; in create_access_1()
818 static struct access *
821 struct access *access; in create_access() local
874 access = create_access_1 (base, offset, size); in create_access()
875 access->expr = expr; in create_access()
876 access->type = TREE_TYPE (expr); in create_access()
877 access->write = write; in create_access()
878 access->grp_unscalarizable_region = unscalarizable_region; in create_access()
879 access->stmt = stmt; in create_access()
883 access->non_addressable = 1; in create_access()
885 return access; in create_access()
939 struct access *access; in completely_scalarize_record() local
943 access = create_access_1 (base, pos, size); in completely_scalarize_record()
944 access->expr = nref; in completely_scalarize_record()
945 access->type = ft; in completely_scalarize_record()
946 access->grp_total_scalarization = 1; in completely_scalarize_record()
962 struct access *access; in completely_scalarize_var() local
964 access = create_access_1 (var, 0, size); in completely_scalarize_var()
965 access->expr = var; in completely_scalarize_var()
966 access->type = TREE_TYPE (var); in completely_scalarize_var()
967 access->grp_total_scalarization = 1; in completely_scalarize_var()
992 static struct access *
995 struct access *ret = NULL; in build_access_from_expr_1()
1056 struct access *access; in build_access_from_expr() local
1058 access = build_access_from_expr_1 (expr, stmt, write); in build_access_from_expr()
1059 if (access) in build_access_from_expr()
1065 bitmap_set_bit (cannot_scalarize_away_bitmap, DECL_UID (access->base)); in build_access_from_expr()
1122 tree_non_aligned_mem_for_access_p (tree exp, struct access *acc) in tree_non_aligned_mem_for_access_p()
1146 struct access *lacc, *racc; in build_accesses_from_assign()
1564 struct access *model, gimple_stmt_iterator *gsi, in build_ref_for_model()
1813 static struct access *
1817 struct access *res, **prev_acc_ptr = &res; in sort_and_splice_var_accesses()
1833 struct access *access = VEC_index (access_p, access_vec, i); in sort_and_splice_var_accesses() local
1834 bool grp_write = access->write; in sort_and_splice_var_accesses()
1835 bool grp_read = !access->write; in sort_and_splice_var_accesses()
1836 bool grp_scalar_write = access->write in sort_and_splice_var_accesses()
1837 && is_gimple_reg_type (access->type); in sort_and_splice_var_accesses()
1838 bool grp_scalar_read = !access->write in sort_and_splice_var_accesses()
1839 && is_gimple_reg_type (access->type); in sort_and_splice_var_accesses()
1840 bool grp_assignment_read = access->grp_assignment_read; in sort_and_splice_var_accesses()
1841 bool grp_assignment_write = access->grp_assignment_write; in sort_and_splice_var_accesses()
1843 bool total_scalarization = access->grp_total_scalarization; in sort_and_splice_var_accesses()
1844 bool grp_partial_lhs = access->grp_partial_lhs; in sort_and_splice_var_accesses()
1845 bool first_scalar = is_gimple_reg_type (access->type); in sort_and_splice_var_accesses()
1846 bool unscalarizable_region = access->grp_unscalarizable_region; in sort_and_splice_var_accesses()
1848 if (first || access->offset >= high) in sort_and_splice_var_accesses()
1851 low = access->offset; in sort_and_splice_var_accesses()
1852 high = access->offset + access->size; in sort_and_splice_var_accesses()
1854 else if (access->offset > low && access->offset + access->size > high) in sort_and_splice_var_accesses()
1857 gcc_assert (access->offset >= low in sort_and_splice_var_accesses()
1858 && access->offset + access->size <= high); in sort_and_splice_var_accesses()
1863 struct access *ac2 = VEC_index (access_p, access_vec, j); in sort_and_splice_var_accesses()
1864 if (ac2->offset != access->offset || ac2->size != access->size) in sort_and_splice_var_accesses()
1888 relink_to_new_repr (access, ac2); in sort_and_splice_var_accesses()
1894 ac2->group_representative = access; in sort_and_splice_var_accesses()
1900 access->group_representative = access; in sort_and_splice_var_accesses()
1901 access->grp_write = grp_write; in sort_and_splice_var_accesses()
1902 access->grp_read = grp_read; in sort_and_splice_var_accesses()
1903 access->grp_scalar_read = grp_scalar_read; in sort_and_splice_var_accesses()
1904 access->grp_scalar_write = grp_scalar_write; in sort_and_splice_var_accesses()
1905 access->grp_assignment_read = grp_assignment_read; in sort_and_splice_var_accesses()
1906 access->grp_assignment_write = grp_assignment_write; in sort_and_splice_var_accesses()
1907 access->grp_hint = multiple_scalar_reads || total_scalarization; in sort_and_splice_var_accesses()
1908 access->grp_total_scalarization = total_scalarization; in sort_and_splice_var_accesses()
1909 access->grp_partial_lhs = grp_partial_lhs; in sort_and_splice_var_accesses()
1910 access->grp_unscalarizable_region = unscalarizable_region; in sort_and_splice_var_accesses()
1911 if (access->first_link) in sort_and_splice_var_accesses()
1912 add_access_to_work_queue (access); in sort_and_splice_var_accesses()
1914 *prev_acc_ptr = access; in sort_and_splice_var_accesses()
1915 prev_acc_ptr = &access->next_grp; in sort_and_splice_var_accesses()
1927 create_access_replacement (struct access *access, bool rename) in create_access_replacement() argument
1931 repl = create_tmp_var (access->type, "SR"); in create_access_replacement()
1936 if (!access->grp_partial_lhs in create_access_replacement()
1937 && (TREE_CODE (access->type) == COMPLEX_TYPE in create_access_replacement()
1938 || TREE_CODE (access->type) == VECTOR_TYPE)) in create_access_replacement()
1941 DECL_SOURCE_LOCATION (repl) = DECL_SOURCE_LOCATION (access->base); in create_access_replacement()
1943 DECL_IGNORED_P (repl) = DECL_IGNORED_P (access->base); in create_access_replacement()
1945 if (DECL_NAME (access->base) in create_access_replacement()
1946 && !DECL_IGNORED_P (access->base) in create_access_replacement()
1947 && !DECL_ARTIFICIAL (access->base)) in create_access_replacement()
1949 char *pretty_name = make_fancy_name (access->expr); in create_access_replacement()
1950 tree debug_expr = unshare_expr (access->expr), d; in create_access_replacement()
1983 if (access->grp_no_warning) in create_access_replacement()
1986 TREE_NO_WARNING (repl) = TREE_NO_WARNING (access->base); in create_access_replacement()
1994 print_generic_expr (dump_file, access->base, 0); in create_access_replacement()
1996 (unsigned) access->offset, (unsigned) access->size); in create_access_replacement()
2008 get_access_replacement (struct access *access) in get_access_replacement() argument
2010 gcc_assert (access->grp_to_be_replaced); in get_access_replacement()
2012 if (!access->replacement_decl) in get_access_replacement()
2013 access->replacement_decl = create_access_replacement (access, true); in get_access_replacement()
2014 return access->replacement_decl; in get_access_replacement()
2021 get_unrenamed_access_replacement (struct access *access) in get_unrenamed_access_replacement() argument
2023 gcc_assert (!access->grp_to_be_replaced); in get_unrenamed_access_replacement()
2025 if (!access->replacement_decl) in get_unrenamed_access_replacement()
2026 access->replacement_decl = create_access_replacement (access, false); in get_unrenamed_access_replacement()
2027 return access->replacement_decl; in get_unrenamed_access_replacement()
2037 build_access_subtree (struct access **access) in build_access_subtree() argument
2039 struct access *root = *access, *last_child = NULL; in build_access_subtree()
2042 *access = (*access)->next_grp; in build_access_subtree()
2043 while (*access && (*access)->offset + (*access)->size <= limit) in build_access_subtree()
2046 root->first_child = *access; in build_access_subtree()
2048 last_child->next_sibling = *access; in build_access_subtree()
2049 last_child = *access; in build_access_subtree()
2051 if (!build_access_subtree (access)) in build_access_subtree()
2055 if (*access && (*access)->offset < limit) in build_access_subtree()
2066 build_access_trees (struct access *access) in build_access_trees() argument
2068 while (access) in build_access_trees()
2070 struct access *root = access; in build_access_trees()
2072 if (!build_access_subtree (&access)) in build_access_trees()
2074 root->next_grp = access; in build_access_trees()
2134 analyze_access_subtree (struct access *root, struct access *parent, in analyze_access_subtree()
2137 struct access *child; in analyze_access_subtree()
2244 analyze_access_trees (struct access *access) in analyze_access_trees() argument
2248 while (access) in analyze_access_trees()
2250 if (analyze_access_subtree (access, NULL, true)) in analyze_access_trees()
2252 access = access->next_grp; in analyze_access_trees()
2263 child_would_conflict_in_lacc (struct access *lacc, HOST_WIDE_INT norm_offset, in child_would_conflict_in_lacc()
2264 HOST_WIDE_INT size, struct access **exact_match) in child_would_conflict_in_lacc()
2266 struct access *child; in child_would_conflict_in_lacc()
2290 static struct access *
2291 create_artificial_child_access (struct access *parent, struct access *model, in create_artificial_child_access()
2294 struct access *access; in create_artificial_child_access() local
2295 struct access **child; in create_artificial_child_access()
2300 access = (struct access *) pool_alloc (access_pool); in create_artificial_child_access()
2301 memset (access, 0, sizeof (struct access)); in create_artificial_child_access()
2305 access->grp_no_warning = true; in create_artificial_child_access()
2310 access->base = parent->base; in create_artificial_child_access()
2311 access->expr = expr; in create_artificial_child_access()
2312 access->offset = new_offset; in create_artificial_child_access()
2313 access->size = model->size; in create_artificial_child_access()
2314 access->type = model->type; in create_artificial_child_access()
2315 access->grp_write = true; in create_artificial_child_access()
2316 access->grp_read = false; in create_artificial_child_access()
2322 access->next_sibling = *child; in create_artificial_child_access()
2323 *child = access; in create_artificial_child_access()
2325 return access; in create_artificial_child_access()
2334 propagate_subaccesses_across_link (struct access *lacc, struct access *racc) in propagate_subaccesses_across_link()
2336 struct access *rchild; in propagate_subaccesses_across_link()
2368 struct access *new_acc = NULL; in propagate_subaccesses_across_link()
2407 struct access *racc = pop_access_from_work_queue (); in propagate_all_subaccesses()
2414 struct access *lacc = link->lacc; in propagate_all_subaccesses()
2475 struct access *access; in analyze_all_variable_accesses() local
2477 access = sort_and_splice_var_accesses (var); in analyze_all_variable_accesses()
2478 if (!access || !build_access_trees (access)) in analyze_all_variable_accesses()
2489 struct access *access = get_first_repr_for_decl (var); in analyze_all_variable_accesses() local
2491 if (analyze_access_trees (access)) in analyze_all_variable_accesses()
2499 dump_access_tree (dump_file, access); in analyze_all_variable_accesses()
2533 generate_subtree_copies (struct access *access, tree agg, in generate_subtree_copies() argument
2541 if (chunk_size && access->offset >= start_offset + chunk_size) in generate_subtree_copies()
2544 if (access->grp_to_be_replaced in generate_subtree_copies()
2546 || access->offset + access->size > start_offset)) in generate_subtree_copies()
2548 tree expr, repl = get_access_replacement (access); in generate_subtree_copies()
2551 expr = build_ref_for_model (loc, agg, access->offset - top_offset, in generate_subtree_copies()
2552 access, gsi, insert_after); in generate_subtree_copies()
2556 if (access->grp_partial_lhs) in generate_subtree_copies()
2566 if (access->grp_partial_lhs) in generate_subtree_copies()
2583 if (access->first_child) in generate_subtree_copies()
2584 generate_subtree_copies (access->first_child, agg, top_offset, in generate_subtree_copies()
2588 access = access->next_sibling; in generate_subtree_copies()
2590 while (access); in generate_subtree_copies()
2599 init_subtree_with_zero (struct access *access, gimple_stmt_iterator *gsi, in init_subtree_with_zero() argument
2603 struct access *child; in init_subtree_with_zero()
2605 if (access->grp_to_be_replaced) in init_subtree_with_zero()
2609 stmt = gimple_build_assign (get_access_replacement (access), in init_subtree_with_zero()
2610 build_zero_cst (access->type)); in init_subtree_with_zero()
2619 for (child = access->first_child; child; child = child->next_sibling) in init_subtree_with_zero()
2626 static struct access *
2658 struct access *access; in sra_modify_expr() local
2671 access = get_access_for_expr (*expr); in sra_modify_expr()
2672 if (!access) in sra_modify_expr()
2677 if (access->grp_to_be_replaced) in sra_modify_expr()
2679 tree repl = get_access_replacement (access); in sra_modify_expr()
2690 if (!useless_type_conversion_p (type, access->type)) in sra_modify_expr()
2694 ref = build_ref_for_model (loc, access->base, access->offset, access, in sra_modify_expr()
2701 if (access->grp_partial_lhs) in sra_modify_expr()
2712 if (access->grp_partial_lhs) in sra_modify_expr()
2725 if (access->first_child) in sra_modify_expr()
2733 start_offset = access->offset in sra_modify_expr()
2739 generate_subtree_copies (access->first_child, access->base, 0, in sra_modify_expr()
2758 handle_unscalarized_data_in_subtree (struct access *top_racc, in handle_unscalarized_data_in_subtree()
2790 load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc, in load_assign_lhs_subreplacements()
2801 struct access *racc; in load_assign_lhs_subreplacements()
2867 struct access *acc; in sra_modify_constructor_assign()
2919 get_repl_default_def_ssa_name (struct access *racc) in get_repl_default_def_ssa_name()
2979 struct access *lacc, *racc; in sra_modify_assign()
3290 struct access *access; in initialize_parameter_reductions() local
3304 for (access = VEC_index (access_p, access_vec, 0); in initialize_parameter_reductions()
3305 access; in initialize_parameter_reductions()
3306 access = access->next_grp) in initialize_parameter_reductions()
3307 generate_subtree_copies (access, parm, 0, 0, 0, &gsi, true, true, in initialize_parameter_reductions()
3591 struct access *repr = (struct access *) data; in mark_maybe_modified()
3608 struct access *repr; in analyze_modified_params()
3614 struct access *access; in analyze_modified_params() local
3626 for (access = repr; access; access = access->next_sibling) in analyze_modified_params()
3630 walk_aliased_vdefs (&ar, gimple_vuse (access->stmt), in analyze_modified_params()
3778 struct access *repr = VEC_index (access_p, representatives, i); in analyze_caller_dereference_legality()
3800 static struct access *
3804 struct access *repr; in unmodified_by_ref_scalar_representative()
3817 struct access *access = VEC_index (access_p, access_vec, i); in unmodified_by_ref_scalar_representative() local
3818 if (access->write) in unmodified_by_ref_scalar_representative()
3820 access->group_representative = repr; in unmodified_by_ref_scalar_representative()
3821 access->next_sibling = repr->next_sibling; in unmodified_by_ref_scalar_representative()
3822 repr->next_sibling = access; in unmodified_by_ref_scalar_representative()
3834 access_precludes_ipa_sra_p (struct access *access) in access_precludes_ipa_sra_p() argument
3842 if (access->write in access_precludes_ipa_sra_p()
3843 && (is_gimple_call (access->stmt) in access_precludes_ipa_sra_p()
3844 || gimple_code (access->stmt) == GIMPLE_ASM)) in access_precludes_ipa_sra_p()
3848 && tree_non_aligned_mem_p (access->expr, TYPE_ALIGN (access->type))) in access_precludes_ipa_sra_p()
3862 static struct access *
3867 struct access *access, *res, **prev_acc_ptr = &res; in splice_param_accesses() local
3884 access = VEC_index (access_p, access_vec, i); in splice_param_accesses()
3885 modification = access->write; in splice_param_accesses()
3886 if (access_precludes_ipa_sra_p (access)) in splice_param_accesses()
3888 a1_alias_type = reference_alias_ptr_type (access->expr); in splice_param_accesses()
3897 struct access *ac2 = VEC_index (access_p, access_vec, j); in splice_param_accesses()
3898 if (ac2->offset != access->offset) in splice_param_accesses()
3901 if (access->offset + access->size > ac2->offset) in splice_param_accesses()
3906 else if (ac2->size != access->size) in splice_param_accesses()
3910 || (ac2->type != access->type in splice_param_accesses()
3912 || TREE_ADDRESSABLE (access->type))) in splice_param_accesses()
3917 ac2->group_representative = access; in splice_param_accesses()
3918 ac2->next_sibling = access->next_sibling; in splice_param_accesses()
3919 access->next_sibling = ac2; in splice_param_accesses()
3924 access->grp_maybe_modified = modification; in splice_param_accesses()
3927 *prev_acc_ptr = access; in splice_param_accesses()
3928 prev_acc_ptr = &access->next_grp; in splice_param_accesses()
3929 total_size += access->size; in splice_param_accesses()
3948 decide_one_param_reduction (struct access *repr) in decide_one_param_reduction()
3971 struct access *acc; in decide_one_param_reduction()
4039 struct access *repr; in splice_all_param_accesses()
4132 struct access *repr = VEC_index (access_p, representatives, i); in turn_representatives_into_adjustments()
4199 struct access *repr = VEC_index (access_p, representatives, i); in analyze_all_param_acesses()