Commit cb0de11d authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Eliminate unnecessary hole to undefined conversion.

Add simplified operator reduction rule that reduces

  CheckedTaggedSignedToInt32(ConvertTaggedHoleToUndefined(x))

to

  CheckedTaggedSignedToInt32(x)

which avoids the unnecessary hole to undefined conversion, as the check
operation will fail equally on either hole or undefined.

BUG=v8:5267
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2384453002
Cr-Commit-Position: refs/heads/master@{#39863}
parent 6ca8c11f
......@@ -126,6 +126,14 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
}
break;
}
case IrOpcode::kCheckedTaggedSignedToInt32: {
NodeMatcher m(node->InputAt(0));
if (m.IsConvertTaggedHoleToUndefined()) {
node->ReplaceInput(0, m.InputAt(0));
return Changed(node);
}
break;
}
case IrOpcode::kCheckIf: {
HeapObjectMatcher m(node->InputAt(0));
if (m.Is(factory()->true_value())) {
......
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