[PATCH] D99203: [RISCV] Add TTI support for cpop with Zbb

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 23 11:29:00 PDT 2021


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

This will tell loop idiom recognize that it can convert popcount loops
to intrinsics. I didn't bother checking for illegal types. Type legalization
knows how to split a ctpop into multiple ctops added together. Assuming we only
receive reasonable integer bit widths, a few cpop instructions added together
is probably better than the loop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99203

Files:
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
  llvm/test/Transforms/LoopIdiom/RISCV/lit.local.cfg
  llvm/test/Transforms/LoopIdiom/RISCV/popcnt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99203.332742.patch
Type: text/x-patch
Size: 6333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210323/b2e1ebd6/attachment.bin>


More information about the llvm-commits mailing list