[PATCH] D60625: [X86][SSE] Lower ICMP EQ(AND(X,C),C) -> SRA(SHL(X,LOG2(C)),BW-1) iff C is power-of-2.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 10:22:07 PDT 2019


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

This replaces the MOVMSK combine introduced at D52121 <https://reviews.llvm.org/D52121>/rL342326 <https://reviews.llvm.org/rL342326>

(movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C))

with the more general icmp lowering so it can pick up more cases through bitcasts - notably vXi8 cases which use vXi16 shifts+masks, this patch can remove the mask and use pcmpgtb(0,x) for the sra.


Repository:
  rL LLVM

https://reviews.llvm.org/D60625

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/movmsk-cmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60625.194916.patch
Type: text/x-patch
Size: 75464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190412/bc363abe/attachment.bin>


More information about the llvm-commits mailing list