[PATCH] D117302: [InstCombine] Simplify addends reordering logic

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 10:57:02 PST 2022


spatel added a comment.

In D117302#3248938 <https://reviews.llvm.org/D117302#3248938>, @kovdan01 wrote:

> In D117302#3248293 <https://reviews.llvm.org/D117302#3248293>, @spatel wrote:
>
>> I already drafted a patch for it while looking at this, so I can clean that up and post it (the harder part is adding a pile of tests to check FMF propagation!).
>
> OK, please let me know if you need any help with that. If I understood you correctly, you plan to submit the patch by yourself. If so, could you please mention me in revision to keep me informed? Thanks!

Looking over the regression tests, I noticed that we would miss a factoring optimization if we canonicalize fsub->fadd more often. This would potentially be inverting a fold done by the reassociation pass:

  /// Recursively analyze an expression to build a list of instructions that have
  /// negative floating-point constant operands. The caller can then transform
  /// the list to create positive constants for better reassociation and CSE. 

...so I'm not sure if it is worth doing that transform generally.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117302



More information about the llvm-commits mailing list