This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Make more optimization for multiplication in the zba extension with SH*ADD.
AbandonedPublic

Authored by jacquesguan on Aug 23 2021, 6:12 AM.

Details

Summary

This patch make the following optimization.

(mul x, 2 + power_of_2) -> (SH1ADD x, (SLLI x, bits))
(mul x, 4 + power_of_2) -> (SH2ADD x, (SLLI x, bits))
(mul x, 8 + power_of_2) -> (SH3ADD x, (SLLI x, bits))

Diff Detail

Unit TestsFailed

Event Timeline

jacquesguan created this revision.Aug 23 2021, 6:12 AM
jacquesguan requested review of this revision.Aug 23 2021, 6:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2021, 6:12 AM
jrtc27 added inline comments.Aug 23 2021, 6:22 AM
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
1083

SH2ADD?

1086

SH3ADD?

Fix wrong instruction.

jacquesguan added inline comments.Aug 23 2021, 6:44 PM
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
1083

Thanks, fixed.

1086

Thanks, fixed.

jacquesguan abandoned this revision.Aug 29 2021, 8:06 PM