cdl-saarland / rv

RV: A Unified Region Vectorizer for LLVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove latch-exit restriction in rv::LoopVectorizer

simoll opened this issue · comments

At the moment, RV's LoopVectorizer pass only supports latch exit loops. Otherwise, the remainder loop transformation (RemainderTransform) bails and the loop remains scalar. This restriction does not apply to any other nested loops in the outer loop being vectorized.

This loop will be vectorized:

Header:
 ...
Latch:
 ...
  br i1 %exitcond, label %Exit, label %Header

This loop won't be vectorized as the exit is not in the latch:

Header:
 ...
  br i1 %exitcond, label %Exit, ....

Latch:
 ...
  br label %Header

I see this issue was created in 2017 so am curious if the restriction on latch exit loops is still valid now. Thanks.

It is still a restriction. You are very welcome to work on this. Tech for detecting/separating dependence cycles has been around for a long time