[all-commits] [llvm/llvm-project] 5d3462: [X86] Use llvm::countr_zero instead of findFirstSe...

kazutakahirata via All-commits all-commits at lists.llvm.org
Tue Jan 24 23:26:21 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d3462162e5a977dc0f6dacbcd227f47cfb1d884
      https://github.com/llvm/llvm-project/commit/5d3462162e5a977dc0f6dacbcd227f47cfb1d884
  Author: Kazu Hirata <kazu at google.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86InstrInfo.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list