This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix PR/18179 and use get_inner_reference in vectorizer: part 4

Fourth (and last) part of the patch: switch to use of get_inner_reference.

1. Call get_inner_reference in function vect_get_base_and_offset for
ARRAY_REF and COMPONENT_REF, instead of recursive calls. Call
vect_analyze_offset_expr to analyze the offset expression created by
get_inner_reference and extract from it initial_offset, step and alignment
information for the data reference.

2. Move the call to vect_get_base_and_offset to vect_get_memtag_and_dr
(this is now the only place we call vect_get_base_and_offset). Set fields
of stmt_info with base, initial_offset, step and misalignment info with
values returned by vect_get_base_and_offset.

3. Functions vect_compute_data_ref_alignment and
vect_analyze_data_ref_access now only check relevant fields of stmt_info
(that had been filled in by vect_get_memtag_and_dr), instead of calling
vect_get_base_and_offset and
vect_compute_array_ref_alignment, and check that the memory is consecutive.

4. In case of a pointer, set initial_offset and step of the data reference
in function vect_analyze_pointer_ref_access (for the case of an array these
fields are computed by vect_get_base_and_offset and set by

5. In function vect_create_addr_base_for_vector_ref we now only combine
base and initial_offset to create address_base (i.e: the first location
accessed in the loop): &base + initial_offset (instead of
that required init_val calculation).

6. Remove the functions vect_get_first_index,
vect_compute_array_base_alignment and vect_compute_array_ref_alignment
(their functionality replaced with get_inner_reference).

Changelog entry:

        * tree-vectorizer.c (vect_get_base_and_offset): Call
        and vect_analyze_offset_expr.
        (vect_create_addr_base_for_vector_ref): Build address_base by
combining base
        and initial_offset fields of vect_stmt_info.
        (vect_update_inits_of_dr): Update offset of data-ref instead of its
        access-fn. Remove argument.
        (vect_update_inits_of_drs): Call vect_update_inits_of_dr with new
      (vect_compute_data_ref_alignment): Check misalignment info in
        Remove argument.
        (vect_compute_data_refs_alignment): Call
        with correct argument.
      (vect_analyze_data_ref_access): Check access info in vect_stmt_info.
      (vect_analyze_pointer_ref_access): Update step and initial_offset
fields of
        (vect_get_memtag_and_dr): Call vect_get_base_and_offset and set the
        of stmt_vec_info.
        (vect_analyze_data_refs): Find vectype and pass it to
        (vect_get_first_index): Remove.
        (vect_compute_array_base_alignment): Remove.
        (vect_compute_array_ref_alignment): Remove

Patch (part 4):
(See attached file: patch4)

Attachment: patch4
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]