https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100958
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:1dd154f6407658d46faa4d21bfec04fc2551506a commit r14-338-g1dd154f6407658d46faa4d21bfec04fc2551506a Author: Andrew Pinski <apin...@marvell.com> Date: Tue Apr 25 19:46:40 2023 -0700 PHIOPT: Move two_value_replacement to match.pd This patch converts two_value_replacement function into a match.pd pattern. It is a direct translation with only one minor change, does not check for the {0,+-1} case as that is handled before in match.pd so there is no reason to do the extra check for it. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/100958 * tree-ssa-phiopt.cc (two_value_replacement): Remove. (pass_phiopt::execute): Don't call two_value_replacement. * match.pd (a !=/== CST1 ? CST2 : CST3): Add pattern to handle what two_value_replacement did.