<commit_before># Memory block merging

Ongoing work.


## Debug environment variables

This is an overview of the available environment variables.  Most of
this is hopefully temporary.

  + Set `FUTHARK_DEBUG=1`: Print a lot of messy, unexplained debug
    information.
  + Set `FUTHARK_DEBUG_JSON=1`: Print whatever calculations are deemed
    important in machine-readable JSON lines, i.e. every line is valid
    JSON, but the output as a whole probably is not.
  + Set `IN_PLACE_LOWERING=0`: Disable in-place lowering.
  + Set `MEMORY_BLOCK_MERGING_COALESCING=1`: Enable the coalescing part
    of memory block merging.
  + Set `MEMORY_BLOCK_MERGING_REUSE=1`: Enable the reuse part of memory
    block merging.  This will always be run after the coalescing part if
    that is also enabled.


## Testing

The tests in `coalescing` expect to be run with only
`MEMORY_BLOCK_MERGING_COALESCING=1`.  Run `./test.sh` in the directory
to do so.

The tests in `reuse` (new name for "register allocation") expect to be
run with only `MEMORY_BLOCK_MERGING_REUSE=1`.  Run `./test.sh` in the
directory to do so.

The tests in `mix` (new name for "register allocation") expect to be run
with both `MEMORY_BLOCK_MERGING_COALESCING=1` and
`MEMORY_BLOCK_MERGING_REUSE=1`.  Run `./test.sh` in the directory to do
so.


## Benchmarking<commit_msg>Clarify memory block merging documentation.<commit_after># Memory block merging

Ongoing work.


## Debug environment variables

This is an overview of the available environment variables.  Most of
this is hopefully temporary.

  + Set `FUTHARK_DEBUG=1`: Print a lot of messy, unexplained debug
    information.
  + Set `FUTHARK_DEBUG_JSON=1`: Print whatever calculations are deemed
    important in machine-readable JSON lines, i.e. every line is valid
    JSON, but the output as a whole probably is not.
  + Set `IN_PLACE_LOWERING=0`: Disable in-place lowering.
  + Set `MEMORY_BLOCK_MERGING_COALESCING=1`: Enable the coalescing part
    of memory block merging.
  + Set `MEMORY_BLOCK_MERGING_REUSE=1`: Enable the reuse part of memory
    block merging (new name for "register allocation").  This will
    always be run after the coalescing part if that is also enabled.


## Testing

The tests in `coalescing` expect to be run with only
`MEMORY_BLOCK_MERGING_COALESCING=1`.  Run `./test.sh` in the directory
to do so.

The tests in `reuse` expect to be run with only
`MEMORY_BLOCK_MERGING_REUSE=1`.  Run `./test.sh` in the directory to do
so.

The tests in `mix` expect to be run with both
`MEMORY_BLOCK_MERGING_COALESCING=1` and `MEMORY_BLOCK_MERGING_REUSE=1`.
Run `./test.sh` in the directory to do so.


## Benchmarking
{'fraction_non_alphanumeric': 0.07255639097744361, 'fraction_numerical': 0.006766917293233083, 'mean_word_length': 4.1770428015564205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '902177', 'n_tokens_mistral': 899, 'n_tokens_neox': 835, 'n_words': 340}