Re: [PATCH] Fix wrong code generated by unroll-and-jam pass

2022-10-06 Thread Richard Biener via Gcc-patches
On Thu, Oct 6, 2022 at 1:09 PM Eric Botcazou wrote: > > > I'm wondering if testing DR_IS_WRITE (dra) is enough here and whether > > the logic also applies to RAW and WAR. So should it be either > > (DR_IS_WRITE (dra) || DR_IS_WRITE (drb)) or DR_IS_WRITE (dra) && > > DR_IS_WRITE (drb) instead? > >

Re: [PATCH] Fix wrong code generated by unroll-and-jam pass

2022-10-06 Thread Eric Botcazou via Gcc-patches
> I'm wondering if testing DR_IS_WRITE (dra) is enough here and whether > the logic also applies to RAW and WAR. So should it be either > (DR_IS_WRITE (dra) || DR_IS_WRITE (drb)) or DR_IS_WRITE (dra) && > DR_IS_WRITE (drb) instead? It's a self-dependence, i.e. dra == drb in the block. Or do you

Re: [PATCH] Fix wrong code generated by unroll-and-jam pass

2022-10-06 Thread Richard Biener via Gcc-patches
On Wed, Oct 5, 2022 at 5:39 PM Eric Botcazou via Gcc-patches wrote: > > Hi, > > as shown by the attached testcase, there is a loophole in the unroll-and-jam > pass that can quickly result in wrong code generation. The code reads: > > if (!compute_data_dependences_for_loop (outer, true, &loop_

[PATCH] Fix wrong code generated by unroll-and-jam pass

2022-10-05 Thread Eric Botcazou via Gcc-patches
Hi, as shown by the attached testcase, there is a loophole in the unroll-and-jam pass that can quickly result in wrong code generation. The code reads: if (!compute_data_dependences_for_loop (outer, true, &loop_nest, &datarefs, &dependences)) {