This is an archive of the discontinued LLVM Phabricator instance.

[X86] Don't report gather is legal on Skylake CPUs when AVX2/AVX512 is disabled. Allow gather on SKX/CNL/ICL when AVX512 is disabled by using AVX2 instructions.
ClosedPublic

Authored by craig.topper on Nov 20 2017, 9:24 PM.

Details

Summary

This adds a new fast gather feature bit to cover all CPUs that support fast gather that we can use independent of whether the AVX512 feature is enabled. I'm only using this new bit to qualify AVX2 codegen. AVX512 is still implicitly assuming fast gather to keep tests working and to match the scatter behavior.

Test command lines have been added for these two cases.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Nov 20 2017, 9:24 PM
craig.topper edited the summary of this revision. (Show Details)Nov 20 2017, 9:25 PM
craig.topper added reviewers: magabari, delena, RKSimon, zvi.
RKSimon accepted this revision.Nov 25 2017, 8:56 AM

LGTM with a couple of minors about comment cleanup

lib/Target/X86/X86Subtarget.cpp
279 ↗(On Diff #123714)

Does this comment need cleaning up, possibly moving some it to the FeatureHasFastGather def?

lib/Target/X86/X86TargetTransformInfo.cpp
2521 ↗(On Diff #123714)

Drop skylake reference and add a TODO about dropping hasAVX512() and driving this purely by hasFastGather

This revision is now accepted and ready to land.Nov 25 2017, 8:56 AM
This revision was automatically updated to reflect the committed changes.