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

[turbofan] Avoid -0 checks for truncating word32 uses.

The CheckBounds operator identifies zeros, but we ignore these bits in
the representation selector, which generates unnecessary -0 checks for
array accesses.

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

Review-Url: https://codereview.chromium.org/2823203002
Cr-Commit-Position: refs/heads/master@{#44680}
parent 5d2c6ec3
......@@ -654,7 +654,7 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
use_info.type_check() == TypeCheckKind::kSigned32) {
op = simplified()->CheckedFloat64ToInt32(
output_type->Maybe(Type::MinusZero())
? CheckForMinusZeroMode::kCheckForMinusZero
? use_info.minus_zero_check()
: CheckForMinusZeroMode::kDontCheckForMinusZero);
} else if (output_type->Is(Type::Unsigned32())) {
op = machine()->ChangeFloat64ToUint32();
......@@ -686,7 +686,7 @@ Node* RepresentationChanger::GetWord32RepresentationFor(
} else if (use_info.type_check() == TypeCheckKind::kSigned32) {
op = simplified()->CheckedTaggedToInt32(
output_type->Maybe(Type::MinusZero())
? CheckForMinusZeroMode::kCheckForMinusZero
? use_info.minus_zero_check()
: CheckForMinusZeroMode::kDontCheckForMinusZero);
} else if (output_type->Is(Type::Unsigned32())) {
op = simplified()->ChangeTaggedToUint32();
......
......@@ -198,8 +198,8 @@ class UseInfo {
TypeCheckKind::kSignedSmall);
}
static UseInfo CheckedSigned32AsWord32(IdentifyZeros identify_zeros) {
return UseInfo(MachineRepresentation::kWord32, Truncation::Any(),
TypeCheckKind::kSigned32);
return UseInfo(MachineRepresentation::kWord32,
Truncation::Any(identify_zeros), TypeCheckKind::kSigned32);
}
static UseInfo CheckedNumberAsFloat64() {
return UseInfo(MachineRepresentation::kFloat64, Truncation::Float64(),
......
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