[PATCH] D84309: [InstCombine] Preserve FMA opportunities when combining PHI nodes

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 04:52:22 PDT 2020


nemanjai created this revision.
nemanjai added reviewers: majnemer, spatel, efriedma, craig.topper, PowerPC.
Herald added subscribers: wuzish, hiraditya.
Herald added a project: LLVM.

We currently unconditionally combine multiple `FAdd` instructions that feed a PHI into one. However, if at least some of those are fed by `FMul`'s and the instructions allow contraction, this takes away opportunities to produce FMA's.

This patch just adds a check for this situation and prevents combining if such a situation is encountered.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84309

Files:
  llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
  llvm/test/Transforms/InstCombine/phi-preserve-fmas.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84309.279767.patch
Type: text/x-patch
Size: 8926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200722/fe34b7e5/attachment-0001.bin>


More information about the llvm-commits mailing list