[PATCH] D48078: [x86] eliminate even more sign-bit tests with vector select

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 07:50:50 PDT 2018


spatel created this revision.
spatel added reviewers: RKSimon, craig.topper.
Herald added a subscriber: mcrosier.

This shortcoming was noted in https://reviews.llvm.org/D47330, and the test diffs show we already had other examples where we failed to fold to a SHRUNKBLEND:

/// Dynamic (non-constant condition) vector blend where only the sign bits
/// of the condition elements are used. This is used to enforce that the
/// condition mask is not valid for generic VSELECT optimizations.

This patch implements an idea from https://reviews.llvm.org/D48043 and would obsolete that patch because it catches more cases (notable the AVX1 case that was missed there). All we're doing is allowing the existing transform to fire more often by removing the post-legalize constraint. All of the relevant feature checks and other predicates are left as-is.


https://reviews.llvm.org/D48078

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/vsel-cmp-load.ll
  test/CodeGen/X86/vselect-pcmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48078.150942.patch
Type: text/x-patch
Size: 4249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180612/aa24221c/attachment.bin>


More information about the llvm-commits mailing list