• 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
test-representation-change.cc 20.7 KB