[X86] Recognize standalone `(1 << nbits) - 1` pattern as bzhi
authorDanila Malyutin <dmalyutin@azul.com>
Wed, 19 Jul 2023 16:32:59 +0000 (19:32 +0300)
committerDanila Malyutin <dmalyutin@azul.com>
Thu, 20 Jul 2023 06:18:23 +0000 (09:18 +0300)
commit76fd79b9d537c5589f4e26dd7f5660d3c69d397a
tree9fc7c626cd80e108fb9a3e321d7df3cad2be88c5
parentc1013a6eee0ca9ebbfda03fcfdb3afb42ebf31ff
[X86] Recognize standalone `(1 << nbits) - 1` pattern as bzhi

This can be thought as a subcase of `x & ((1 << nbits) - 1)` where x == -1

Differential Revision: https://reviews.llvm.org/D155622
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/extract-bits.ll
llvm/test/CodeGen/X86/extract-lowbits.ll