diff options
author | Richard Biener <rguenther@suse.de> | 2023-02-03 11:11:15 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-05-03 12:21:30 +0200 |
commit | 2961db432ebb11d72c1438f44a59529a32b835cd (patch) | |
tree | b04b5b677e4114ae9ae87bf0e01fc2b782dc9996 /gcc/gimple-range.cc | |
parent | aeeec83b0e26edf43e1460d2e85f62cb9bc57439 (diff) | |
download | gcc-2961db432ebb11d72c1438f44a59529a32b835cd.zip gcc-2961db432ebb11d72c1438f44a59529a32b835cd.tar.gz gcc-2961db432ebb11d72c1438f44a59529a32b835cd.tar.bz2 |
Speedup cse_insn
When cse_insn prunes src{,_folded,_eqv_here,_related} with the
equivalence set in the *_same_value chain it also searches for
an equivalence to the destination of the instruction with
/* This is the same as the destination of the insns, we want
to prefer it. Copy it to src_related. The code below will
then give it a negative cost. */
if (GET_CODE (dest) == code && rtx_equal_p (p->exp, dest))
src_related = p->exp;
this picks up the last such equivalence and in particular any
later duplicate will be pruned by the preceeding
else if (src_related && GET_CODE (src_related) == code
&& rtx_equal_p (src_related, p->exp))
src_related = 0;
first. This wastes cycles doing extra rtx_equal_p checks. The
following instead searches for the first destination equivalence
separately in this loop and delays using src_related for it until
we are about to process that, avoiding another redundant rtx_equal_p
check.
I've came here because of a testcase with very large equivalence
lists and compile-time of cse_insn. The patch below doesn't speed
it up significantly since there's no equivalence on the destination.
In theory this opens the possibility to track dest_related
separately, avoiding the implicit pruning of any previous
value in src_related. As is the change should be a no-op for
code generation.
* cse.cc (cse_insn): Track an equivalence to the destination
separately and delay using src_related for it.
Diffstat (limited to 'gcc/gimple-range.cc')
0 files changed, 0 insertions, 0 deletions