• Yolanda Chen's avatar
    [regalloc] Find optimal spilling position when spill range to end · 3fb75906
    Yolanda Chen authored
    When spill a range without register uses inside a loop, it is beneficial to spill the range ealier at the loop header to reduce memory moves from the back edges.
    
    The changes to FindOptimalSpillingPos are motivated as follows:
     - Change “next_use->pos() < pos” to “next_use->pos() <= pos”.
      The former version causes a crash of mksnapshot in debug build,
      because it is possible that a UsePosition at a split point gets split
      to the previous range according to “DetachAt”. For example, we
      have a live range with:
        UseIntervals: [1, 20[
        UsePosition: 10
      When split the live range at position 10, we will get:
        Range 0:0: UseInterval: [1, 10[
                   UsePosition: 10
        Range 0:1: UseInterval: [10, 20[
    
     - Change “NextUsePositionRegisterIsBenefitial” to
       “NextRegisterPosition”, because there’s always a
       “Define” use position at the loop header for those phis
       that do not require a register. Using the original check
       will hence not apply the optimization.
    
    
    Change-Id: I3b0bb3687ba572f1d3fc1892cefae7e866d99baa
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2094964Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
    Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
    Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
    Commit-Queue: Yolanda Chen <yolanda.chen@intel.com>
    Cr-Commit-Position: refs/heads/master@{#66806}
    3fb75906
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
OWNERS Loading commit data...
code-generator-impl.h Loading commit data...
code-generator.cc Loading commit data...
code-generator.h Loading commit data...
frame-elider.cc Loading commit data...
frame-elider.h Loading commit data...
gap-resolver.cc Loading commit data...
gap-resolver.h Loading commit data...
instruction-codes.h Loading commit data...
instruction-scheduler.cc Loading commit data...
instruction-scheduler.h Loading commit data...
instruction-selector-impl.h Loading commit data...
instruction-selector.cc Loading commit data...
instruction-selector.h Loading commit data...
instruction.cc Loading commit data...
instruction.h Loading commit data...
jump-threading.cc Loading commit data...
jump-threading.h Loading commit data...
live-range-separator.cc Loading commit data...
live-range-separator.h Loading commit data...
move-optimizer.cc Loading commit data...
move-optimizer.h Loading commit data...
register-allocator-verifier.cc Loading commit data...
register-allocator-verifier.h Loading commit data...
register-allocator.cc Loading commit data...
register-allocator.h Loading commit data...
unwinding-info-writer.h Loading commit data...