[PATCH] D156026: [InstCombine] Contracting x^2 + 2*x*y + y^2 to (x + y)^2 (integer)

Christoph Stiller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 22 18:47:56 PDT 2023


rainerzufalldererste updated this revision to Diff 543240.
rainerzufalldererste added a comment.
Herald added a subscriber: mstorsjo.

This includes only the positive tests, not completely sure which specific negative cases you had in mind.
I'm not entirely sure how to proceed with the single-use stuff and please let me know how things like those static functions, which are only used in one other function, are handled in LLVM/InstCombine. I've tried storing and reusing the `BinaryOp_match`es themselves, but that's apparently not possible. Would you prefer lambda functions or internal structs with static functions? Are you happy with relying on || short circuiting, or should that always be a separate if-else? Please let me know :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156026

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156026.543240.patch
Type: text/x-patch
Size: 8180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230723/3e6199dc/attachment.bin>


More information about the llvm-commits mailing list