[PATCH] D81416: [LV][SLP] Interleave to expose ILP for small loops with scalar reductions.

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 06:37:22 PDT 2020


bmahjour added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5409
+      LLVM_DEBUG(dbgs() << "LV: Interleaving to expose ILP.\n");
+      return std::max(IC / 2, SmallIC);
+    } else {
----------------
AaronLiu wrote:
> bmahjour wrote:
> > What's the significance of the value `2` here?
> Still use the above output as an example: the normal IC is 8, and SmallIC is definitely no more than 2 after calculation. SmallIC is too small and will not benefit SLP, and the provided testcase will not be vectorized. The normal IC is a little bit big in some rare situation when resources are too limited, for example in full width runs when all CPUs are running. The division by 2 here make it not that aggressive as the normal IC, but still can vectorize the testcase.
> 
Ok. It would be useful to have a brief comment in the code about this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81416





More information about the llvm-commits mailing list