cdl-saarland / rv

RV: A Unified Region Vectorizer for LLVM
Other
105 stars 15 forks source link

Remove latch-exit restriction in rv::LoopVectorizer #10

Open simoll opened 6 years ago

simoll commented 6 years ago

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
zhang-rui-github commented 2 years ago

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

simoll commented 1 year ago

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