[PATCH] D59818: [x86] avoid cmov in movmsk reduction

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 06:55:09 PDT 2019


spatel created this revision.
spatel added reviewers: RKSimon, craig.topper.
Herald added subscribers: jdoerfert, hiraditya, mcrosier.
Herald added a project: LLVM.

This is probably the least important of our movmsk problems, but I'm starting at the bottom to reduce distractions.

We were creating a select_cc which bypasses the select and bitmask codegen optimizations that we have now. If we produce a compare+negate instead, we allow things like neg/sbb carry bit hacks, and in all cases we avoid a cmov. There's no partial register update danger in these sequences because we always produce the zero-register xor ahead of the 'set' if needed.

There seems to be a missing fold for sext of a bool bit here:

  negl %ecx
  movslq %ecx, %rax

...but that's an independent transform.


https://reviews.llvm.org/D59818

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/vector-compare-all_of.ll
  llvm/test/CodeGen/X86/vector-compare-any_of.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59818.192265.patch
Type: text/x-patch
Size: 38440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190326/bf5a85eb/attachment.bin>


More information about the llvm-commits mailing list