[PATCH] D50480: [LV] Vectorizing loops of arbitrary trip count without remainder under opt for size

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 15:20:49 PDT 2018


reames added a comment.

I have a general question about direction, not specific to this patch.

It seems like we're adding a specific form of predication to the vectorizer in this patch and I know we already have support for various predicated load and store idioms.  What are our plans in terms of supporting more general predication?  For instance, I don't believe we handle loops like the following at the moment:
for (int i = 0; i < N; i++) {

  if (unlikely(i > M)) 
     break;
  sum += a[i];

}

Can the infrastructure in this patch be generalized to handle such cases?  And if so, are their any specific plans to do so?

Secondly, are there any plans to enable this approach for anything other than optsize?



================
Comment at: test/Transforms/LoopVectorize/X86/optsize.ll:12
+; CHECK-LABEL: @foo_optsize(
+; CHECK: x i8>
+
----------------
Testing wise, expanding out the IR generated w/update-lit-checks and landing the tests without the changes and then rebasing on top would make it much easier to follow the transform being described for those us not already expert in the vectorizer code structures.  I get that your following existing practice, but this might be one of the cases which justify changing existing practice in the area.  :)


Repository:
  rL LLVM

https://reviews.llvm.org/D50480





More information about the llvm-commits mailing list