[llvm] [LV][EVL] Support in-loop reduction using tail folding with EVL. (PR #90184)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 07:05:30 PDT 2024


Mel-Chen wrote:

> The title mentions this adds support for in-loop reductions, but I wasn't able to find a check to make sure we only vectorize in-loop reductions?
> 
> All tests seem to pass flags guiding towards the use of in-loop/ordered reductions, so the case where the regular reduction strategy is chosen may not be tested well

Indeed, we might need to change the title.
Originally, I only intended to support in-loop reduction first, but the bad news is that the legality check for folding with EVL occurs before the collection of in-loop reduction. This means we may need to postpone the legality check for folding with EVL or advance the collection of in-loop reduction.
The good news is that I have checked the IR generation in `inloop-reduction.ll` for IF-EVL-OUTLOOP, and it seems to be correct. This means we can directly open up both out-loop and in-loop reduction.
In conclusion, my suggestion is to change the title to "[LV][EVL] Support reduction idioms using tail folding with EVL." and directly add more RUN commands in the test cases to test the results of out-loop reduction. 
@fhahn What do you think?

https://github.com/llvm/llvm-project/pull/90184


More information about the llvm-commits mailing list