[X86] Use llvm::countr_zero instead of findFirstSet (NFC)
authorKazu Hirata <kazu@google.com>
Wed, 25 Jan 2023 07:26:08 +0000 (23:26 -0800)
committerKazu Hirata <kazu@google.com>
Wed, 25 Jan 2023 07:26:08 +0000 (23:26 -0800)
commit5d3462162e5a977dc0f6dacbcd227f47cfb1d884
tree71dd896e27ec51ae27591613ad8e6a0c1e95a24a
parent7bfdac0e6dd8d9d9a2f8546dedea5d7ffcb5317e
[X86] Use llvm::countr_zero instead of findFirstSet (NFC)

At the call site of findFirstSet, ZMask | (1 << DstIdx) always have
exactly 3 bits set, and they are all among the 4 least significant
bits, so (ZMask | (1 << DstIdx)) ^ 15 has exactly one bit set.  Since
the argument to findFirstSet is nonzero, we can safely switch to
llvm::countr_zero.
llvm/lib/Target/X86/X86InstrInfo.cpp