[PATCH] D80175: [PowerPC][MachineCombiner] reassociate fma to expose more ILP

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 21:08:52 PDT 2020


shchenz created this revision.
shchenz added reviewers: hfinkel, jsji, PowerPC.
Herald added subscribers: llvm-commits, steven.zhang, wuzish, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
shchenz edited the summary of this revision.

This patch tries to reassociate two patterns related to FMA to expose more ILP on PowerPC.

  // Pattern 1:
  //   A =  FADD X,  Y          (Leaf)
  //   B =  FMA  A,  M21,  M22  (Prev)
  //   C =  FMA  B,  M31,  M32  (Root)
  // -->
  //   A =  FMA  X,  M11,  M12
  //   B =  FMA  Y,  M21,  M22
  //   C =  FADD A,  B



  // Pattern 2:
  //   A =  FMA  X,  M11,  M12  (Leaf)
  //   B =  FMA  A,  M21,  M22  (Prev)
  //   C =  FMA  B,  M31,  M32  (Root)
  // -->
  //   A =  FMUL M11,  M12
  //   B =  FMA  X,  M21,  M22
  //   D =  FMA  A,  M31,  M32
  //   C =  FADD B,  D

breaking the dependency between A and B, allowing FMA to be executed in parallel (or back-to-back in a pipeline) instead of depending on each other.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80175

Files:
  llvm/include/llvm/CodeGen/MachineCombinerPattern.h
  llvm/lib/CodeGen/MachineCombiner.cpp
  llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
  llvm/lib/Target/PowerPC/PPCInstrInfo.h
  llvm/test/CodeGen/PowerPC/machine-combiner.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80175.264778.patch
Type: text/x-patch
Size: 21016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/3be2cfe3/attachment.bin>


More information about the llvm-commits mailing list