[RISCV][test] Add tests for mul optimization in the zba extension with SH*ADD
authorBen Shi <powerman1st@163.com>
Wed, 21 Jul 2021 02:15:31 +0000 (10:15 +0800)
committerBen Shi <powerman1st@163.com>
Wed, 21 Jul 2021 02:16:56 +0000 (10:16 +0800)
commitd3738a09fb2587f584cec5faefda1f37743524a5
tree3aee7dc761261bf2fc91cc7686b08890bb5ea029
parenta4904ebb88e84bd86e1eda9c8e62eeb99273eada
[RISCV][test] Add tests for mul optimization in the zba extension with SH*ADD

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)

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D106031
llvm/test/CodeGen/RISCV/rv32zba.ll
llvm/test/CodeGen/RISCV/rv64zba.ll