(a & b) ^ (~a | b) --> ~a
I was looking for a shortcut to reduce some of the complex logic folds that are currently up for review (D113216 and others in that stack), and I found this missing from instcombine/instsimplify.
There is a trade-off in putting it into instsimplify: because we can't create new values here, we need a strict 'not' op (no undef elements). Otherwise, the fold is not valid:
If this was in instcombine instead, we could create the proper 'not'. But having the fold here benefits other passes like GVN that use instsimplify as an analysis. If I'm seeing it correctly, this is enough to catch the cases in D113216 at -O2 without needing to add more pattern matching to instcombine.