On Tue, Aug 17, 2021 at 8:56 PM H.J. Lu via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > On Tue, Aug 17, 2021 at 5:43 AM liuhongt via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > This reverts commit 872da9a6f664a06d73c987aa0cb2e5b830158a10. > > > > PR target/101936 > > PR target/101929 > > > > Bootstrapped and regtested on x86_64-linux-gnu{-m32,} > > Pushed to master. > > > > I proposed a different approach earlier. Will it make a difference? No, with -mtune=icelake-server, here is dump
0x3d73360 _192 1 times scalar_store costs 12 in body 0x3d73360 _198 1 times scalar_store costs 12 in body 0x3d73360 _195 1 times scalar_store costs 12 in body 0x3d73360 _201 1 times scalar_store costs 12 in body 0x3d73360 t0_184 + t2_188 1 times scalar_stmt costs 4 in body 0x3d73360 t1_186 + t3_190 1 times scalar_stmt costs 4 in body 0x3d73360 t0_184 - t2_188 1 times scalar_stmt costs 4 in body 0x3d73360 t1_186 - t3_190 1 times scalar_stmt costs 4 in body 0x3d73360 <unknown> 1 times vec_construct costs 16 in prologue --> 4 * 4 = 16 0x3d73360 <unknown> 1 times vec_construct costs 16 in prologue --> 4 * 4 = 16 0x3d73360 t0_184 + t2_188 1 times vector_stmt costs 4 in body 0x3d73360 t1_186 - t3_190 1 times vector_stmt costs 4 in body 0x3d73360 <unknown> 1 times vec_perm costs 4 in body 0x3d73360 _192 1 times vector_store costs 16 in body test.c:37:9: note: Cost model analysis for part in loop 0: Vector cost: 60 Scalar cost: 64 even add 1 more cost(5 then), vector cost become 68 which will prevent vectorization, and i remember youre proposal have vec_contruct cost as 8. > > -- > H.J. -- BR, Hongtao