On Mon, 24 Nov 2025, Jakub Jelinek wrote:

> On Mon, Nov 24, 2025 at 03:10:00PM +0100, Richard Biener wrote:
> > The linear() clauses are basically constraints on the caller side?
> 
> Not just that, they are part of the calling convention as well.
> Normal arguments (i.e. non-linear non-uniform) are passed as vector
> (or several vectors), uniform are passed as scalars and linear as well,
> though there are various variants of linear.  To some extent, uniform
> is like linear with step 0, although uniform can be used even on
> non-integral arguments.
> 
> So, on the caller side it is a constraint, and if the constraint
> is satisfied, also something that should be honored during the vectorization
> of the call argument.

OK, I see.

> > Likewise uniform()?  I suppose a linear() or uniform() clause arg
> > can be handled as normal vector in the SIMD function, but not all
> > normal vector arguments can be handled with linar() or uniform)
> > SIMD function?
> > 
> > Looking I also see that while we attempt to support SLP for SIMD calls
> > we do not handle uniform()/linear() correctly there.  I'll fix that.
> > 
> > I'm not sure same "badness" is a good measure for compatibility, but
> > yes, I'd like to pick a pair of clones that only differ in
> > inbranch vs. notinbranch, if only for simplicity at this point.
> 
> Ah, sure, if you'd tried to remember parts of what you found in simdclone,
> you'd need to remember it twice.  Or simply redo it during the transform
> phase again?

I guess this code is ready for a bigger make-over, but yes, we record
parts of the argument analysis, but from the argument analysis of the
call.  That's the same irrespective of the chosen clones, but we
record only in case the chosen clone uses a linear() clause.  If
we'd record this always we should have the info readily available
for all clones that passed the selection checks.  I guess I can
fix the recording to consider both clones.  I also failed to
record a loop mask for the inbranch clone I think, but that's
easily fixed as well.

Richard.

Reply via email to