Re: [PATCH] Don't vectorize when vector stmts are only vec_contruct and stores

2023-12-05 Thread Hongtao Liu
On Mon, Dec 4, 2023 at 10:10 PM Richard Biener wrote: > > On Mon, Dec 4, 2023 at 6:32 AM liuhongt wrote: > > > > .i.e. for below cases. > >a[0] = b1; > >a[1] = b2; > >.. > >a[n] = bn; > > > > There're extra dependences when contructing the vector, but not for > > scalar store. Acc

Re: [PATCH] Don't vectorize when vector stmts are only vec_contruct and stores

2023-12-04 Thread Richard Biener
On Mon, Dec 4, 2023 at 6:32 AM liuhongt wrote: > > .i.e. for below cases. >a[0] = b1; >a[1] = b2; >.. >a[n] = bn; > > There're extra dependences when contructing the vector, but not for > scalar store. According to experiments, it's generally worse. > > The patch adds an cut-off he

[PATCH] Don't vectorize when vector stmts are only vec_contruct and stores

2023-12-03 Thread liuhongt
.i.e. for below cases. a[0] = b1; a[1] = b2; .. a[n] = bn; There're extra dependences when contructing the vector, but not for scalar store. According to experiments, it's generally worse. The patch adds an cut-off heuristic when vec_stmt is just vec_construct and vector store. It imp