This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add CodeGen tests for vector reduction intrinsics. NFC
ClosedPublic

Authored by RosieSumpter on Jun 23 2021, 2:21 AM.

Details

Summary

Tests are added for vector reduce OR, AND and XOR.

Diff Detail

Event Timeline

RosieSumpter created this revision.Jun 23 2021, 2:21 AM
RosieSumpter requested review of this revision.Jun 23 2021, 2:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2021, 2:21 AM
SjoerdMeijer accepted this revision.Jun 23 2021, 2:41 AM

Thanks for adding these test. A few nits inlined, but no need for another review if you're happy to make a few changes before committing (but I can always have another look).

llvm/test/CodeGen/AArch64/reduce-or.ll
356

You may want to add <2 x i32> as that is a common type and supported by the vector instructions.

367

I think you can remove this one because the 32 x i8 case above is already testing a type that doesn't fit in a vector register.

The same 2 comments here apply to the other files as well.

llvm/test/CodeGen/AArch64/reduce-xor.ll
5

Nit: test_redor_v1i1 -> test_redxor_v1i1

And a few more below.

This revision is now accepted and ready to land.Jun 23 2021, 2:41 AM
fhahn added a subscriber: fhahn.Jun 23 2021, 3:00 AM
fhahn added inline comments.
llvm/test/CodeGen/AArch64/reduce-and.ll
6

For boolean reductions, there's already llvm/test/CodeGen/AArch64/vecreduce-bool.ll. Can those tests be unified to reduce duplication?

RosieSumpter marked 3 inline comments as done.Jun 23 2021, 5:36 AM
RosieSumpter added inline comments.
llvm/test/CodeGen/AArch64/reduce-and.ll
6

It seems that vecreduce-bool.ll is testing something slightly different as it is looking at the pattern of a compare with a reduction, so generates e.g. uminv and umaxv instructions. I have agreed with @SjoerdMeijer to keep these tests separate for now.

This revision was landed with ongoing or failed builds.Jun 23 2021, 5:56 AM
This revision was automatically updated to reflect the committed changes.
fhahn added inline comments.Jun 23 2021, 5:59 AM
llvm/test/CodeGen/AArch64/reduce-and.ll
6

ok fair enough.