This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX512] Add simple tests for all AVX512 shuffle instructions.
ClosedPublic

Authored by aymanmus on Aug 31 2017, 4:11 AM.

Details

Summary

Throughout an effort to strongly check the behavior of CodeGen with the IR shufflevector instruction we generated many tests while predicting the best X86 sequence that may be generated.

This is a subset of the generated tests that we think may add value to our X86 set of tests.

Some of the checks are not optimal and will be changed after fixing:
#. PR34394
#. PR34382
#. PR34380
#. PR34359

Diff Detail

Event Timeline

aymanmus created this revision.Aug 31 2017, 4:11 AM
aymanmus retitled this revision from [X86][AVX512 to [X86][AVX512] Add simple tests for all AVX512 shuffle instructions..Aug 31 2017, 4:18 AM
aymanmus edited the summary of this revision. (Show Details)
aymanmus added reviewers: zvi, igorb, craig.topper, RKSimon.
aymanmus added a subscriber: llvm-commits.
zvi added inline comments.Sep 3 2017, 12:03 AM
test/CodeGen/X86/avx512-shuffles/duplicate-low.ll
876

This test doesn't really check any AVX512 support, because it will be folded early in the target-indpenendent dagcombine.

1003

Same here

test/CodeGen/X86/avx512-shuffles/in_lane_permute.ll
1312

The all-zero/all-one mask tests don't contribute much for AVX512 testing

aymanmus updated this revision to Diff 113690.Sep 3 2017, 5:56 AM

Replacing all-ones/all-zeros masks with other "regular" masks.

zvi accepted this revision.Sep 3 2017, 6:37 AM

LGTM

This revision is now accepted and ready to land.Sep 3 2017, 6:37 AM
This revision was automatically updated to reflect the committed changes.
spatel added a subscriber: spatel.Sep 3 2017, 9:38 AM

You must specify a triple in these tests, or they will fail on bots and locally for me (I'm on macOS). Also, don't specify a cpu; specify the attribute(s) (eg -mattr=avx512f) that you are actually testing.
Failing Tests (13):

LLVM :: CodeGen/X86/avx512-shuffles/broadcast-scalar-fp.ll
LLVM :: CodeGen/X86/avx512-shuffles/broadcast-scalar-int.ll
LLVM :: CodeGen/X86/avx512-shuffles/broadcast-vector-fp.ll
LLVM :: CodeGen/X86/avx512-shuffles/broadcast-vector-int.ll
LLVM :: CodeGen/X86/avx512-shuffles/duplicate-high.ll
LLVM :: CodeGen/X86/avx512-shuffles/duplicate-low.ll
LLVM :: CodeGen/X86/avx512-shuffles/in_lane_permute.ll
LLVM :: CodeGen/X86/avx512-shuffles/partial_permute.ll
LLVM :: CodeGen/X86/avx512-shuffles/permute.ll
LLVM :: CodeGen/X86/avx512-shuffles/shuffle-interleave.ll
LLVM :: CodeGen/X86/avx512-shuffles/shuffle-vec.ll
LLVM :: CodeGen/X86/avx512-shuffles/shuffle.ll
LLVM :: CodeGen/X86/avx512-shuffles/unpack.ll

@spatel I noticed the failures right after the commit and added the triples (the updated ToT should be fine).
I'll replace the cpu with the attr also.
Thanks.

RKSimon edited edge metadata.Sep 5 2017, 2:53 AM

What was the reasoning behind adding this to a sub-directory instead of just inside llvm\test\CodeGen\X86 ?

test/CodeGen/X86/avx512-shuffles/shuffle.ll