This is an archive of the discontinued LLVM Phabricator instance.

[LoopVectorize] Test in-loop reductions with tail folding for scalable vectors
ClosedPublic

Authored by kmclaughlin on Jan 18 2022, 9:52 AM.

Details

Summary

Adds -prefer-inloop-reductions to the RUN line of sve-tail-folding.ll & adds
a new test where in-loop reductions cannot be used (@cond_xor_reduction). NFC.

Diff Detail

Event Timeline

kmclaughlin created this revision.Jan 18 2022, 9:52 AM
kmclaughlin requested review of this revision.Jan 18 2022, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 9:52 AM
david-arm accepted this revision.Jan 19 2022, 1:44 AM

LGTM!

llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding.ll
658

nit: I think you'll need to rebase the patch before merging because we now use the get.active.lane.mask intrinsic to generate the loop predicate.

680

I think the reason why we don't use in-loop reductions here is because it's a conditional reduction, right?

682

nit: I think you can just delete everything from this line onwards because we'll never reach the scalar tail anyway.

This revision is now accepted and ready to land.Jan 19 2022, 1:44 AM
This revision was landed with ongoing or failed builds.Jan 19 2022, 6:37 AM
This revision was automatically updated to reflect the committed changes.
kmclaughlin marked 2 inline comments as done.
kmclaughlin added inline comments.Jan 19 2022, 6:41 AM
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding.ll
680

Yes, this test changes to use in-loop reductions in D117580 which adds support for conditional reductions.