Commit 30d8255f authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[turbofan] Fix bounds check elimination for safe-integer-add.

Bug: chromium:760434
Change-Id: I95bcf33f334349de0a81f574ba64128b8e1b2ebd
Reviewed-on: https://chromium-review.googlesource.com/643192
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47723}
parent de046f5f
...@@ -42,6 +42,8 @@ Reduction RedundancyElimination::Reduce(Node* node) { ...@@ -42,6 +42,8 @@ Reduction RedundancyElimination::Reduce(Node* node) {
return ReduceCheckNode(node); return ReduceCheckNode(node);
case IrOpcode::kSpeculativeNumberAdd: case IrOpcode::kSpeculativeNumberAdd:
case IrOpcode::kSpeculativeNumberSubtract: case IrOpcode::kSpeculativeNumberSubtract:
case IrOpcode::kSpeculativeSafeIntegerAdd:
case IrOpcode::kSpeculativeSafeIntegerSubtract:
// For increments and decrements by a constant, try to learn from the last // For increments and decrements by a constant, try to learn from the last
// bounds check. // bounds check.
return TryReuseBoundsCheckForFirstInput(node); return TryReuseBoundsCheckForFirstInput(node);
...@@ -192,7 +194,9 @@ Reduction RedundancyElimination::ReduceCheckNode(Node* node) { ...@@ -192,7 +194,9 @@ Reduction RedundancyElimination::ReduceCheckNode(Node* node) {
Reduction RedundancyElimination::TryReuseBoundsCheckForFirstInput(Node* node) { Reduction RedundancyElimination::TryReuseBoundsCheckForFirstInput(Node* node) {
DCHECK(node->opcode() == IrOpcode::kSpeculativeNumberAdd || DCHECK(node->opcode() == IrOpcode::kSpeculativeNumberAdd ||
node->opcode() == IrOpcode::kSpeculativeNumberSubtract); node->opcode() == IrOpcode::kSpeculativeNumberSubtract ||
node->opcode() == IrOpcode::kSpeculativeSafeIntegerAdd ||
node->opcode() == IrOpcode::kSpeculativeSafeIntegerSubtract);
DCHECK_EQ(1, node->op()->EffectInputCount()); DCHECK_EQ(1, node->op()->EffectInputCount());
DCHECK_EQ(1, node->op()->EffectOutputCount()); DCHECK_EQ(1, node->op()->EffectOutputCount());
......
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