[PATCH] D135441: [AArch64][SelectionDAG] Lower multiplication by a constant to shl+add+shl+add

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 04:44:03 PDT 2022


Allen created this revision.
Allen added reviewers: spatel, dmgreen, efriedma.
Herald added subscribers: ecnelises, hiraditya, kristof.beyls.
Herald added a project: All.
Allen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


https://reviews.llvm.org/D135441

Files:
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/test/CodeGen/AArch64/arm64-popcnt.ll
  llvm/test/CodeGen/AArch64/memset-inline.ll
  llvm/test/CodeGen/AArch64/mul_pow2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135441.466040.patch
Type: text/x-patch
Size: 9268 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221007/c42f515d/attachment-0001.bin>


More information about the llvm-commits mailing list