This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Add test case for SLP reduction vectorization failure
ClosedPublic

Authored by luke on Mar 21 2023, 7:50 AM.

Details

Summary

Horizontal reductions still occur on RISC-V, despite the maximum SLP VF
reported back by TTI being 1, to disable SLP.
This can cause the cost model to think it can vectorize a gather into
smaller, widened loads, when it will actually fail to do so.
This should ultimately be fixed whenever SLP is re-enabled for RISC-V at
some point.

Diff Detail

Event Timeline

luke created this revision.Mar 21 2023, 7:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 7:50 AM
luke requested review of this revision.Mar 21 2023, 7:50 AM
reames accepted this revision.Mar 21 2023, 8:42 AM

LGTM

llvm/test/Transforms/SLPVectorizer/RISCV/reductions.ll
846

I just want to point out that this is a very weird bit of code. We generate one pair of vector loads, but we could have generated the four scalar loads as a two vector loads as well. What we model as a vector load + two inserts of scalars could easily be two vector loads and a concat of two vectors.

This revision is now accepted and ready to land.Mar 21 2023, 8:42 AM