Commit 61386fb8 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Propagate word32 truncations through tagged-hole checks.

If all uses of a CheckTaggedHole[convert-hole-to-undefined] node
truncate to word32, we can replace the hole check with a Smi check
and return the result as word32.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2079233006
Cr-Commit-Position: refs/heads/master@{#37142}
parent fdea3376
......@@ -1860,9 +1860,18 @@ class RepresentationSelector {
return;
}
case IrOpcode::kCheckTaggedHole: {
ProcessInput(node, 0, UseInfo::AnyTagged());
ProcessRemainingInputs(node, 1);
SetOutput(node, MachineRepresentation::kTagged);
CheckTaggedHoleMode mode = CheckTaggedHoleModeOf(node->op());
if (truncation.TruncatesToWord32() &&
mode == CheckTaggedHoleMode::kConvertHoleToUndefined) {
ProcessInput(node, 0, UseInfo::CheckedSigned32AsWord32());
ProcessRemainingInputs(node, 1);
SetOutput(node, MachineRepresentation::kWord32);
if (lower()) DeferReplacement(node, node->InputAt(0));
} else {
ProcessInput(node, 0, UseInfo::AnyTagged());
ProcessRemainingInputs(node, 1);
SetOutput(node, MachineRepresentation::kTagged);
}
return;
}
......
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