[PATCH] D92132: [LV] Support widened induction variables in epilogue vectorization.

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 15:04:55 PDT 2021


bmahjour added a comment.

Instead of changing the generic interface for skeleton creation, how about adding a field to hold the resume value inside `EpilogueVectorizerEpilogueLoop`? Then inside `executePlan()` we would do something like this to update the induction widening recipes:

  EpilogueVectorizerEpilogueLoop *EILV = dyn_cast<EpilogueVectorizerEpilogueLoop>(ILV);
  if (EILV) {
    Value *IndStart = EILV->getResumeValue();
    assert(IndStart && "Expected valid resume value");
    ...
  }

Also don't we need to store some sort of a map to be able to handle loops with multiple widened induction vars (with potentially different resume values)? I'm thinking of a case like this:

  void foo(int * restrict A, int N) {
    int i, j, k;
    for (i = 0, j = 1, k = 2; i < N; i++, j++, k++)
      A[i] = j + k;
  }



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8217
+        VPValue *StartVPV = new VPValue(IndStart);
+        Plan->addExternalDef(StartVPV);
+        Ind->setStart(StartVPV);
----------------
Don't we need to make sure that it is an "external definition" before treating it as such?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92132



More information about the llvm-commits mailing list