diff options
author | Roger Sayle <roger@nextmovesoftware.com> | 2021-08-24 03:04:48 +0100 |
---|---|---|
committer | Roger Sayle <roger@nextmovesoftware.com> | 2021-08-24 03:04:48 +0100 |
commit | f8977166135de09fe36a3b57cc11daa67587604e (patch) | |
tree | 38b0be70e64dfa796cacd5e4a469513785d38647 /libgcc | |
parent | 78fa5112b4c2dcd94b78ee79baddebbf14d6ad98 (diff) | |
download | gcc-f8977166135de09fe36a3b57cc11daa67587604e.zip gcc-f8977166135de09fe36a3b57cc11daa67587604e.tar.gz gcc-f8977166135de09fe36a3b57cc11daa67587604e.tar.bz2 |
Tweak -Os costs for scalar-to-vector pass.
Back in June I briefly mentioned in one of my gcc-patches posts that
a change that should have always reduced code size, would mysteriously
occasionally result in slightly larger code (according to CSiBE):
https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573233.html
Investigating further, the cause turns out to be that x86_64's
scalar-to-vector (stv) pass is relying on poor estimates of the size
costs/benefits. This patch tweaks the backend's compute_convert_gain
method to provide slightly more accurate values when compiling with
-Os. Compilation without -Os is (should be) unaffected. And for
completeness, I'll mention that the stv pass is a net win for code
size so it's much better to improve its heuristics than simply gate
the pass on !optimize_for_size.
The net effect of this change is to save 1399 bytes on the CSiBE
code size benchmark when compiling with -Os.
2021-08-24 Roger Sayle <roger@nextmovesoftware.com>
Richard Biener <rguenther@suse.de>
gcc/ChangeLog
* config/i386/i386-features.c (compute_convert_gain): Provide
more accurate values for CONST_INT, when optimizing for size.
* config/i386/i386.c (COSTS_N_BYTES): Move definition from here...
* config/i386/i386.h (COSTS_N_BYTES): to here.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions