Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

[LV] Add mask support for vectorizing interleaved groups

Authored by igor.kirillov on Jun 6 2023, 4:30 AM.



This patch extends LoopVectorize to handle the vectorization of interleaved
memory accesses with scalable vectors when mask is required or/and predicated
tail folding is enabled.

Diff Detail

Event Timeline

igor.kirillov created this revision.Jun 6 2023, 4:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2023, 4:30 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
igor.kirillov requested review of this revision.Jun 6 2023, 4:30 AM
igor.kirillov added a subscriber: mgabka.

Refactor lambda function

igor.kirillov edited the summary of this revision. (Show Details)


I think it would be worthwhile to have a test covering conditional execution inside the original source loop as well as the active lane mask for tail folding. See llvm/test/Transforms/LoopVectorize/interleaved-accesses-masked-group.ll for examples.


We could use SVE masking for fixed length as well, but that can be done at a later date if you want.

Matt added a subscriber: Matt.Jun 15 2023, 7:49 PM
igor.kirillov edited the summary of this revision. (Show Details)

Updating after precommiting the tests

mgabka added inline comments.Jun 26 2023, 7:45 AM

could you add an assert here:
assert(InterleaveFactor == 2 &&

"Unsupported deinterleave factor for scalable vectors");

there is one in line 2731m but this function is called before reaching that line.

Add assertion

igor.kirillov marked an inline comment as done.Jun 26 2023, 1:11 PM
igor.kirillov edited the summary of this revision. (Show Details)

Rebase after pre-commit

huntergr accepted this revision.Jun 28 2023, 7:53 AM



Nit: when passing a null or boolean literal into a function, it's customary in LLVM to add an inline comment before it indicating the parameter name, as below.

/*FMFSource=*/nullptr would work.

This revision is now accepted and ready to land.Jun 28 2023, 7:53 AM

Add argument name