[PATCH] D134336: [AArch64] Lower multiplication by a constant int to madd

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 00:38:57 PDT 2022


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

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


https://reviews.llvm.org/D134336

Files:
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/AArch64/addimm-mulimm.ll
  llvm/test/CodeGen/AArch64/madd-combiner.ll
  llvm/test/CodeGen/AArch64/mul_pow2.ll
  llvm/test/CodeGen/AArch64/urem-seteq-nonzero.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134336.461804.patch
Type: text/x-patch
Size: 5659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220921/605ffe65/attachment.bin>


More information about the llvm-commits mailing list