This is an archive of the discontinued LLVM Phabricator instance.

[TTI] Add SK_Splice shuffle mask detection and X86 costs
ClosedPublic

Authored by RKSimon on Aug 22 2022, 6:09 AM.

Details

Summary

Enables fixed sized vectors to detect SK_Splice shuffle patterns and provides basic X86 cost support

Diff Detail

Event Timeline

RKSimon created this revision.Aug 22 2022, 6:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 6:09 AM
RKSimon requested review of this revision.Aug 22 2022, 6:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 6:09 AM

I can't speak to the X86 costs, but the isSpliceMask changes look good. Do we want to use it in improveShuffleKindFromMask too?

I can't speak to the X86 costs, but the isSpliceMask changes look good. Do we want to use it in improveShuffleKindFromMask too?

Yes, I can add it now although I'm not sure if we'll see any test coverage changes

RKSimon updated this revision to Diff 454769.Aug 23 2022, 3:32 AM

Add improveShuffleKindFromMask recognition of SK_Splice patterns

RKSimon updated this revision to Diff 454819.Aug 23 2022, 6:41 AM

Rename non-static ShuffleVectorInst::isSpliceMask -> ShuffleVectorInst::isSplice to match other implementations

fhahn added inline comments.Aug 23 2022, 6:59 AM
llvm/lib/IR/Instructions.cpp
2309

Do we also need to check if we are extracting exactly half the original elements here? I see isSplice checks the length isn't changed, but other calls of isSpliceMask don't seem to do it (in BasicTTI)

RKSimon added inline comments.Aug 23 2022, 7:10 AM
llvm/lib/IR/Instructions.cpp
2309

None of the static shuffle kind matches know the width of the input types - they assume they match Mask.size()

dmgreen accepted this revision.Aug 23 2022, 11:20 AM

LGTM Thanks

This revision is now accepted and ready to land.Aug 23 2022, 11:20 AM
This revision was landed with ongoing or failed builds.Aug 23 2022, 12:08 PM
This revision was automatically updated to reflect the committed changes.
mark.zhuang removed a subscriber: mark.zhuang.