• danno's avatar
    [turbofan] Fix phi-hinting problem with deferred blocks · afb0e7a4
    danno authored
    Previously, turbofan selected the gap use from first predecessor block when
    hinting a phi, unless that block was deferred, in which case the gap move from
    the first non-deferred predecessor block was chosen.
    
    This strategy didn't guarantee that an important invariant was maintained: the
    predecessor blocks chosen for hinting phis must preceed the phi's block in the
    rpo ordering. In most cases the strategy worked, since graphs generated by the
    AstGraphBuilder and existing stubs just happened to always generate schedules
    where this rpo ordering property for the first predecessor block, but it is
    quite possible to generate a code stub by hand that doesn't have this property
    (see included test case).
    
    After this CL, the allocator chooses either the the first non-deferred
    "rpo-preceeding" block to be the hinting block, or the first deferred
    "rpo-preceeding" block if that doesn't exist. In all previously-existing code,
    this behavior is the same as the original algorithm, but has the benefit of not
    failing in the register allocator in hand-crafted stubs where all the
    "rpo-preceeding" predecessors are all in deferred code.
    
    Review-Url: https://codereview.chromium.org/2030463003
    Cr-Commit-Position: refs/heads/master@{#36689}
    afb0e7a4
register-allocator.cc 128 KB