[all-commits] [llvm/llvm-project] 75358f: [AArch64] Lower multiplication by a constant int t...

Allen via All-commits all-commits at lists.llvm.org
Fri Oct 7 04:35:22 PDT 2022


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

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/test/CodeGen/AArch64/addimm-mulimm.ll
    M llvm/test/CodeGen/AArch64/machine-outliner-throw.ll
    M llvm/test/CodeGen/AArch64/madd-combiner.ll
    M llvm/test/CodeGen/AArch64/mul_pow2.ll
    M llvm/test/CodeGen/AArch64/srem-seteq.ll
    M llvm/test/CodeGen/AArch64/urem-seteq-nonzero.ll

  Log Message:
  -----------
  [AArch64] Lower multiplication by a constant int to madd

Lower a = b * C -1 into madd
  a) instcombine change b * C -1 --> b * C + (-1)
  b) machine-combine change b * C + (-1) --> madd

Assembler will transform the neg immedate of sub to add, see https://gcc.godbolt.org/z/cTcxePPf4
Fixes AArch64 part of https://github.com/llvm/llvm-project/issues/57255.

Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D134336




More information about the All-commits mailing list