This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add a DAG combine to transform (i8 (bitcast (v8i1 (extract_subvector (v16i1 X), 0)))) -> (i8 (trunc (i16 (bitcast (v16i1 X))))) on KNL target
ClosedPublic

Authored by craig.topper on Aug 20 2019, 12:08 PM.

Details

Summary

Without AVX512DQ we don't have KMOVB so we can't really copy 8-bits of a k-register to a GPR. We have to copy 16 bits instead. We do this even if the DAG copy is from v8i1->v16i1. If we detect the (i8 (bitcast (v8i1 (extract_subvector (v16i1 X), 0)))) we should rewrite the types to match the copy we do support. By doing this, we can help known bits to propagate without losing the upper 8 bits of the input to the extract_subvector. This allows some zero extends to be removed since we have an isel pattern to use kmovw for (zero_extend (i16 (bitcast (v16i1 X))).

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 20 2019, 12:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2019, 12:08 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Aug 20 2019, 12:23 PM

LGTM

llvm/test/CodeGen/X86/win32-eh-available-externally.ll
1 ↗(On Diff #216207)

drop this

This revision is now accepted and ready to land.Aug 20 2019, 12:23 PM
This revision was automatically updated to reflect the committed changes.