Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-07 Thread Richard Biener
> Am 07.07.2024 um 11:26 schrieb Robin Dapp : > >  >> >> Yeah, I think so. I guess for RVV there's a choice between: >> >> (1) making the insn predicate accept all else values and making >>the insn emit an explicit blend between the loaded result >>and the else value >> >> (2) maki

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-07 Thread Robin Dapp
> Yeah, I think so. I guess for RVV there's a choice between: > > (1) making the insn predicate accept all else values and making > the insn emit an explicit blend between the loaded result > and the else value > > (2) making the insn predicate only accept “undefined” (SCRATCH in > r

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Richard Sandiford
Robin Dapp writes: >> FTR, my concern & suggestion was: >> >> I suppose the difficulty is that we might make: >> >> MASK_LOAD (mask, ptr, some-arbitrary-else-value) >> >> seem as cheap as: >> >> MASK_LOAD (mask, ptr, { 0, 0,. ... 0}) >> >> which definitely isn't the case for SVE

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Robin Dapp
> To me this looks like mis-applying of match.pd:6083? > > Applying pattern match.pd:6083, gimple-match-1.cc:45749 > gimple_simplified to iftmp.0_62 = iftmp.0_61 | _219; > new phi replacement stmt > iftmp.0_62 = iftmp.0_61 | _219; > > so originally it wasn't > > iftmp.0_61 = .MASK_LOAD (_260,

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Robin Dapp
> FTR, my concern & suggestion was: > > I suppose the difficulty is that we might make: > > MASK_LOAD (mask, ptr, some-arbitrary-else-value) > > seem as cheap as: > > MASK_LOAD (mask, ptr, { 0, 0,. ... 0}) > > which definitely isn't the case for SVE (and I'm guessing also > for

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Richard Biener
> Am 05.07.2024 um 16:00 schrieb Richard Sandiford : > > Richard Biener writes: >>> On Fri, 5 Jul 2024, Richard Biener wrote: >>> On Fri, 5 Jul 2024, Robin Dapp wrote: >>> Hi, in PR115336 we have the following vect_patt_391 = .MASK_LEN_GATHER_LOAD (_470, vec

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Richard Sandiford
Richard Biener writes: > On Fri, 5 Jul 2024, Richard Biener wrote: > >> On Fri, 5 Jul 2024, Robin Dapp wrote: >> >> > Hi, >> > >> > in PR115336 we have the following >> > >> > vect_patt_391 = .MASK_LEN_GATHER_LOAD (_470, vect__59, 1, { 0, ... }, { >> > 0, ... }, _482, 0); >> > vect_iftmp.4

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Richard Sandiford
Robin Dapp writes: > Hi, > > in PR115336 we have the following > > vect_patt_391 = .MASK_LEN_GATHER_LOAD (_470, vect__59, 1, { 0, ... }, { 0, > ... }, _482, 0); > vect_iftmp.44 = vect_patt_391 | { 1, ... }; > .MASK_LEN_STORE (vectp_f.45, 8B, { -1, ... }, _482, 0, vect_iftmp.44); > > which a

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Richard Biener
On Fri, 5 Jul 2024, Richard Biener wrote: > On Fri, 5 Jul 2024, Robin Dapp wrote: > > > Hi, > > > > in PR115336 we have the following > > > > vect_patt_391 = .MASK_LEN_GATHER_LOAD (_470, vect__59, 1, { 0, ... }, { > > 0, ... }, _482, 0); > > vect_iftmp.44 = vect_patt_391 | { 1, ... }; > >

Re: [RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Richard Biener
On Fri, 5 Jul 2024, Robin Dapp wrote: > Hi, > > in PR115336 we have the following > > vect_patt_391 = .MASK_LEN_GATHER_LOAD (_470, vect__59, 1, { 0, ... }, { 0, > ... }, _482, 0); > vect_iftmp.44 = vect_patt_391 | { 1, ... }; > .MASK_LEN_STORE (vectp_f.45, 8B, { -1, ... }, _482, 0, vect_i

[RFC] tree-if-conv: Handle nonzero masked elements [PR115336].

2024-07-05 Thread Robin Dapp
Hi, in PR115336 we have the following vect_patt_391 = .MASK_LEN_GATHER_LOAD (_470, vect__59, 1, { 0, ... }, { 0, ... }, _482, 0); vect_iftmp.44 = vect_patt_391 | { 1, ... }; .MASK_LEN_STORE (vectp_f.45, 8B, { -1, ... }, _482, 0, vect_iftmp.44); which assumes that a maskload sets the maske