https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113134

--- Comment #6 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
(In reply to JuzheZhong from comment #5)
> (In reply to Tamar Christina from comment #4)
> > (In reply to JuzheZhong from comment #3)
> > > I guess this code is just disabling partial vector for length for now.
> > > 
> > > And need me to test and port this part for length in the followup patches.
> > > 
> > > Am I right ?
> > 
> > Yeah, it needed to safely not allow it through for now. Once implemented 
> > you'll hit an assert in vectorizable_live_operations where you need to
> > provide a way to also get the first active element from a vector.
> 
> So for a length target, I enable cbranch optab but no vcond_mask_len optab.
> Will it behavior wrong ?
> 

You need both, if the operation requires a mask it'll reject it without
vcond_mask_len support.  Because I didn't know how to extract first element
using vcond_mask_len I had to disable it.

> Another question is could you give me more hints about
> vectorizable_live_operation?
> 
> I thought vectorizable_live_operation is doing extract last active element,
> I didn't see extract first active element.

Normally yes, but I added extract first active element for this patch.  This is
because when you hit and take an early exit we restrart the vector iteration
since there may be partial effects to perform between where the loop started
and where the element is found.

specifically look at vectorizable_live_operation_1 there's an assert under 
  if (LOOP_VINFO_FULLY_WITH_LENGTH_P (loop_vinfo))

with a comment saying what's needed.

Reply via email to