This is an archive of the discontinued LLVM Phabricator instance.

[X86][SLP] Basic test coverage for llvm.powi
ClosedPublic

Authored by n-omer on Jun 10 2022, 5:55 AM.

Details

Summary

This patch introduces basic test coverage for llvm.powi.* intrinsics.

Diff Detail

Event Timeline

n-omer created this revision.Jun 10 2022, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2022, 5:55 AM
n-omer requested review of this revision.Jun 10 2022, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2022, 5:55 AM
RKSimon added inline comments.
llvm/test/Analysis/CostModel/X86/powi.ll
8

Probably worth adding a couple of different methods here with different i32 power factors: non-constant, negative, odd, even. big (above the limit for powi -> mul expansion):
@powi_var
@powi_6
@powi_3
@powi_n3
@powi_16

llvm/test/Transforms/SLPVectorizer/X86/powi.ll
8

again - you're going to need tests with different powi factors - not just the factor = 6 case from https://github.com/llvm/llvm-project/issues/53887 - its probably satisfactory to have these tests use different factors (just make sure you rename them to state the factor)?

probably worth adding at least one 'negative test' with different powi factors to make sure it doesn't try to vectorize / crash / whatever

craig.topper retitled this revision from []X86][SLP] Basic test coverage for llvm.powi to [X86][SLP] Basic test coverage for llvm.powi.Jun 10 2022, 12:56 PM
n-omer updated this revision to Diff 436312.Jun 13 2022, 2:41 AM

Address review comments.

If possible, please replace all uses of undef with poison. Thank you!

n-omer updated this revision to Diff 436716.Jun 14 2022, 2:37 AM
n-omer marked 2 inline comments as done.

Replace undef with poison.

n-omer updated this revision to Diff 436751.Jun 14 2022, 5:42 AM

Update RUN lines to fix failing builds and add new variable argument test to SLP.

RKSimon accepted this revision.Jun 14 2022, 5:58 AM

LGTM

This revision is now accepted and ready to land.Jun 14 2022, 5:58 AM
This revision was landed with ongoing or failed builds.Jun 15 2022, 3:14 AM
This revision was automatically updated to reflect the committed changes.