Open JonPsson opened 5 years ago
(In particular, the number of spill slots is close in both cases so I am guessing/hoping this is just better placement.)
Is the spill cost bigger?
Essentially what I am wondering is whether we don't end up inserting more instructions but at cheaper places, which would be expected.
Extended Description
I found that the bzip2 benchmark regressed slightly when enabling subreg liveness due to one particular function (decompress). It seems that for some reason subreg liveness increases spilling instead of decreasing it:
./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./decompress.ll -o out.s --stats |& grep spill 1 regalloc - Number of rematerialized defs for spilling 9 regalloc - Number of spilled snippets 30 regalloc - Number of spill slots allocated 79 regalloc - Number of spilled live ranges 128 regalloc - Number of spills inserted 21 regalloc - Number of spills removed
./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./decompress.ll -o out.subr.s -systemz-subreg-liveness --stats |& grep spill 1 regalloc - Number of rematerialized defs for spilling 25 regalloc - Number of spilled snippets 27 regalloc - Number of spill slots allocated 168 regalloc - Number of spilled live ranges 173 regalloc - Number of spills inserted 149 regalloc - Number of spills removed
I made a reduced test case also from this file:
./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./tc_decompress_reduced.ll -o out.subr.s --stats |& grep spill 9 regalloc - Number of spill slots allocated 9 regalloc - Number of spilled live ranges 10 regalloc - Number of spills inserted
./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./tc_decompress_reduced.ll -o out.subr.s -systemz-subreg-liveness --stats |& grep spill 2 regalloc - Number of spilled snippets 11 regalloc - Number of spill slots allocated 11 regalloc - Number of spilled live ranges 13 regalloc - Number of spills inserted
I wonder if anyone might be able to help me in understanding why this happens?