(X == C) && (Y Pred1 X) --> (X == C) && (Y Pred1 C) (X != C) || (Y Pred1 X) --> (X != C) || (Y Pred1 C) This cooperates/overlaps with D78430, but it is a more general transform that gets us most of the expected simplifications and several other improvements. http://volta.cs.utah.edu:8080/z/5gxjjc PR45618: https://bugs.llvm.org/show_bug.cgi?id=45618 Differential Revision: https://reviews.llvm.org/D78582
These are mostly replicated from D78430 (instsimplify). If we implement more general transforms for instcombine, then we probably don't need to add that complexity to instsimplify.