[PATCH] D41953: [LoopUnroll] Unroll and Jam

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 29 13:38:02 PDT 2018


hsaito added a subscriber: dcaballe.
hsaito added a comment.

In https://reviews.llvm.org/D41953#1115101, @dmgreen wrote:

> In https://reviews.llvm.org/D41953#1114289, @hsaito wrote:
>
> > David, outer loop vectorization we've been working on and unroll and jam have a lot of similarities and thus there should be code sharing opportunities around legality and cost modeling. Let's collaborate to improve both.
>
>
> Yeah, sounds like a good idea. Vectorisation is not something I know a huge amount about, it not being useful for the particular cores I'm looking at at the moment. But the work on VPlan sounds interesting and I do wish we had something similar for loop transforms in llvm. I was hoping to get loop versioning working, maybe through LoopAccessAnalysis, but as far as I understand it doesn't handle outer loops yet (and seemed very vectoriser shaped when I looked). From what I remember hearing, this isn't part of the outer loop vectorisation work (instead relying on user directives?). I imagine it's not an easy task to extend this out.
>
> The current legality checks here are based on dependence analysis, and there are a couple of patches needed to make it work correctly. The cost modelling is very adhoc. :) All these things I hope we can improve as we go along.


We are currently focusing on directive based implementation, but the same framework can be used for automatic vectorization at the outer loop level. It's not like vectorizer side has a lot of immediately reusable code in place, but I think co-designing the solution makes a lot of sense, to avoid duplicate work (or to consolidate into shared reusable code). For example, uniform control flow check @dcaballe has written is probably shareable. Ditto for Divergence Analysis RFC by Simon Moll. Dependence Analysis for outer loop vectorization isn't something we are currently working on, and thus being able to reuse is a very nice thing.


Repository:
  rL LLVM

https://reviews.llvm.org/D41953





More information about the llvm-commits mailing list