[PATCH] D114126: [PatternMatch] Create match method to track uses complexity. WIP.

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 11:58:47 PST 2021


rampitec added a comment.

In D114126#3140943 <https://reviews.llvm.org/D114126#3140943>, @nikic wrote:

> Taking a step back here, I want to ask: Is this solving some kind of real problem? I get the impression that use counting in InstCombine has moved beyond a practical consideration into the realm of religious dogma. I don't think there is much value in always making exotic, complex folds maximally applicable in multi-use scenarios, if doing so does not happen to be straightforward.

The example use is one application, the rest of the cases in the same function too. In fact in a later experiments I came across a situation when we do not perform reassociation in the demorganing bacause of the multi use issue and I have a hard time solving it without such accounting.

The other practical improvement is that it shall just simplify the accounting. It is easier to write something like `4 - UseComplexity` and omit all `m_OneUse` than counting unwrapped patterns.


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

https://reviews.llvm.org/D114126



More information about the llvm-commits mailing list