match: Fix the `popcnt(a&b) + popcnt(a|b)` pattern for types [PR111913]
So this pattern needs a little help on the gimple side of things to know what the type popcount should be. For most builtins, the type is the same as the input but popcount and others are not. And when using it with another outer expression, genmatch needs some slight help to know that the return type was type rather than the argument type. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111913 gcc/ChangeLog: * match.pd (`popcount(X&Y) + popcount(X|Y)`): Add the resulting type for popcount. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/fold-popcount-1.c: New test. * gcc.dg/fold-popcount-8a.c: New test.
Loading
Please register or sign in to comment