Commit 8b94aee5 authored by Benedikt Meurer's avatar Benedikt Meurer

[turbofan] Also remove minus zero check for rhs of CheckedInt32Add.

Similar to http://crrev.com/2410883003 we don't need to do a minus zero
check for the right hand side of CheckedInt32Add, because we already
know that the left hand side cannot be minus zero, and the only way that
addition can yield -0 is (-0) + (-0).

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/2431233003 .

Cr-Commit-Position: refs/heads/master@{#40421}
parent 2f3ca961
......@@ -1149,12 +1149,12 @@ class RepresentationSelector {
if (hint == NumberOperationHint::kSignedSmall ||
hint == NumberOperationHint::kSigned32) {
UseInfo left_use = CheckedUseInfoAsWord32FromHint(hint);
// For subtraction, the right hand side can be minus zero without
// resulting in minus zero, so we skip the check for it.
// For CheckedInt32Add and CheckedInt32Sub, we don't need to do
// a minus zero check for the right hand side, since we already
// know that the left hand side is a proper Signed32 value,
// potentially guarded by a check.
UseInfo right_use = CheckedUseInfoAsWord32FromHint(
hint, node->opcode() == IrOpcode::kSpeculativeNumberSubtract
? CheckForMinusZeroMode::kDontCheckForMinusZero
: CheckForMinusZeroMode::kCheckForMinusZero);
hint, CheckForMinusZeroMode::kDontCheckForMinusZero);
VisitBinop(node, left_use, right_use, MachineRepresentation::kWord32,
Type::Signed32());
if (lower()) ChangeToInt32OverflowOp(node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment