[all-commits] [llvm/llvm-project] 4a549b: [AArch64] Lower multiplication by a negative const...

Allen via All-commits all-commits at lists.llvm.org
Sat Oct 1 06:29:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a549be9c3677c75c3ad2c8881a46fb59e245823
      https://github.com/llvm/llvm-project/commit/4a549be9c3677c75c3ad2c8881a46fb59e245823
  Author: zhongyunde <zhongyunde at huawei.com>
  Date:   2022-10-01 (Sat, 01 Oct 2022)

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

  Log Message:
  -----------
  [AArch64] Lower multiplication by a negative constant to shl+sub+shl

Change the costmodel to lower a = b * C where C = -(2^n - 2^m) to
            lsl     w8, w0, m
            sub     w0, w8, w0, lsl n
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D134934




More information about the All-commits mailing list