This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR81165] discount killed stmts when sizing blocks for threading
On Dec 7, 2017, Richard Biener <richard.guenther@gmail.com> wrote:
>> + FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
> SSA_OP_USE avoids walking virtual uses
.... and we don't want to walk those because we already know writes to
memory are not going to be dead anyway, I suppose.
>> + {
>> + tree t = USE_FROM_PTR (use_p);
>> + if (SSA_NAME_DEF_STMT (t)
> all SSA names have a definition statement
Oooh, it wasn't always like that! Nice!
> also use a temporary here.
*ack*
>> + && (gimple_code (SSA_NAME_DEF_STMT (t)) == GIMPLE_ASSIGN
> use ! gimple_has_side_effects (t), this will then also handle other
> kinds of stmts.
Hmm... Yeah, I guess we can indeed check for and regard as dead even
stmts that the record equivalence code won't deal with. Thanks, fixed.
> I wonder if for the handling of a larger threading path it wouldn't be useful to
> keep ssa_remaining_uses live and populated across processing of the threaded
> conditionals? OTOH it would probably require to track uses on the path vs.
> not on the path.
Possibly. Not sure. I wondered about that myself.
> PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS specifies the maximum number
> of statements and PHI nodes allowed in a block which is going to
> be duplicated for thread jumping purposes.
> should be adjusted though?
I guess not, we still abide by that, roughly, we just (as-if) remove
dead stmts and phi nodes from the block before counting them.
> Can you check what effect this patch has on code size of cc1?
text data bss dec hex filename
27300976 54440 1424480 28779896 1b72578 unpatched/stage2-gcc/cc1
27308728 54440 1424480 28787648 1b743c0 stage2-gcc/cc1
unpatched/, above, means its stage1 gcc was unpatched, whereas the other
(patched) stage1 gcc was patched with the updated patch I'm about to
post in response to Jeff; both stage2 compilers (x86_64-linux-gnu) were
built out of the same (unpatched) sources, so all the differences are
caused by the stage1 compiler alone.
Here's a list comparing the text sizes of all of the ELF executables in
the trees, sorted by absolute growth (unchanged entries are omitted)
240918 was 241126 delta -208 var -0.086262% ./stage2-gcc/build/genextract
306578 was 306626 delta -48 var -0.0156542% ./stage2-gcc/build/genrecog
90064 was 90112 delta -48 var -0.053267% ./stage1-x86_64-pc-linux-gnu/libgcc/libgcc_s.so.1
22315 was 22283 delta 32 var 0.143607% ./stage2-gcc/gcc-nm
22315 was 22283 delta 32 var 0.143607% ./stage2-gcc/gcc-ranlib
22347 was 22315 delta 32 var 0.143401% ./stage2-gcc/gcc-ar
330904 was 330864 delta 40 var 0.0120896% ./stage2-gcc/build/genautomata
173470 was 173406 delta 64 var 0.0369076% ./stage1-x86_64-pc-linux-gnu/libgomp/.libs/libgomp.so.1.0.0
184937 was 184865 delta 72 var 0.0389473% ./stage1-x86_64-pc-linux-gnu/32/libgomp/.libs/libgomp.so.1.0.0
1883670 was 1883558 delta 112 var 0.00594619% ./stage2-gcc/gnatbind
772045 was 771933 delta 112 var 0.014509% ./stage2-gcc/gcov
620621 was 620493 delta 128 var 0.0206288% ./stage2-gcc/gcov-dump
643293 was 643165 delta 128 var 0.0199016% ./stage2-gcc/gcov-tool
704480 was 704336 delta 144 var 0.0204448% ./stage2-gcc/collect2
503850 was 503690 delta 160 var 0.0317656% ./stage2-gcc/build/genmatch
73391 was 73215 delta 176 var 0.240388% ./stage2-gcc/liblto_plugin.so.0.0.0
73391 was 73215 delta 176 var 0.240388% ./stage2-lto-plugin/.libs/liblto_plugin.so.0.0.0
1051788 was 1051500 delta 288 var 0.0273894% ./stage2-gcc/lto-wrapper
179513 was 179113 delta 400 var 0.223323% ./stage2-gcc/build/gengtype
179513 was 179113 delta 400 var 0.223323% ./stage2-gcc/gengtype
1519561 was 1519053 delta 508 var 0.0334419% ./stage1-x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
1515402 was 1514758 delta 644 var 0.042515% ./stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
105197 was 104429 delta 768 var 0.735428% ./stage1-x86_64-pc-linux-gnu/32/libgcc/32/libgcc_s.so.1
1158594 was 1157690 delta 904 var 0.0780865% ./stage2-gcc/xgcc
1159570 was 1158666 delta 904 var 0.0780208% ./stage2-gcc/cpp
1161034 was 1160130 delta 904 var 0.0779223% ./stage2-gcc/gfortran
1161042 was 1160138 delta 904 var 0.0779218% ./stage2-gcc/xg++
1160914 was 1159898 delta 1016 var 0.0875939% ./stage2-gcc/gccgo
32065817 was 32059313 delta 6504 var 0.0202874% ./stage2-gcc/gnat1
26030665 was 26023281 delta 7384 var 0.0283746% ./stage2-gcc/lto1
27990493 was 27982845 delta 7648 var 0.027331% ./stage2-gcc/f951
27652456 was 27644736 delta 7720 var 0.0279258% ./stage2-gcc/cc1obj
27308728 was 27300976 delta 7752 var 0.0283946% ./stage2-gcc/cc1
28136819 was 28128855 delta 7964 var 0.0283126% ./stage2-gcc/go1
30244024 was 30235592 delta 8432 var 0.0278877% ./stage2-gcc/cc1objplus
29892916 was 29884436 delta 8480 var 0.028376% ./stage2-gcc/cc1plus
Here are top and bottom among the object files:
185713 was 186004 delta -291 var -0.156448% ./stage2-gcc/ada/decl.o
9492 was 9701 delta -209 var -2.15442% ./stage2-gcc/build/genextract.o
176153 was 176329 delta -176 var -0.0998134% ./stage2-gcc/ada/sem_util.o
165141 was 165301 delta -160 var -0.0967931% ./stage2-gcc/expr.o
21157 was 21317 delta -160 var -0.750575% ./stage2-gcc/ada/exp_unst.o
4958 was 5106 delta -148 var -2.89855% ./stage1-x86_64-pc-linux-gnu/libgcc/subtf3.o
4958 was 5106 delta -148 var -2.89855% ./stage1-x86_64-pc-linux-gnu/libgcc/subtf3_s.o
53964 was 54060 delta -96 var -0.17758% ./stage2-gcc/tree-ssa-alias.o
5145 was 5234 delta -89 var -1.70042% ./stage1-x86_64-pc-linux-gnu/libgcc/addtf3.o
5145 was 5234 delta -89 var -1.70042% ./stage1-x86_64-pc-linux-gnu/libgcc/addtf3_s.o
[...]
27643 was 27307 delta 336 var 1.23045% ./stage2-libiberty/pic/regex.o
28951 was 28567 delta 384 var 1.34421% ./stage2-libiberty/regex.o
174597 was 174110 delta 487 var 0.279708% ./stage2-gcc/omp-low.o
8957 was 8235 delta 722 var 8.76746% ./stage1-x86_64-pc-linux-gnu/32/libgcc/addtf3.o
8957 was 8235 delta 722 var 8.76746% ./stage1-x86_64-pc-linux-gnu/32/libgcc/addtf3_s.o
176102 was 175310 delta 792 var 0.451771% ./stage2-gcc/cp/typeck.o
38384 was 37568 delta 816 var 2.17206% ./stage1-x86_64-pc-linux-gnu/libgcc/bid64_div.o
64158 was 63308 delta 850 var 1.34264% ./stage1-x86_64-pc-linux-gnu/32/libgcc/bid64_div.o
73740 was 72852 delta 888 var 1.21891% ./stage1-x86_64-pc-linux-gnu/32/libgcc/bid128_fma.o
799019 was 796467 delta 2552 var 0.320415% ./stage2-gcc/i386.o
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer