https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70021
--- Comment #7 from Ilya Enkovich <ienkovich at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #6) > Created attachment 37834 [details] > gcc6-pr70021-wip.patch > > But that would mean we don't vectorize the loop. > I see 2 cases here, one where we look up the def_stmt and look through it, > that is the same case as in the other PR and we shouldn't do that, otherwise > we reference something that is not the final SSA_NAME of a pattern sequence > outside of that sequence. > The other case is where we don't look through that or just avoid that, in > that case we add a cast into the current pattern sequence, and refer to the > final SSA_NAME of the other pattern sequence. I really don't see why that > shouldn't work right. Except as the patch shows, it doesn't for some reason. We didn't vectorize this loop before r230098 so it wouldn't be a regression. But surely be less restrictive is always good! You'd probably want to check loop is vectorized in your patch then? BTW this test shows another problem. Conversion statement replaced with a pattern is still used for vectorization factor computation causing VF=32 with no vectors with more than 8 elements used.