[all-commits] [llvm/llvm-project] c8cf8b: [RISCV] Add some 32-bit ctlz and cttz idiom tests ...

Craig Topper via All-commits all-commits at lists.llvm.org
Wed Mar 24 21:56:00 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8cf8bc7ec3f8721953d4545812aaac5d21ee97a
      https://github.com/llvm/llvm-project/commit/c8cf8bc7ec3f8721953d4545812aaac5d21ee97a
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M llvm/test/CodeGen/RISCV/rv64zbb.ll

  Log Message:
  -----------
  [RISCV] Add some 32-bit ctlz and cttz idiom tests to rv64zbb.ll. NFC

This implements various idioms using ctlz/cttz like Log2, Log2_Ceil,
findFirstSetBit, etc.

Some of these demonstrate that we fail to use clzw because the
idiom breaks the isel patterns we use. The isel pattern we use
is (add (cttz (and X, 0xffffffff)), -32). Some of the idioms
cause the constant on the add to be different.




More information about the All-commits mailing list