[PATCH] PR/27733, synth_mult cache missing too much
Roger Sayle
roger@eyesopen.com
Thu Jun 8 15:03:00 GMT 2006
Hi Paolo,
On Thu, 8 Jun 2006, Paolo Bonzini wrote:
> 2006-06-08 Paolo Bonzini <bonzini@gnu.org>
>
> * expmed.c (struct alg_hash_entry): Fix type of field T
> to match synth_mult argument.
> (NUM_ALG_HASH_ENTRIES): Make it bigger for 64-bit HOST_WIDE_INT.
Wow! Superb catch! My plan for 4.3 was to avoid the generation of
RTL in tree-ssa-loop-ivopts.c:multiply_by_cost. We spend a lot of
time whilst deciding whether to hoist a multiplication out of a loop
choosing between low latency sequences that have the same "cost",
which is often easy to estimate based on bit-counts. This will get
worse with "multiply-by-11". However, it looks like you've found a
much more effective fix. It also explains why 64-bit targets, like
the alpha and hppa64, are so dramatically slower in synth_mult
than x86.
This patch is OK for mainline, and open release branches after a
suitable delay, once your bootstrapping and regression testing
complete. It might even be worth removing the #ifdef around the
NUM_ALG_HASH_ENTRIES definition and use 1031 for all targets.
We have much worse memory vs. compile-time tradeoffs in the compiler,
but I'll leave that argument to a follow-up posting should anyone
care to measure the cost/benefit on 32-bit platforms.
Chapeau and Kudos,
Roger
--
More information about the Gcc-patches
mailing list