[PATCH] D57598: [VPLAN] Determine Vector Width programmatically.

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 10:26:43 PDT 2019


hsaito added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6105
+    // We set VF to 4 for stress testing.
+    if (VPlanBuildStressTest)
+      VF = 4;
----------------
fpetrogalli wrote:
> hsaito wrote:
> > (VPlanBuildStressTest && VF < 2) ?
> > 
> > 
> > 
> Sure, but why? If we are in `VPlanBuildStressTest`, why would you care about the value of VF?
> 
> Isn't it better to have full control on the stress tests and make sure that we always vectorize with VF = 4?
I then suggest going back to (VPlanBuildStressTest && !UserVF) --- override only if the programmer doesn't explicitly set it.

For the spirit of stress testing, I think it makes sense to have the ability to choose any legal VF (and in the future extend it to "scalable"). Maybe, we should take compiler option instead of hard-coded 4. So, something along like the following?
 
if (!UserVF)
   if (VPlanBuildStressTest)
        VF = 4
   else
        VF = determineVplanVF()



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57598/new/

https://reviews.llvm.org/D57598





More information about the llvm-commits mailing list