This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add a DAG combine to turn (and (bitcast (vXi1 (concat_vectors (vYi1 setcc), undef,))), C) into (bitcast (vXi1 (concat_vectors (vYi1 setcc), zero,)))
ClosedPublic

Authored by craig.topper on Oct 18 2019, 4:09 PM.

Details

Summary

The legalization of v2i1->i2 or v4i1->i4 bitcasts followed by a setcc can create an and after the bitcast. If we're lucky enough that the input to the bitcast is a concat_vectors where the first operand is a setcc that can natively 0 all the upper bits of ak-register, then we should replace the other operands of the concat_vectors with zero in order to remove the AND.

With the AND removed we might be able to use a kortest on the result.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 18 2019, 4:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2019, 4:09 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Oct 28 2019, 5:07 AM

LGTM

This revision is now accepted and ready to land.Oct 28 2019, 5:07 AM
This revision was automatically updated to reflect the committed changes.