[PATCH] D158079: [InstCombine] Contracting x^2 + 2*x*y + y^2 to (x + y)^2 (float)

Christoph Stiller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 06:23:06 PDT 2023


rainerzufalldererste updated this revision to Diff 553450.
rainerzufalldererste marked an inline comment as done.
rainerzufalldererste added a comment.

How do you like this? I've made most of the template parameters default to the correct type to keep the invocation cleaner. Not sure if template specializing (only for `m_SpecificInt` / `m_SpecificFP` in the matcher function would be a good idea, as it'd make the invocation even cleaner, but the matcher a bit more complicated. However, considering that this little template monster is the replacement for slight code duplication, this may be our implementation of choice. Let me know what you think!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158079/new/

https://reviews.llvm.org/D158079

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/test/Transforms/InstCombine/fadd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158079.553450.patch
Type: text/x-patch
Size: 15285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230825/8138317a/attachment.bin>


More information about the llvm-commits mailing list