[PATCH] [LoopVectorize]Teach Loop Vectorizer about interleaved memory access
Renato Golin
renato.golin at linaro.org
Wed May 6 05:52:10 PDT 2015
================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:533
@@ -532,2 +532,3 @@
*Ptr << " SCEV: " << *PtrScev << "\n");
+ return 0;
}
----------------
HaoLiu wrote:
> hfinkel wrote:
> > Is this just a drive-by bug fix?
> Yes. I just came across this minor bug.
> As it's quite obvious and simple, should I just commit this fix?
Yes, if this is an unrelated fix, please submit a separate diff with a full description of what it is and a test.
================
Comment at: lib/Analysis/LoopAccessAnalysis.cpp:782
@@ +781,3 @@
+ unsigned NumIterations = ForcedFactor * ForcedUnroll;
+ // The number of vectorized & interleaved iterations should not be less than 2
+ if (NumIterations < 2)
----------------
HaoLiu wrote:
> rengolin wrote:
> > why not?
> Sorry that my comment is confusing.
>
> I mean the "ForcedFactor * ForcedUnroll" will never be 1.
> (1) If the VectorizationFactor and VectorizationInterleave are both set to be 1 by user, this is the same to disable the loop vectorizer. It will never execute to this point.
> (2) If either of the Factors is forced, the number of iterations will also never be 1. See if user set "-force-vector-interleaved=1", the vector factor will be at least 2. Or if user set "-force-vector-width=1", the unroll factor will be at least 2.
>
> So I set the number of iterations to be 2 if either factors is forced. This can simplify the following distance checks.
>
> I've changed the comments to make it more clear.
>
>
If one of the variables must be > 1 at this point, I don't see why you need the check below.
http://reviews.llvm.org/D9368
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list