• jarin's avatar
    [turbofan] Propagate minus-zero truncation in representation inference. · 18f169d4
    jarin authored
    This introduces a new truncation bit for truncation of minus-zero to zero.
    
    At the moment it is only used to handle the limit cases of deopt, such as the
    one in the Google maps workload (see simplified version below), where the -q
    (which is desugared to q * -1.0) currently deoptimizes because the result would
    produce minus zero. To handle this situation, we exploit the knowledge that
    righthand side of + cannot be -0, so even if lefthand side was -0, the result
    would still be 0 (so the + operation cannot distinguish between left hand side
    0 and -0).
    
    function f(q) {
      q -= 4;
      return (-q) + q;
    }
    
    f(10);
    f(10);
    %OptimizeFunctionOnNextCall(f);
    f(4);
    
    Review-Url: https://codereview.chromium.org/2734253002
    Cr-Commit-Position: refs/heads/master@{#43661}
    18f169d4
Name
Last commit
Last update
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
promises-aplus Loading commit data...
test262 Loading commit data...
unittests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
bot_default.gyp Loading commit data...
bot_default.isolate Loading commit data...
default.gyp Loading commit data...
default.isolate Loading commit data...
optimize_for_size.gyp Loading commit data...
optimize_for_size.isolate Loading commit data...
perf.gyp Loading commit data...
perf.isolate Loading commit data...