diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-03-26 09:15:39 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-03-26 09:15:39 +0100 |
commit | 9708ca2be40399d6266bc85c99e085e3fe27a809 (patch) | |
tree | 1183632b5af7c65a8d9a9fd6a206dce2367f82e9 /gcc/var-tracking.c | |
parent | d21dff5b4fee51ae432143065bededfc763dc344 (diff) | |
download | gcc-9708ca2be40399d6266bc85c99e085e3fe27a809.zip gcc-9708ca2be40399d6266bc85c99e085e3fe27a809.tar.gz gcc-9708ca2be40399d6266bc85c99e085e3fe27a809.tar.bz2 |
var-tracking: Mark as sp based more VALUEs [PR92264]
With this simple patch, on i686-linux and x86_64-linux with -m32 (no change
for -m64), the find_base_term visited_vals.length () > 100 find_base_term
statistics changed (fbt is before this patch, fbt2 with this patch):
for k in '' '1$'; do for i in 32 64; do for j in fbt fbt2; do \
echo -n "$j $i $k "; LC_ALL=C grep ^$i.*"$k" $j | wc -l; done; done; done
fbt 32 5313355
fbt2 32 4229854
fbt 64 217523
fbt2 64 217523
fbt 32 1$ 1296
fbt2 32 1$ 407
fbt 64 1$ 0
fbt2 64 1$ 0
For frame_pointer_needed functions, we need to wait until we see the
fp_setter insn in the prologue at which point we disassociate the fp based
VALUEs from sp based VALUEs, but for !frame_pointer_needed functions,
we IMHO don't need to wait anything. For ACCUMULATE_OUTGOING_ARGS it isn't
IMHO worth doing anything, as there is a single sp adjustment and so there
is no risk of many thousands deep VALUE chains, but for
!ACCUMULATE_OUTGOING_ARGS the sp keeps changing constantly.
2020-03-26 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/92264
* var-tracking.c (add_stores): Call cselib_set_value_sp_based even
for sp based values in !frame_pointer_needed
&& !ACCUMULATE_OUTGOING_ARGS functions.
Diffstat (limited to 'gcc/var-tracking.c')
-rw-r--r-- | gcc/var-tracking.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 9984565..a9ca16b 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -6112,7 +6112,8 @@ add_stores (rtx loc, const_rtx expr, void *cuip) } if (loc == stack_pointer_rtx - && maybe_ne (hard_frame_pointer_adjustment, -1) + && (maybe_ne (hard_frame_pointer_adjustment, -1) + || (!frame_pointer_needed && !ACCUMULATE_OUTGOING_ARGS)) && preserve) cselib_set_value_sp_based (v); |