• Benedikt Meurer's avatar
    [turbofan] Improve CheckedInt32Mod lowering. · 35974e2d
    Benedikt Meurer authored
    The CheckedInt32Mod lowering in the EffectControlLinearizer wasn't
    playing well with subsequent optimizations in the MachineOperatorReducer
    especially due to the use of Int32Mod, which introduces another (floating)
    diamond in the MachineOperatorReducer. Switching to Uint32Mod and explicit
    sign handling fixes the problem, plus we also do the mask trick in the
    case where the left hand side is negative now.
    
    With this change the performance on the benchmark mentioned in the bug
    report goes from
    
      console.timeEnd: binary, 1872.346000
      console.timeEnd: modulo, 5967.464000
      console.timeEnd: binary, 6006.789000
      console.timeEnd: modulo, 6293.496000
      console.timeEnd: binary, 5969.264000
      console.timeEnd: modulo, 6291.874000
    
    to
    
      console.timeEnd: binary, 1876.464000
      console.timeEnd: modulo, 5846.643000
      console.timeEnd: binary, 5962.545000
      console.timeEnd: modulo, 5972.639000
      console.timeEnd: binary, 5958.221000
      console.timeEnd: modulo, 5973.171000
    
    so even the peak performance of the modulus is now mostly the same as
    the binary bitwise and.
    
    Bug: v8:8069
    Change-Id: Iaf3828fc0f6c53352367e8bf6c42534f8b13bfb3
    Reviewed-on: https://chromium-review.googlesource.com/1180971Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#55211}
    35974e2d
Name
Last commit
Last update
benchmarks Loading commit data...
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...
.editorconfig 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...
ChangeLog Loading commit data...
DEPS 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...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...