On Thu, 3 Nov 2022, Andre Vieira (lists) wrote: > Hi, > > With Tamar's patch > (https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604880.html) enabling > the vectorization of early-breaks, I'd like to allow bitfield lowering in such > loops, which requires the relaxation of allowing multiple exits when doing > so.  In order to avoid a similar issue to PR107275, I hoisted the code that > rejects loops with certain types of gimple_stmts from > 'if_convertible_loop_p_1' to 'get_loop_body_in_if_conv_order', to avoid trying > to lower bitfields in loops we are not going to vectorize anyway.  This also > ensures 'ifcvt_local_dce' doesn't accidentally remove statements it shouldn't > as it will never come across them.  I made sure to add a comment to make clear > that there is a direct connection between the two and if we were to enable > vectorization of any other gimple statement we should make sure both handle > it. > > Bootstrapped and regression tested on aarch64-none-linux-gnu and > x86_64-pc-linux-gnu OK. Thanks, Richard. > gcc/ChangeLog: > >         * tree-if-conv.cc (if_convertible_loop_p_1): Move statement check loop > from here ... >         (get_loop_body_if_conv_order): ... to here. >         (if_convertible_loop_p): Remove single_exit check. >         (tree_if_conversion): Move single_exit check to if-conversion part. > > gcc/testsuite/ChangeLog: > >         * gcc.dg/vect/vect-bitfield-read-1-not.c: New test. >         * gcc.dg/vect/vect-bitfield-read-2-not.c: New test. >         * gcc.dg/vect/vect-bitfield-read-8.c: New test. >         * gcc.dg/vect/vect-bitfield-read-9.c: New test. > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)