[PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-21 Thread Richard Biener via Gcc-patches
The following addresses a miscompilation by RTL scheduling related to the representation of masked stores. For that we have (insn 38 35 39 3 (set (mem:V16SI (plus:DI (reg:DI 40 r12 [orig:90 _22 ] [90]) (const:DI (plus:DI (symbol_ref:DI ("b") [flags 0x2] )

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-21 Thread Jeff Law via Gcc-patches
On 6/21/23 01:49, Richard Biener via Gcc-patches wrote: The following addresses a miscompilation by RTL scheduling related to the representation of masked stores. For that we have (insn 38 35 39 3 (set (mem:V16SI (plus:DI (reg:DI 40 r12 [orig:90 _22 ] [90]) (const:DI (plus:D

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, 21 Jun 2023, Jeff Law wrote: > > > On 6/21/23 01:49, Richard Biener via Gcc-patches wrote: > > The following addresses a miscompilation by RTL scheduling related > > to the representation of masked stores. For that we have > > > > (insn 38 35 39 3 (set (mem:V16SI (plus:DI (reg:DI 40 r1

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-24 Thread Jeff Law via Gcc-patches
On 6/22/23 00:39, Richard Biener wrote: I suspect there's no way to specify the desired semantics? OTOH code that looks at the MEM operand only and not the insn (which should have some UNSPEC wrapped) needs to be conservative, so maybe the alias code shouldn't assume that a (mem:V16SI ..)

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-26 Thread Hongtao Liu via Gcc-patches
On Wed, Jun 21, 2023 at 3:49 PM Richard Biener via Gcc-patches wrote: > > The following addresses a miscompilation by RTL scheduling related > to the representation of masked stores. For that we have > > (insn 38 35 39 3 (set (mem:V16SI (plus:DI (reg:DI 40 r12 [orig:90 _22 ] [90]) >

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, Hongtao Liu wrote: > On Wed, Jun 21, 2023 at 3:49?PM Richard Biener via Gcc-patches > wrote: > > > > The following addresses a miscompilation by RTL scheduling related > > to the representation of masked stores. For that we have > > > > (insn 38 35 39 3 (set (mem:V16SI (plus

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-27 Thread Robin Dapp
> The easiest way to avoid running into the alias analysis problem is > to scrap the MEM_EXPR when we expand the internal functions for > partial loads/stores. That avoids the disambiguation we run into > which is realizing that we store to an object of less size as > the size of the mode we appea

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-27 Thread Jeff Law
On 11/27/23 05:39, Robin Dapp wrote: The easiest way to avoid running into the alias analysis problem is to scrap the MEM_EXPR when we expand the internal functions for partial loads/stores. That avoids the disambiguation we run into which is realizing that we store to an object of less size

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-27 Thread Richard Biener
On Mon, 27 Nov 2023, Jeff Law wrote: > > > On 11/27/23 05:39, Robin Dapp wrote: > >> The easiest way to avoid running into the alias analysis problem is > >> to scrap the MEM_EXPR when we expand the internal functions for > >> partial loads/stores. That avoids the disambiguation we run into > >

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-28 Thread Richard Sandiford
Richard Biener writes: > On Mon, 27 Nov 2023, Jeff Law wrote: > >> >> >> On 11/27/23 05:39, Robin Dapp wrote: >> >> The easiest way to avoid running into the alias analysis problem is >> >> to scrap the MEM_EXPR when we expand the internal functions for >> >> partial loads/stores. That avoids t

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-28 Thread Richard Biener
On Tue, 28 Nov 2023, Richard Sandiford wrote: > Richard Biener writes: > > On Mon, 27 Nov 2023, Jeff Law wrote: > > > >> > >> > >> On 11/27/23 05:39, Robin Dapp wrote: > >> >> The easiest way to avoid running into the alias analysis problem is > >> >> to scrap the MEM_EXPR when we expand the in

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-28 Thread Richard Sandiford
Richard Biener writes: > On Tue, 28 Nov 2023, Richard Sandiford wrote: > >> Richard Biener writes: >> > On Mon, 27 Nov 2023, Jeff Law wrote: >> > >> >> >> >> >> >> On 11/27/23 05:39, Robin Dapp wrote: >> >> >> The easiest way to avoid running into the alias analysis problem is >> >> >> to scrap

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-28 Thread Richard Biener
On Tue, 28 Nov 2023, Richard Sandiford wrote: > Richard Biener writes: > > On Tue, 28 Nov 2023, Richard Sandiford wrote: > > > >> Richard Biener writes: > >> > On Mon, 27 Nov 2023, Jeff Law wrote: > >> > > >> >> > >> >> > >> >> On 11/27/23 05:39, Robin Dapp wrote: > >> >> >> The easiest way to

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-28 Thread Jeff Law
On 11/28/23 00:50, Richard Biener wrote: There's no way to distinguish a partial vs. non-partial MEM on RTL and while without the bogus MEM_ATTR the alias oracle pieces that miscompiled the original case are fended off we still see the load/store as full given they have a mode with a size -

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-11-28 Thread Richard Biener
On Tue, 28 Nov 2023, Jeff Law wrote: > > > On 11/28/23 00:50, Richard Biener wrote: > > > > > There's no way to distinguish a partial vs. non-partial MEM on RTL and > > while without the bogus MEM_ATTR the alias oracle pieces that > > miscompiled the original case are fended off we still see t