Tamar Christina <[email protected]> writes: > Hi Dominc, > >> -----Original Message----- >> From: Dominic P <[email protected]> >> Sent: 05 October 2026 22:20 >> To: Tamar Christina <[email protected]> >> Cc: [email protected]; Richard Biener <[email protected]>; Richard >> Sandiford <[email protected]>; Robin Dapp >> <[email protected]> >> Subject: Re: [PATCH v2 1/2] vect: Account for peeling by masking in strided >> gather offsets >> >> Thanks Tamar. I may have misunderstood, but when I tried the change it >> did not seem to exclude the unmasked targets: at this point >> LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P still has its initial value (true), >> so the condition also holds for x86-64 with -mavx2 and for aarch64 with >> +nosve (I checked in the debugger with peeling for alignment 3 and 7). >> > > Hmm, yes unfortunately this looks to be called from > vect_slp_analyze_operations > before we call vect_determine_partial_vectors_and_peeling and once set it's > not re-evaluated. > >> Would a check of whether the target supports masked gather/scatter (or >> partial vectors) for this vector mode be what you had in mind, or is there >> a better way to tell this early? Happy to go with whatever you prefer. >> > > That probably won't work well, as gs_info->ifn isn't set in all cases. > I think we just have to be conservatively correct, so drop the > LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P and use the original patch, > But add a comment saying that we can't determine the exact peeling > method or whether masks are required yet and so are being conservative.
Sorry for the late comment, but if we want a less conservative approach, could we check max_iters < count / 2 for peeling? (That is, max_iters * 2 < count rearranged to avoid overflow.) Presumably we wouldn't peel more than max_iters iterations. Thanks, Richard
