[all-commits] [llvm/llvm-project] 74c2d4: [AArch64][SelectionDAG] Lower multiplication by a ...

Allen via All-commits all-commits at lists.llvm.org
Thu Oct 20 09:37:34 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 74c2d4f6024c8f160871a2baa928d0b42415f183
      https://github.com/llvm/llvm-project/commit/74c2d4f6024c8f160871a2baa928d0b42415f183
  Author: zhongyunde <zhongyunde at huawei.com>
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/test/CodeGen/AArch64/mul_pow2.ll

  Log Message:
  -----------
  [AArch64][SelectionDAG] Lower multiplication by a constant to shl+add+shl+add

Change the costmodel to lower a = b * C where C = (1 + 2^m) * (1 + 2^n) to
      add   w8, w0, w0, lsl #m
      add   w0, w8, w8, lsl #n
Note: The latency can vary depending on the shirt amount

Reviewed By: efriedma, dmgreen
Differential Revision: https://reviews.llvm.org/D135441




More information about the All-commits mailing list