[X86] ISEL (and X, <constant mask>) to BZHI when BMI2 is available.
authorLang Hames <lhames@gmail.com>
Mon, 21 Apr 2014 08:18:53 +0000 (08:18 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 21 Apr 2014 08:18:53 +0000 (08:18 +0000)
commitf69bb5e43c1427d23800e4e678a7c2f2088f0c88
treed0ff7069c0da0d27b4acfaf87c300004cb00711d
parenta21cd0433e7cde887b061ecac08c0de9f1cb8cb9
[X86] ISEL (and X, <constant mask>) to BZHI when BMI2 is available.

Generating BZHI in the variable mask case, i.e. (and X, (sub (shl 1, N), 1)),
was already supported, but we were missing the constant-mask case. This patch
fixes that.

<rdar://problem/15480077>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206738 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/bmi.ll