Richard Biener <rguent...@suse.de> writes: > On Mon, 2 Aug 2021, Richard Sandiford wrote: > >> Richard Biener <rguent...@suse.de> writes: >> > On Fri, 30 Jul 2021, Richard Sandiford wrote: >> >> > @@ -9456,6 +9499,51 @@ vectorizable_load (vec_info *vinfo, >> >> > data_ref = NULL_TREE; >> >> > break; >> >> > } >> >> > + else if (memory_access_type == VMAT_GATHER_SCATTER) >> >> > + { >> >> > + /* Emulated gather-scatter. */ >> >> > + gcc_assert (!final_mask); >> >> >> >> For this to be safe, we need to make sure that >> >> check_load_store_for_partial_vectors clears >> >> LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P. Is that already guaranteed? >> >> (Maybe yes, I didn't look closely. :-)) >> > >> > I've made sure to fail earlier: >> > >> > @@ -8692,6 +8725,15 @@ vectorizable_load (vec_info *vinfo, >> > "unsupported access type for masked >> > load.\n"); >> > return false; >> > } >> > + else if (memory_access_type == VMAT_GATHER_SCATTER >> > + && gs_info.ifn == IFN_LAST >> > + && !gs_info.decl) >> > + { >> > + if (dump_enabled_p ()) >> > + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, >> > + "unsupported masked emulated gather.\n"); >> > + return false; >> > + } >> > } >> > >> > at least I don't see a way to emulate masked gathers ;) >> >> Yeah, that handles masked loads created by ifcvt. But we also need to >> protect against an unconditional load being converted into a predicated >> load for partial loop vectorisation. I think we still need a check in >> check_load_store_for_partial_vectors to handle that. The check wouldn't >> prevent vectorisation, it would just prevent using fully-predicated loops. > > But that seems to check for availability of the masked gather IFN which > of course isn't available and then sets > LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P to false:
Ah, yeah, OK. I wrongly thought that the relaxed check for gather/scatter support might have affected that too. Should be OK then. :-) Richard