[PATCH] D112268: [LegalizeTypes][RISCV][PowerPC] Expand CTLZ/CTTZ/CTPOP instead of promoting if they'll be expanded later.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 21 13:58:50 PDT 2021


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon, efriedma, frasercrmck.
Herald added subscribers: achieveartificialintelligence, vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, shchenz, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, nemanjai.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

Expanding these requires multiple constants. If we promote during type
legalization when they'll end up getting expanded in LegalizeDAG, we'll
end with larger constants. These constants may be harder to materialize.
For example, 64-bit constants on 64-bit RISCV are very expensive.

This is similar to what has already been done to BSWAP and BITREVERSE.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112268

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/test/CodeGen/PowerPC/popcnt-zext.ll
  llvm/test/CodeGen/RISCV/bswap-ctlz-cttz-ctpop.ll
  llvm/test/CodeGen/RISCV/rv64zbb.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112268.381382.patch
Type: text/x-patch
Size: 56208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211021/f9302e00/attachment-0001.bin>


More information about the llvm-commits mailing list