https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114087

--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
So just a couple notes.

The more Oliver and I discuss this BZ, the more I suspect the right place to
tackle these problems is either in the match.pd framework or at the gimple->rtl
expansion phase.

I think writing the match.pd pattern is actually quite simple, but assessing
profitability would likely be hard since profitability is closely tied with the
ability to reduce the cost of constant synthesis and that's going to be highly
target dependent.  Additionally, the cases where we typically try to reduce
constants to improve code generation is done by bringing constants closer to
zero, but in this case we need to do something quite different.

If one was to try and tackle solely in the target files one might start with
Oliver's pattern as a bridge pattern, then add a pattern to combine the bridge
pattern with the equality test which in turn allows removal of an instruction.

Reply via email to