[PATCH] D36220: [Loop Vectorize] Added a separate metadata

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 09:11:28 PDT 2017


hfinkel added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1285
 
+    if(IsVectorized.Value != 1)
+      IsVectorized.Value = Width.Value & Interleave.Value;
----------------
space after if.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1285
 
+    if(IsVectorized.Value != 1)
+      IsVectorized.Value = Width.Value & Interleave.Value;
----------------
hfinkel wrote:
> space after if.
I think we should add a comment here explaining this. How about?

  // If the vectorization width and interleaving count are both 1 then consider the loop to have been already vectorized because there's nothing more that we can do.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:1286
+    if(IsVectorized.Value != 1)
+      IsVectorized.Value = Width.Value & Interleave.Value;
     DEBUG(if (DisableInterleaving && Interleave.Value == 1) dbgs()
----------------
Which needs to be:

   Width.Value == 1 && Interleave.Value == 1

As you have it written, the condition will be true whenever there are any overlapping set bits in the two numbers, say when they're both equal, which is not what we want.


https://reviews.llvm.org/D36220





More information about the llvm-commits mailing list