https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94043
--- Comment #15 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 26 Mar 2020, linkw at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94043 > > --- Comment #14 from Kewen Lin <linkw at gcc dot gnu.org> --- > (In reply to Richard Biener from comment #13) > > > > > + /* Find all SSA NAMEs in stmts which is defined in current loop, > > create > > + PHIs for them, and replace them with phi results accordingly. */ > > + for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi)) > > + { > > + gimple *stmt = gsi_stmt (gsi); > > + update_stmt (stmt); > > + > > ... > > > > should not be necessary. What's missing in your patch is that when the > > current code has computed vec_lhs it needs to create a LC PHI node for it > > _before_ computing the lane extraction and instead use vec_lhs' there. > > OK, I was thinking the mask for LOOP_VINFO_FULLY_MASKED_P part is probably a > SSA name and can live out, as your comments, it looks impossible. Will update > it and send for review after testing. Thanks again! I guess the result of vect_get_loop_mask might need a loop-closed PHI as well though that could be addressed independently since it's a pre-existing "bug"