This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/16798] PowerPC - Opportunity to use recording form instruction.
- From: "nathan at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Nov 2004 12:25:46 -0000
- Subject: [Bug target/16798] PowerPC - Opportunity to use recording form instruction.
- References: <20040728170038.16798.steinmtz@us.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From nathan at gcc dot gnu dot org 2004-11-09 12:25 -------
The problem here is that combine only combines chains of instructions that have
no other uses of the intermediate results. In this case, the intermediate
result is stored into a global variable.
One solution would be to add a peephole, but that would only trigger when (a)
the shift and compare were adjacent, and (b) the compare used CR0. You'd also
need peepholers for all the instructions that can implicitly set CR0.
Really combine, which is a generic peepholer, needs some kind of templatizing on
the target machine. It currently functions by generating promising patterns and
then seeing if they exist. This is wasteful, in that it generates many
patterns that don't exist on the particular target, and it is blind in that it
doesn't spot any special cases the target might have (like this case). What's
needed is something like pre-reg-alloc peepholes. That of course would be a
large amount of work.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16798