[PATCH] D20474: when calculating RegUsages, ignore instructions which are uniformed after vectorization

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 17:09:44 PDT 2016


wmi added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6175
@@ -6174,4 +6174,3 @@
 
-  // Ignore induction phis that are only used in either GetElementPtr or ICmp
-  // instruction to exit loop. Induction variables usually have large types and
-  // can have big impact when estimating register usage.
+  // Ignore induction phis that are only used in either GetElementPtr or
+  // Uniform instruction since we don't need vector versions for such induction
----------------
mkuper wrote:
> wmi wrote:
> > mkuper wrote:
> > > This isn't directly related to this patch - but wouldn't this be true only for consecutive GEPs? (e.g. see D20789)
> > Every GEP (no matter it is consecutive or not) will be scalarized. It is not related with the load/store using the GEP.  If the induction variable is only used in GEP, it will not be vectorized, right?  
> I don't think so - as far as I know, we should be creating vector GEPs for scatter/gather when it's profitable on the target. (I think the only target that supports it right now is AVX-512.)
I see. If a[3*i] are vectorized using gather/scatter. It needs a vectorized version of 3*i so probably it is better to generate a vectorized version of i. Then i shouldn't be added into VecValuesToIgnore. Thanks. 



Repository:
  rL LLVM

http://reviews.llvm.org/D20474





More information about the llvm-commits mailing list