]> granicus.if.org Git - llvm/commit
[X86] Add isel patterns for (i64 (zext (i8 (bitcast (v16i1 X))))) to use a KMOVW...
authorCraig Topper <craig.topper@intel.com>
Tue, 20 Aug 2019 19:43:48 +0000 (19:43 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 20 Aug 2019 19:43:48 +0000 (19:43 +0000)
commit351e42b86e441b99b73b32998f3297148ae69a03
tree563452b4c83f62cbb1a57cccf7050c9851bf5e11
parentf12390d9f5973a254b5b6c64a18880a704d10034
[X86] Add isel patterns for (i64 (zext (i8 (bitcast (v16i1 X))))) to use a KMOVW and a SUBREG_TO_REG. Similar for i8 and anyextend.

We already had patterns for extending to i32 to take advantage of
the impliciting zeroing of the upper bits of a 32-bit GPR that is
done by KMOVW/KMOVB. But the extend might be all the way to i64,
in which case the existing patterns would fail and we'd get a
KMOVW/B followed by a MOVZX. By adding patterns for i64 we can
use the fact that KMOVW/B zero the upper bits of the 32-bit GPR
and the normal property that 32-bit GPR writes implicitly zero the
upper 32-bits of the full 64-bit GPR.

The anyextend patterns are slightly different since we don't care
about the upper zeros. For the i8->i64 I think this avoids selecting
the anyextend as a MOVZX to prevent a partial register issue that
doesn't exist. For i16->i64 I think we would have just emitted an
insert_subreg on top of the extract_subreg that the vXi16->i16
bitcast pattern emits. The register coalescer or peephole pass
should combine those, but this saves that work and makes i8/16
consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369431 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrAVX512.td
test/CodeGen/X86/avx512vl-vec-masked-cmp.ll
test/CodeGen/X86/bitcast-setcc-128.ll
test/CodeGen/X86/kshift.ll