[RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD
authorBen Shi <powerman1st@163.com>
Fri, 9 Jul 2021 01:48:23 +0000 (09:48 +0800)
committerBen Shi <powerman1st@163.com>
Fri, 9 Jul 2021 01:48:23 +0000 (09:48 +0800)
commited102ce20a5f5ddf388bc71217228b756e2f5fe3
treea8137563663c468cf7b3b4b97593ef49c40a35d2
parent38451fa1789cd42fe4c1ed8ac519620892e4634d
[RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD

This patch will show the following optimization by future patches.

(mul x imm) -> (SH1ADD x, (SLLI x, bits)) when imm = 2^n + 2.
(mul x imm) -> (SH2ADD x, (SLLI x, bits)) when imm = 2^n + 4.
(mul x imm) -> (SH3ADD x, (SLLI x, bits)) when imm = 2^n + 8.

Reviewed By: craig.topper

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