[all-commits] [llvm/llvm-project] cbbcb1: [RISCV] Refine the (mul (zext.w X), C) -> mulhu is...

Craig Topper via All-commits all-commits at lists.llvm.org
Sat Jan 28 00:23:05 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cbbcb10e084e9ef93f37fdf8526b0ab20200eb46
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-01-28 (Sat, 28 Jan 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
    M llvm/test/CodeGen/RISCV/div-by-constant.ll

  Log Message:
  [RISCV] Refine the (mul (zext.w X), C) -> mulhu isel heuristic.

We try to shift both X and C left by 32 to replace the zext.w
with a SLLI and use mulhu. If C is already a simm32, this likely
makes a constant that is more expensive to materialize.

More information about the All-commits mailing list