• 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
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...