This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Simplify MOVMSK patterns based on comparison
ClosedPublic

Authored by RKSimon on Jun 4 2020, 8:42 AM.

Details

Summary

An initial patch adding combineSetCCMOVMSK to simplify MOVMSK and its vector input based on the comparison of the MOVMSK result.

This first stage just adds support for some simple MOVMSK(PACKSSBW()) cases where we remove the PACKSS if we're comparing ne/eq zero (any_of patterns), allowing us to directly compare against the v8i16 source vector(s) bitcasted to v16i8, with suitable masking to take into account of which signbits are valid.

Future combines could peek through further PACKSS, target shuffles, handle all_of patterns (ne/eq -1), optimize to a PTEST op, etc.

Diff Detail

Event Timeline

RKSimon created this revision.Jun 4 2020, 8:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 4 2020, 8:42 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
This revision is now accepted and ready to land.Jun 4 2020, 12:02 PM
This revision was automatically updated to reflect the committed changes.