Commit 7ada0168 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Some strength reduction for ConvertTaggedHoleToUndefined.

We can fold ConvertTaggedHoleToUndefined into CheckNumber and
CheckTaggedSigned, as they deoptimize no matter if the input
is undefined or hole.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2233393002
Cr-Commit-Position: refs/heads/master@{#38576}
parent 748517f7
......@@ -134,6 +134,14 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
}
break;
}
case IrOpcode::kCheckNumber: {
NodeMatcher m(node->InputAt(0));
if (m.IsConvertTaggedHoleToUndefined()) {
node->ReplaceInput(0, m.InputAt(0));
return Changed(node);
}
break;
}
case IrOpcode::kCheckTaggedPointer: {
Node* const input = node->InputAt(0);
if (DecideObjectIsSmi(input) == Decision::kFalse) {
......@@ -148,6 +156,11 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
ReplaceWithValue(node, input);
return Replace(input);
}
NodeMatcher m(input);
if (m.IsConvertTaggedHoleToUndefined()) {
node->ReplaceInput(0, m.InputAt(0));
return Changed(node);
}
break;
}
case IrOpcode::kObjectIsSmi: {
......
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