This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[autovect] [patch] improvement to widen-mult





Improve the detection of "unordered" widening-multiplication
(widening-multiplication whose result of is used only in a reduction
computation). Before, we were detecting "unordered" widen-mult only if it
was directly used by a reduction (i.e we checked only the immediate uses).
This patch detects if a def of a stmt in the loop is used only to
(eventually) feed a reduction computation (even if this involves other
stmts on the way). We do that during our bottom-up (uses-to-defs) analysis
to detect relevant/live code in the loop, so we practically get this for
free. For altivec this patch allows generating more efficient code (i.e.
"mul_even"/"mul_odd" instead of "mul_hi"/"mul_lo") for the new added
testcase.

Bootstrapped with vectorization enabled and tested on the vectorizer
testcases on powerpc-linux. Committed to autovect-branch.

dorit

        * tree-vect-analyze.c (vect_mark_relevant): Third argument "bool
        relevant_p" changed to "enum vect_relevant relevant".  Record the
        max of STMT_VINFO_RELEVANT and 'relevant' instead of their or.
        (vect_stmt_relevant_p): Third argument "bool relevant_p" changed to
        "enum vect_relevant relevant".  Record the value
"vect_used_in_loop"
        instead of "true".
        (vect_mark_stmts_to_be_vectorized): Variable "bool relevant_p"
changed
        to "enum vect_relevant relevant".  For reduction case, set relevant
to
        "vect_used_by_reduction" instead of "true".
        * tree-vect-transofrm.c (vectorizable_type_promotion): Pass 'stmt'
to
        supportable_widening_operation, instead of 'orig_stmt_in_pattern'.
        * tree-vectorizer.c (new_stmt_vec_info): STMT_VINFO_RELEVANT_P
replaced
        with STMT_VINFO_RELEVANT. Initialize STMT_VINFO_LIVE_P to false
instead
        of 0.
        (supportable_widening_operation): Check STMT_VINFO_RELEVANT instead
of
        checking immediate uses.
        * tree-vectorizer.h (vect_relevant): New enum type.
        (_stmt_vec_info): Field relevant changed from bool to enum
vect_relevant.
        (STMT_VINFO_RELEVANT): New macro to access the field 'relevant'.
        (STMT_VINFO_RELEVANT_P): Changed to check the value of field
'relevant'.

(See attached file: patch.oct20.txt)

Attachment: patch.oct20.txt
Description: Text document


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