• mtrofin's avatar
    [turbofan] Deferred blocks splintering. · 5d954d65
    mtrofin authored
    This change encompasses what is necessary to enable stack checks in loops without suffering large regressions.
    
    Primarily, it consists of a new mechanism for dealing with deferred blocks by "splintering", rather than splitting, inside deferred blocks.
    
    My initial change was splitting along deferred block boundaries, but the regression introduced by stackchecks wasn't resolved conclusively. After investigation, it appears that just splitting ranges along cold block boundaries leads to a greater opportunity for moves on the hot path, hence the suboptimal outcome.
    
    The alternative "splinters" ranges rather than splitting them. While splitting creates 2 ranges and links them (parent-child), in contrast, splintering creates a new independent range with no parent-child relation to the original. The original range appears as if it has a liveness hole in the place of the splintered one. All thus obtained ranges are then register allocated with no change to the register allocator.
    
    The splinters (cold blocks) do not conflict with the hot path ranges, by construction. The hot path ones have less pressure to split, because we remove a source of conflicts. After allocation, we merge the splinters back to their original ranges and continue the pipeline. We leverage the previous changes made for deferred blocks (determining where to spill, for example).
    
    Review URL: https://codereview.chromium.org/1305393003
    
    Cr-Commit-Position: refs/heads/master@{#30357}
    5d954d65
register-allocator.h 34.2 KB