HomePhabricator

[RISCV] Add TTI support for cpop with Zbb

Authored by craig.topper on Mar 24 2021, 10:53 AM.

Description

[RISCV] Add TTI support for cpop with Zbb

This will tell loop idiom recognize that it can make popcount loops countable
using the ctpop intrinsic. 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.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D99203

Details

Committed
craig.topperMar 24 2021, 10:58 AM
Reviewer
frasercrmck
Differential Revision
D99203: [RISCV] Add TTI support for cpop with Zbb
Parents
rGc5d53efeff5c: [test] Fix mix of variable use/def and regex match
Branches
Unknown
Tags
Unknown