This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD
ClosedPublic

Authored by benshi001 on Jul 14 2021, 7:39 PM.

Details

Summary

These tests will show the following optimization by future patches.

(mul x, 11) -> (SH1ADD (SH2ADD x, x), x)
(mul x, 19) -> (SH1ADD (SH3ADD x, x), x)
(mul x, 13) -> (SH2ADD (SH1ADD x, x), x)
(mul x, 21) -> (SH2ADD (SH2ADD x, x), x)
(mul x, 37) -> (SH2ADD (SH3ADD x, x), x)
(mul x, 25) -> (SH3ADD (SH1ADD x, x), x)
(mul x, 41) -> (SH3ADD (SH2ADD x, x), x)
(mul x, 73) -> (SH3ADD (SH3ADD x, x), x)

Diff Detail

Event Timeline

benshi001 created this revision.Jul 14 2021, 7:39 PM
benshi001 requested review of this revision.Jul 14 2021, 7:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2021, 7:39 PM

Ping! I saw the similar optimization of mul with const on x86. So can the same be added to riscv ?

This revision is now accepted and ready to land.Jul 20 2021, 6:46 PM
This revision was landed with ongoing or failed builds.Jul 20 2021, 7:17 PM
This revision was automatically updated to reflect the committed changes.