[PATCH] D105796: [RISCV] Optimize multiplication in the zba extension with SH*ADD
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 12 07:09:00 PDT 2021
benshi001 marked an inline comment as done.
benshi001 added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoB.td:972
-let Predicates = [HasStdExtZba] in {
-def : Pat<(add (shl GPR:$rs1, (XLenVT 1)), non_imm12:$rs2),
- (SH1ADD GPR:$rs1, GPR:$rs2)>;
-def : Pat<(add (shl GPR:$rs1, (XLenVT 2)), non_imm12:$rs2),
- (SH2ADD GPR:$rs1, GPR:$rs2)>;
-def : Pat<(add (shl GPR:$rs1, (XLenVT 3)), non_imm12:$rs2),
- (SH3ADD GPR:$rs1, GPR:$rs2)>;
+def shadd : PatFrag<(ops node:$A, node:$B, node:$C, node:$D),
+ (add (add (shl node:$A, node:$B), (shl node:$A, node:$C)),
----------------
jrtc27 wrote:
> To be, shadd means something like `A << B + C`, not `A << B + A << C + D`
change the ParFrag's name to addshl.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105796/new/
https://reviews.llvm.org/D105796
More information about the llvm-commits
mailing list