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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 07:56:28 PDT 2022


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10528
+            ResumeV = MainILV.createInductionResumeValue(
+                IndPhi, *ID, {EPI.MainLoopIterationCountCheck});
           }
----------------
venkataramanan.kumar.llvm wrote:
> Just a question here we are creating induction resume values two times for the main vector loop.  One here while setting up resume value for epilog vector loop. The second one while setting up resume value for the scalar loop.  is it possible to reuse already created one? 
> 
> If implementing the reuse is not worth the effort than creating a new one please ignore my comment. 
> 
> 
> Just a question here we are creating induction resume values two times for the main vector loop. One here while setting up resume value for epilog vector loop. The second one while setting up resume value for the scalar loop. is it possible to reuse already created one?

I think in general, the resume values could be different, e.g the edge main-vector-loop-successor -> scalar loop it would be based on (N - main vector TC), the edge epilogue-vector-loop-successor it would be based on (N - main vector TC - epilogue vector TC).


Is it possible that you were looking at the resume values in `@test_widen_ptr_induction`? I think those are a bit misleading, the resume values are the same as the epilogue vector loop never executes AFAICT. I added a few more interesting variants with runtime trip counts (e.g. `@test_widen_induction`).



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