[PATCH] D81171: [X86][SSE] Simplify MOVMSK patterns based on comparison

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 08:45:10 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: craig.topper, spatel, andreadb, lebedev.ri.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81171

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/movmsk-cmp.ll
  llvm/test/CodeGen/X86/vector-compare-any_of.ll
  llvm/test/CodeGen/X86/vector-reduce-or-bool.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81171.268493.patch
Type: text/x-patch
Size: 20809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200604/88144ce0/attachment.bin>


More information about the llvm-commits mailing list