[PATCH] D124564: [MachineCombiner, AArch64] Add a new pattern A-(B+C) => (A-B)-C to reduce latency

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 15:29:24 PDT 2022


Carrot created this revision.
Carrot added a reviewer: Gerolf.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
Carrot requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add a new pattern A - (B + C)  ==>  (A - B) - C  to give machine combiner a chance to evaluate which instruction sequence has lower latency.

This patch also contains improvement to MachineCombiner's cost model, so its computation of critical path  length is more precise.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124564

Files:
  llvm/include/llvm/CodeGen/MachineCombinerPattern.h
  llvm/lib/CodeGen/MachineCombiner.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/AArch64/aarch64-combine-fmul-fsub.mir
  llvm/test/CodeGen/AArch64/addsub_ext.ll
  llvm/test/CodeGen/AArch64/arm64-fma-combines.ll
  llvm/test/CodeGen/AArch64/fadd-combines.ll
  llvm/test/CodeGen/AArch64/i128-math.ll
  llvm/test/CodeGen/AArch64/machine-combiner-madd.ll
  llvm/test/CodeGen/AArch64/machine-combiner-subadd.ll
  llvm/test/CodeGen/AArch64/madd-combiner.ll
  llvm/test/CodeGen/AArch64/madd-lohi.ll
  llvm/test/CodeGen/AArch64/mul-lohi.ll
  llvm/test/CodeGen/AArch64/srem-seteq-vec-nonsplat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124564.425626.patch
Type: text/x-patch
Size: 29952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220427/ebca5374/attachment.bin>


More information about the llvm-commits mailing list