match: Add simplification of `(a*zero_one_valued_p) & b` if `a & b` simplifies [PR119402]
This is a small reassociation for `a*bool & b` into `(a & b) * bool` checking if
`a & b` simplifies. Since it could be the case `b` is `~a` or `a` or something
else that might simplify when anding with `a`.
Note this fixes a regression for aarch64 where the cost of a multiply vs `&-` changed
in GCC 14 and can no longer optimize some cases at the RTL level.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/119402
gcc/ChangeLog:
* match.pd (`(a*zero_one_valued_p) & b`): New pattern.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/bitops-14.c: New test.
* gcc.dg/tree-ssa/bitops-15.c: New test.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>