[autovect] [patch] Identify unknown evolution and skip invariant phis.

Ira Rosen IRAR@il.ibm.com
Tue Jul 5 12:07:00 GMT 2005





This patch adds a new boolean parameter, DONT_KNOW, to
analyze_scalar_evolution function to distinguish between unknown and NULL
evolution (until now, in both cases scev analyzer returned evolution =
NULL). If the evolution is unknown, DONT_KNOW is set to TRUE.
With this parameter, we are also able to recognize, when a combination of
two access functions is incorrect. It happened when one of the combined
access function had an unknown evolution. E.g., '{0, +, 1}' and 'D' (here
the evolution is unknown), are combined into {D, +, 1}. Now, scev analyzer
also sets the returned flag 'unknown_evolution' to true in such case.
Testcase attached.

In addition, we are able now to identify invariant phi nodes and safely
ignore them in the vectorizer.

Bootstrapped and tested on ppc-darwin. Committed to autovect branch.

Ira

ChangeLog entry:

      * lambda-code.c (gcc_loop_to_lambda_loop): Call
analyze_scalar_evolution
      with correct parameters.
      * tree-data-ref.c (analyze_array_indexes): Likewise.
      (analyze_indirect_ref): Likewise and check if the reference is loop
      invariant with the help of the new parameter of
analyze_scalar_evolution.
      (analyze_offset_expr): Likewise.
      * tree-elim-check.c (try_eliminate_check): Call
      analyze_scalar_evolution with correct parameters.
      * tree-scalar-evolution.c (follow_ssa_edge_inner_loop_phi,
      unify_peeled_chrec, interpret_loop_phi, interpret_condition_phi,
      interpret_rhs_modify_expr): Likewise.
      (compute_scalar_evolution_in_loop): Call
      analyze_scalar_evolution_1 with correct parameters.
      (analyze_scalar_evolution_1): Add parameters to always analyze
evolution
      and to decide whether it is unknown. Fix parameters of
      interpret_rhs_modify_expr and analyze_scalar_evolution_1.
      (analyze_scalar_evolution): Add parameters to always analyze
evolution
      and to decide whether it is unknown. Fix parameters of
      analyze_scalar_evolution_1.
      (instantiate_parameters_1): Call analyze_scalar_evolution with
correct
      parameters.
      (analyze_scalar_evolution_for_all_loop_phi_nodes): Likewise.
      * tree-scalar-evolution.h (analyze_scalar_evolution): Add parameters
to
      the declaration.
      * tree-vect-analyze.c (vect_analyze_scalar_cycles): Call
      analyze_scalar_evolution with correct parameters. Skip invariant phis
      with the help of unknown_evolution.
      (vect_can_advance_ivs_p): Likewise.
      * tree-vect-transform.c (vect_get_vec_def_for_operand): Handle
invariant
      phis.
      (vect_update_ivs_after_vectorizer):  Call analyze_scalar_evolution
with
      correct parameters. If no evolution, it must be an unknown evolution.
      * tree-vectorizer.h (enum vect_def_type): Add vect_invariant_phi_def.

Patch:
(See attached file: scev.patch)
Test:
(See attached file: vect-117.c)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scev.patch
Type: application/octet-stream
Size: 35884 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050705/ac6fc30f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vect-117.c
Type: application/octet-stream
Size: 692 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050705/ac6fc30f/attachment-0001.obj>


More information about the Gcc-patches mailing list