[PATCH] D52121: [X86] Fold (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C))

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 14 13:19:35 PDT 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.

MOVMSK only care about the sign bit so we don't need the setcc to fill the whole element with 0s/1s. We can just shift the bit we're looking for into the sign bit. This saves a constant pool load.

Inspired by PR38840.


https://reviews.llvm.org/D52121

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52121.165579.patch
Type: text/x-patch
Size: 35352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180914/948ac8b9/attachment.bin>


More information about the llvm-commits mailing list