[PATCH] D30587: [LV] Delete unneeded scalar GEP creation code

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 08:34:46 PST 2017


mssimpso added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2979
+#endif
+    Ptr = Gep ? getScalarValue(Gep, 0, 0) : getScalarValue(Ptr, 0, 0);
   } else {
----------------
mkuper wrote:
> 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?
That was my initial thought, but then I started second guessing myself for some reason. You're right, though; I think we can just use getScalarValue(Ptr, 0, 0) here and get rid of the GEP check (and probably the DEBUG stuff as well).

I have a follow-on patch that also removes the vector GEP creation from here. It moves it into the main vectorization loop. I'll update this patch and post the other so we can take a look at both of them at the same time.


https://reviews.llvm.org/D30587





More information about the llvm-commits mailing list