Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bytecodealliance/regalloc2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Amanieu/regalloc2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: better-merging
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 7 files changed
  • 1 contributor

Commits on Nov 24, 2023

  1. Move code related to splitting into a separate file

    No functional changes in this commit.
    Amanieu committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    01f2937 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2023

  1. Split bundle trimming into separate functions

    No functional change.
    Amanieu committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    7ce3489 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2023

  1. Try to place bundle split points outside loops

    Each split corresponds to a potential move instruction, so try as hard
    as possible to ensure these don't end up inside loops.
    
    The core logic is in the `adjust_split_point_forward` and
    `adjust_split_point_backward` functions which select a split point
    between two `ProgPoint`s which has the lowest possible loop depth.
    
    This is applied both when initially selecting a split point and when
    the edges of the split point are trimmed into the spill bundle.
    Amanieu committed Nov 26, 2023
    Configuration menu
    Copy the full SHA
    78b0cd4 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2023

  1. More refactoring and cleaning up of the split-related code

    The core functionality for splitting a bundle is now in the
    `split_bundle_at` function, which is called from various places.
    
    The only functional change in this commit is that the special handling
    for splitting a bundle with a fixed constraint from #165 now also takes
    loop depth into account.
    Amanieu committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    2539a0e View commit details
    Browse the repository at this point in the history
  2. Allow merging bundles with conflicting requirements

    There are several reasons to do this:
    * The original vreg bundle could already have conflicting requirements,
    which will cause all merge attempts to fail.
    * Failed merges introduce blockparam moves, which often happen in
    critical edge blocks. We want to avoid introducing move instructions in
    these blocks since they can often be eliminated entirely by jump
    threading when empty.
    * Conflicting requirements are already handled in the main
    bundle processing loop, which will split them at the first conflict
    point. This is a much better place at which to insert a move
    instruction.
    Amanieu committed Nov 27, 2023
    Configuration menu
    Copy the full SHA
    d82fec1 View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2023

  1. Take block priority into account when merging bundles

    Each merge eliminates the need for one move instruction in the final
    program. However a successful merge can cause a future merge to fail
    due to interference. Therefore we want to prioritize merges that have
    the highest impact:
    
    * We want to eliminate moves in loops that are executed many times.
    * We want to eliminate moves in split critical edge blocks, since it
      allows the entire block to be eliminated with jump threading.
    Amanieu committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    43910b0 View commit details
    Browse the repository at this point in the history
  2. Legalize bundles with conflicting requirements before processing

    A single vreg may have multiple conflicting uses, and
    furthemore conflicting uses may be introduced through bundle merging.
    Instead of resolving this in the main processing loop, pre-process all
    bundles to ensure they have satisfiable requirements.
    
    This is done in a single linear pass over each bundle, with split points
    introduced between each pair of conflicting uses.
    Amanieu committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    d0b8048 View commit details
    Browse the repository at this point in the history
Loading