[all-commits] [llvm/llvm-project] 9e5c5a: [RISCV] Optimize multiplication in the zba extensi...

Ben Shi via All-commits all-commits at lists.llvm.org
Wed Jul 21 19:29:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e5c5afc7ee24ace168418138c99dcede357cd50
      https://github.com/llvm/llvm-project/commit/9e5c5afc7ee24ace168418138c99dcede357cd50
  Author: Ben Shi <powerman1st at 163.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInstrInfoB.td
    M llvm/test/CodeGen/RISCV/rv32zba.ll
    M llvm/test/CodeGen/RISCV/rv64zba.ll

  Log Message:
  -----------
  [RISCV] Optimize multiplication in the zba extension with SH*ADD

This patch make the following optimization.

(mul x, 3 * power_of_2) -> (SLLI (SH1ADD x, x), bits)
(mul x, 5 * power_of_2) -> (SLLI (SH2ADD x, x), bits)
(mul x, 9 * power_of_2) -> (SLLI (SH3ADD x, x), bits)

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D105796




More information about the All-commits mailing list