[llvm-dev] Vectorizing multiple exit loops

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 19 03:16:18 PDT 2019


On Thu, 19 Sep 2019 at 00:19, Philip Reames <listmail at philipreames.com> wrote:
> If M < N (provably), SCEV would return an exit count for the loop which
> reflects this.  If not, we'd get umin(M,N).  We can still generate the
> vector body at the cost of inserting the umin computation above the loop
> body.  Both cases can be handled by running the vector loop up to the
> minimum trip count (well, one less to handle mid-loop exits and side
> effects).  The M < N case is falls out of the more general one.

Yup.

> I don't know of any plans to incorporate iteration space splitting
> w/VPLan.  I don't have any plans to go that far; if I had such test
> cases - I don't - I'd want to start with separately factored transforms
> if we could.  Doing everything within one transform is undesirable.  :)

AFAIK this isn't strictly in the immediate plans, but loop splitting
was one of the aims for doing outer-loop vectorisation.

My point was that if we want to do that, vplan would be a good place,
because we could add this as its own plan, which would expose other
vectorisation opportunities (including fusion with other loops).

> > I think getting a real case in the test-suite and make that work would
> > make a lot of people happy. :)
> I wish.  Unfortunately, my "real test case" is a java benchmark.   I
> doubt I'll be able to get it into the test suite.  :(

Hm, not likely. Getting those loops as IR in the lit tests would
probably be enough, if these transformations don't affect anything in
the test-suite.


More information about the llvm-dev mailing list