[X86] Allow KORTEST instruction to be used for testing if a mask is all ones
authorCraig Topper <craig.topper@intel.com>
Thu, 8 Feb 2018 07:54:16 +0000 (07:54 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 8 Feb 2018 07:54:16 +0000 (07:54 +0000)
commit93505707b6d3ec117e555c5a48adc2cc56470e38
treecba43d0312a42a16177ecf0b1cdd7d43c042adba
parentf5465f98d2f210c20c94be9fe4edb9e60243ab80
[X86] Allow KORTEST instruction to be used for testing if a mask is all ones

The KTEST instruction sets the C flag if the result of anding both operands together is all 1s. We can use this to lower (icmp eq/ne (bitcast (vXi1 X), -1)

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

llvm-svn: 324577
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx512-mask-op.ll
llvm/test/CodeGen/X86/avx512-schedule.ll
llvm/test/CodeGen/X86/setcc-lowering.ll