Implement some of fold_binary_op_with_conditional_arg in match.pd
The following allows (c != 0 ? 0 : 100) != 0 to be simplified as
c != 0 as fold_binary_op_with_conditional_arg would have done
via forwprop and GENERIC folding. Likewise it allows to combine
(a != 0) != 0 directly via match.pd instead of only via
forwprop and again fold_binary_op_with_conditional_arg.
The patterns do not fully implement all cases of
fold_binary_op_with_conditional_arg, some aspects like
"any of the operands simplify" cannot currently be expressed.
2022-05-11 Richard Biener <rguenther@suse.de>
* generic-match-head.cc: Include tree-eh.h.
* match.pd ((cond ...) cmp X): New simplification inspired
by fold_binary_op_with_conditional_arg.
(eq/ne (cmp ...) true/false): Likewise.