[X86][SSE] Remove unnecessary bit-and in pshufb vector ctlz (PR39703)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 19 Nov 2018 18:40:59 +0000 (18:40 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 19 Nov 2018 18:40:59 +0000 (18:40 +0000)
commitc4861ab170f004237fbb9015d2a1878695773566
tree757c19d0ed4da86fe2e5c2be1a675d57b3a17c33
parent5a47dc607e227fba76a572d79260fb176eb023c3
[X86][SSE] Remove unnecessary bit-and in pshufb vector ctlz (PR39703)

SSE PSHUFB vector ctlz lowering works at the i4 nibble level. As detailed in PR39703, we were masking the lower nibble off but we only actually use it in the case where the upper nibble is known to be zero, making it safe to remove the mask and save an instruction.

Differential Revision: https://reviews.llvm.org/D54707

llvm-svn: 347242
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/combine-srl.ll
llvm/test/CodeGen/X86/prefer-avx256-lzcnt.ll
llvm/test/CodeGen/X86/vector-lzcnt-128.ll
llvm/test/CodeGen/X86/vector-lzcnt-256.ll
llvm/test/CodeGen/X86/vector-lzcnt-512.ll