[PATCH] D113216: [InstCombine] (~(a | b) & c) | ~(a | b | c) -> ~(a | b)

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 13:05:44 PST 2021


rampitec abandoned this revision.
rampitec added a comment.

In D113216#3151315 <https://reviews.llvm.org/D113216#3151315>, @spatel wrote:

> As discussed in D114462 <https://reviews.llvm.org/D114462>, I noticed a pair of missing 'xor' simplifications based on these patterns, so I added those with:
> 892648b18a8c <https://reviews.llvm.org/rG892648b18a8cc3b8a08528112adfa74bdd432f8b>
> b326c058146f <https://reviews.llvm.org/rGb326c058146fbd5d89f7c8ce9fb932b3851200d7>
>
> So we probably want to add some or all of these tests under "test/Transforms/PhaseOrdering" to see if these are reduced with the default -O2/-O3 pipelines or some combination of specific passes (-reassociate, -gvn, -instcombine).

I have moved these tests into new Transforms/PhaseOrdering/reassociate-gvn-bdce.ll. That is a combination of -reassociate -gvn -bdce which now handles it.

> This patch could also be moved to -instsimplify if it is still needed. But I think that would really be covering up a shortcoming of -reassociate. That pass should find the common 'or' or 'and' value in these patterns?

I am dropping it, these cases are already handled by your D114462 <https://reviews.llvm.org/D114462>. The case `(~A & ~B & C)  | ~(A | B | C) --> ~(A | B)` is not, but just reassociation will not help, it needs to be combined with demorganing and use analysis. It will need a separate patch, however.


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

https://reviews.llvm.org/D113216



More information about the llvm-commits mailing list