OSDN Git Service

[X86] Fix InsertBitToMaskVector to only issue KSHIFTS of native size so that upper...
authorCraig Topper <craig.topper@intel.com>
Thu, 7 Dec 2017 20:10:04 +0000 (20:10 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 7 Dec 2017 20:10:04 +0000 (20:10 +0000)
commit0d51b6639742c76cdf72e2f7437e4b17a23d0d7b
tree9bce44b6c7cd0a94a3ae4d0db4988d7dd343fae1
parentdb4e07a1a3d33dc4917b4f50621db95ce06c0b1e
[X86] Fix InsertBitToMaskVector to only issue KSHIFTS of native size so that upper bits are properly zeroed.

There's no v2i1 or v4i1 kshift, and v8i1 is only supported with AVXDQ. Isel has fake patterns to extend these types to native shifts, but makes no guarantees about the value of any bits shifted in when shifting right.

This patch promotes the vector to a type that supports a native shift first and only allows inserting into the msb of a native sized shift.

I've constructed this in a way that doesn't do the promotion if we're going to fallback to using a xmm/ymm/zmm shuffle. I think I have a plan to remove the shuffle fall back entirely. In which case we this can be simplified, but I wanted to fix the correctness issue first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320081 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx512-insert-extract.ll
test/CodeGen/X86/avx512-mask-op.ll
test/CodeGen/X86/avx512vl-vec-masked-cmp.ll