The code for generating scalar base pointers in vectorizeMemoryInstruction is not needed. We currently scalarize all GEPs and maintain the scalarized values in VectorLoopValueMap. The GEP cloning in this unneeded code is the same as that in scalarizeInstruction. The test cases that changed as a result of this patch changed because we were able to reuse the scalarized GEP that we previously generated instead of cloning a new one.
I plan to follow this patch up with a few more that will eventually merge pointer induction variable widening with the rest of the induction widening code.
Do we really need to pay attention to the GEP anymore?
I mean, if we already scalarize everything correctly, wouldn't just always using "getScalarValue(Ptr, 0, 0)" be enough?