Hi, On Tue, 10 Apr 2012, Richard Guenther wrote:
> > + vec_inv = build_constructor (vectype, v); > > + new_temp = vect_init_vector (stmt, vec_inv, vectype, gsi); > > + new_stmt = SSA_NAME_DEF_STMT (new_temp); > > + mark_symbols_for_renaming (new_stmt); > > This should not be necessary - in fact please manually set the proper > VUSE here. I don't see how I could know the right VUSE. It might not even exist yet. Reusing the existing vuse from the load that is replaced isn't correct. Consider that there are (unrelated) stores or calls before the load, and those are vectorized. When updating their operands they'll get a new vdef, and I'd need to use _that_ one: original: #vdef MEM_1 scalar_store = .... (this insn will be removed by vectorizable_store) #vuse MEM_1 ... = A[i] ---> #vdef MEM (note, no ssaname yet) vect_store = ... #vuse MEM_1 ... = A[i] ( will be later removed as unused LHS) #vuse XXX ... = A[i] #vuse XXX ... = A[i+stride] So, which SSA name to use for XXX, when the vect_store doesn't yet know (which it doesn't). Tracking (and generating) proper VDEF SSA names is possible (we only vectorize a single BB, and that in stmt order), but that requires some rework of the vectorizer main loops, which should be a separate patch. Agreed? Ciao, Michael.