[PATCH] D112276: [InstCombine] Fold `(c & ~(a | b)) | (b & ~(a | c))` to `~a & (b ^ c)`

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 08:18:15 PDT 2021


anton-afanasyev added a comment.

In D112276#3084283 <https://reviews.llvm.org/D112276#3084283>, @spatel wrote:

> We do have -aggressive-instcombine for housing rare/large pattern-matching, so that is another option for minimizing compile-time impact. That pass is currently only enabled at -O3, but there is some work/motivation to enable that at -O2 as well ( cc @anton-afanasyev ).

Yes, I'm going to start discussion on enabling AIC at -O2 after it stabilizes (there are several issues unveiled by AIC changes). But the main motivation is that AIC isn't heavier than IC for now. InstCombine iterates linear pattern-matching while AIC does DFS on small DAGs. Current AIC was splitted out from IC itself and contains only `TruncInstCombine` for now, processing trunc-dominated DAGs.

If we are talking about including boolean logic solver to AIC, the main question is its compile-time impact therefore. At present, IC and AIC are separated as "linear" and "non-linear", but "-O2" vs "-O3" criteria may be more appropriate.


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

https://reviews.llvm.org/D112276



More information about the llvm-commits mailing list