diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-07-25 23:40:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-07-25 23:40:02 -0700 |
commit | 5d8d7480614be7c945e85baac1079fd49e4ca452 (patch) | |
tree | 6c747245ba67c3d5730e53214c805859d0a1574b /tests/018/path-test.tl | |
parent | 5b662ac8fde7b75dac7100375fa8956f8c72a73e (diff) | |
download | txr-5d8d7480614be7c945e85baac1079fd49e4ca452.tar.gz txr-5d8d7480614be7c945e85baac1079fd49e4ca452.tar.bz2 txr-5d8d7480614be7c945e85baac1079fd49e4ca452.zip |
compiler: compact D registers.
We now have some constant folding in the optimizer too, not
just in the front end compiler pass. This is leaving behind
dead D registers that are not referenced in the code.
Let's compact the D register table to close the gap.
* stdlib/compiler.tl (compiler get-dreg): In this function
we no longer check that we have allocated too many D
registers. We let the counter blow past %lev-size%.
Because this creates the fighting chance that the compaction
of D regs will reduce their number to %lev-size% or less.
By doing this, we allow code to be compilable that otherwise
would not be: code that allocates too many D regs which
are then optimized away.
(compiler compact-dregs): New function. Does all the work.
(compiler optimize): Compact the D regs at optimization
level 5 or higher.
(compile-toplevel): Check for an overflowing D reg count
here, after optimization.
* stdlib/optimize.tl (basic-blocks null-unused-data):
Here, we no longer have to do anything with the D registers.
Diffstat (limited to 'tests/018/path-test.tl')
0 files changed, 0 insertions, 0 deletions