[RISCV] Add some 32-bit ctlz and cttz idiom tests to rv64zbb.ll. NFC
authorCraig Topper <craig.topper@sifive.com>
Thu, 25 Mar 2021 04:38:53 +0000 (21:38 -0700)
committerCraig Topper <craig.topper@sifive.com>
Thu, 25 Mar 2021 04:52:48 +0000 (21:52 -0700)
commitc8cf8bc7ec3f8721953d4545812aaac5d21ee97a
tree28b9e53a54c5b4d10681fed63f5a4941e0a58573
parent973ddb7d6e96e744a785ba64c065b592987a005f
[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.
llvm/test/CodeGen/RISCV/rv64zbb.ll