This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Improved target tuning in simplify-rtx.c
- From: Roger Sayle <roger at eyesopen dot com>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Jun 2004 16:03:13 -0600 (MDT)
- Subject: Re: [PATCH] Improved target tuning in simplify-rtx.c
On Mon, 14 Jun 2004, Eric Christopher wrote:
> I love it, but I'm curious about timing changes?
Alas, I've done no benchmarking myself. The one piece of code that I
know was transformed by these optimizations behaves the same before as
afterwards (i.e. "x+x" -> "x<<1" on Pentium4, has no multiplies and costs
4 before and has no multiplies and costs 4 afterwards). I can come up
with micro-benchmarks that show improvements, but on typical applications
I wouldn't be surprised if the results were in the noise.
However, if someone would like to try some timings with this patch, I'd
also be interested. I believe this is the correct way to go for more
of the RTL optimizers, and any performance degradations really indicate
a failing in the backend's rtx_costs rather than a conceptual problem
in the middle-end.
My next goal is to prevent the RTL optimizers from converting (x<<1)<<1
into x<<2 on Pentium4, which is actually twice as slow as the original!
One nice feature of using "rtx_cost" is that it still allows us to prefer
the single instruction x<<2 when optimizing for size with -Os.