[X86] Match (cmp (and (shr X, C), mask), 0) to BEXTR+TEST.
authorCraig Topper <craig.topper@intel.com>
Tue, 16 Oct 2018 22:29:36 +0000 (22:29 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 16 Oct 2018 22:29:36 +0000 (22:29 +0000)
commite0a992918b54c422119fa2b8046cdf8b9b327b38
tree292f9733658f1d37d118f28d90e07fb7b6b38b64
parentaf67fe6aef3b7afa148b3d9b1fea172605a153de
[X86] Match (cmp (and (shr X, C), mask), 0) to BEXTR+TEST.

Without this we match the CMP+AND to a TEST and then match the SHR separately. I'm trusting analyzeCompare to remove the TEST during the peephole pass. Otherwise we need to check the flag users to see if they only use the Z flag.

This recovers a case lost by r344270.

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

llvm-svn: 344649
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/tbm_patterns.ll