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

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 11:51:02 PDT 2019


fpetrogalli added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:6105
+    // We set VF to 4 for stress testing.
+    if (VPlanBuildStressTest)
+      VF = 4;
----------------
hsaito wrote:
> 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()
> 
Thank you for explaining.  I have re-worked the if statement as requested.


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

https://reviews.llvm.org/D57598





More information about the llvm-commits mailing list