Commit 225a6adc authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Lower more number operations to integer operations.

If the typer was able to prove that a NumberAdd/Sub/Mul/Div/Mod always
produces a Signed32/Unsigned32 value, and the inputs are
Signed32/Unsigned32, we can lower the node to the corresponding integer
operation instead, no matter what the uses are.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1140933002

Cr-Commit-Position: refs/heads/master@{#28393}
parent 29e15dad
......@@ -444,7 +444,9 @@ class RepresentationSelector {
}
bool CanLowerToInt32Binop(Node* node, MachineTypeUnion use) {
return BothInputsAre(node, Type::Signed32()) && !CanObserveNonInt32(use);
return BothInputsAre(node, Type::Signed32()) &&
(!CanObserveNonInt32(use) ||
NodeProperties::GetBounds(node).upper->Is(Type::Signed32()));
}
bool CanLowerToInt32AdditiveBinop(Node* node, MachineTypeUnion use) {
......@@ -453,7 +455,9 @@ class RepresentationSelector {
}
bool CanLowerToUint32Binop(Node* node, MachineTypeUnion use) {
return BothInputsAre(node, Type::Unsigned32()) && !CanObserveNonUint32(use);
return BothInputsAre(node, Type::Unsigned32()) &&
(!CanObserveNonUint32(use) ||
NodeProperties::GetBounds(node).upper->Is(Type::Unsigned32()));
}
bool CanLowerToUint32AdditiveBinop(Node* node, MachineTypeUnion use) {
......
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