This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Custom legalize BITREVERSE with Zbkb.
ClosedPublic

Authored by craig.topper on Jan 27 2022, 9:26 PM.

Details

Summary

With Zbkb, a bitreverse can be split into a rev8 and a brev8.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 27 2022, 9:26 PM
craig.topper requested review of this revision.Jan 27 2022, 9:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 9:26 PM
craig.topper added inline comments.Jan 27 2022, 9:30 PM
llvm/test/CodeGen/RISCV/bswap-bitreverse.ll
850

We need some more DAG combines to improve this.

llvm/test/CodeGen/RISCV/bswap-bitreverse.ll
850

We need some more DAG combines to improve this.

Will you continue to update this patch? or put it later

if put it later. what about add an // TODO: comment in the proper place.

Add FIXMEs to the test cases that need more work.

craig.topper added inline comments.Jan 27 2022, 10:52 PM
llvm/test/CodeGen/RISCV/bswap-bitreverse.ll
850

I'll do it another patch. It's likely going to need changes in a different file.

alextsao1999 added inline comments.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
285

zbkp -> zbkb?

Fix comment mistake

This revision is now accepted and ready to land.Jan 28 2022, 10:26 PM
This revision was landed with ongoing or failed builds.Jan 28 2022, 11:30 PM
This revision was automatically updated to reflect the committed changes.