[InstSimplify] Fold and/or using implied conditions
This adds two conjugated folds: * A | B -> B if A implies B (https://alive2.llvm.org/ce/z/R6GU4j) * A & B -> A if A implies B (https://alive2.llvm.org/ce/z/EGMqyy) If A and B are icmps themselves, we will usually fold this through other logic already (though the tests show a couple additional cases we previously missed). However, isImpliedCond() also supports A being of the form X & Y, which allows us to handle cases like (X & Y) | B where X implies B. This addresses the regression from D125398. Something that notably doesn't work yet is the (X | Y) & B case. This is due to an asymmetry in the isImpliedCondition() implementation that will have to be addressed separately. Differential Revision: https://reviews.llvm.org/D125530
Loading
Please sign in to comment