This is an archive of the discontinued LLVM Phabricator instance.

[x86] eliminate even more sign-bit tests with vector select
ClosedPublic

Authored by spatel on Jun 12 2018, 7:50 AM.

Details

Summary

This shortcoming was noted in 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 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.

Diff Detail

Event Timeline

spatel created this revision.Jun 12 2018, 7:50 AM
spatel edited the summary of this revision. (Show Details)Jun 12 2018, 7:51 AM
RKSimon accepted this revision.Jun 13 2018, 4:36 AM

LGTM

This revision is now accepted and ready to land.Jun 13 2018, 4:36 AM
This revision was automatically updated to reflect the committed changes.