Description[turbofan] Propagate minus-zero truncation in representation inference.
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}
Committed: https://chromium.googlesource.com/v8/v8/+/18f169d46cb4602fe3ee92900501aaf469c76000
Patch Set 1 #
Total comments: 4
Patch Set 2 : Address reviewer comments #
Messages
Total messages: 15 (9 generated)
|