Commit 41b88257 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] CheckBounds with Unsigned32 inputs is also supported.

If the first input to CheckBounds is already an Unsigned32, then
we can just truncate both inputs to word32 and lower the bounds
check.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2138753002
Cr-Commit-Position: refs/heads/master@{#37643}
parent 9be74f66
......@@ -1810,8 +1810,14 @@ class RepresentationSelector {
}
case IrOpcode::kCheckBounds: {
VisitBinop(node, UseInfo::CheckedSigned32AsWord32(),
UseInfo::TruncatingWord32(), MachineRepresentation::kWord32);
if (TypeOf(node->InputAt(0))->Is(Type::Unsigned32())) {
VisitBinop(node, UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
} else {
VisitBinop(node, UseInfo::CheckedSigned32AsWord32(),
UseInfo::TruncatingWord32(),
MachineRepresentation::kWord32);
}
return;
}
case IrOpcode::kCheckIf: {
......
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