[PATCH] D93615: [LV] Avoid needless fold tail

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 01:41:52 PST 2020


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5505
       UserIC ? MaxVF.getFixedValue() * UserIC : MaxVF.getFixedValue();
   if (TC > 0 && TC % MaxVFtimesIC == 0) {
     // Accept MaxVF if we do not have a tail.
----------------
SjoerdMeijer wrote:
> gilr wrote:
> > SjoerdMeijer wrote:
> > > Was surprised to see this change, because I thought we were handling it here already.
> > > Is this check here still relevant? Or can we "merge" this with the one that you added below?
> > >Is this check here still relevant?
> > 
> > Yes, since IC may take non-power-of-2 values. Will add a test to cover that.
> Ah yeah, I do see that now.
> Thanks
Thinking a bit more about this, I think we should be able to use `ScalarEvolution::getURemExpr` to check if the trip count is a multiple of any VF. That should work for both the constant and variable trip-count cases. As I missed commenting on that before the patch landed, I put up D93677


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93615



More information about the llvm-commits mailing list