[PATCH GCC8][25/33]New loop constraint flags

Richard Biener richard.guenther@gmail.com
Wed Apr 26 13:30:00 GMT 2017


On Tue, Apr 18, 2017 at 12:51 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This patch adds new loop constraint flags marking prologue, epilogue and versioned loops generated
> by vectorizer, unroller and versioning.  These flags will be used in IVOPTs in order to differentiate
> possible hot innermost loop from others.  I also plan to use them to avoid unnecessary cunroll on
> such loops.
> Is it OK?

Hmm, it doesn't really match "constraints".

I'd rather somehow track the "original" loop it was versioned / copied
from plus either a
"kind" (epilogue, prologue, version) or determine this from dominance
relationship between
the copy and the original loop.

Thus,

struct loop {
 ...
 /* If not zero the loop number this loop was copied from.  */
 unsigned clone_of;

would that help?  With knowing loop relation we can also more
aggressively version
and eventually later collapse the two versions again if we can still
identify them and
they are still reasonably similar.

Richard.

>
> Thanks,
> bin
> 2017-04-11  Bin Cheng  <bin.cheng@arm.com>
>
>         * cfgloop.h (LOOP_C_PROLOG, LOOP_C_EPILOG, LOOP_C_VERSION): New.
>         * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Set
>         LOOP_C_EPILOG for unrolled epilogue loop.
>         (vect_do_peeling): Set LOOP_C_PROLOG and LOOP_C_EPILOG for peeled
>         loops.
>         (vect_loop_versioning): Set LOOP_C_VERSION for versioned loop.



More information about the Gcc-patches mailing list