[turbofan] Restore i32+i32->i32 handling in representation inference.
This restores the case that was removed by
commit f0e41175fd
Author: jarin <jarin@chromium.org>
Date: Tue Jan 5 03:56:04 2016 -0800
[turbofan] Bidirectional representation inference.
BUG=v8:4667
LOG=n
R=bmeurer@chromium.org
Review URL: https://codereview.chromium.org/1584913003
Cr-Commit-Position: refs/heads/master@{#33292}
This commit is contained in:
parent
41719a42ac
commit
59ff83f6b0
@ -948,11 +948,16 @@ class RepresentationSelector {
|
||||
}
|
||||
case IrOpcode::kNumberAdd:
|
||||
case IrOpcode::kNumberSubtract: {
|
||||
// Add and subtract reduce to Int32Add/Sub if the inputs
|
||||
// are safe integers and all uses are truncating.
|
||||
if (BothInputsAre(node, type_cache_.kAdditiveSafeInteger) &&
|
||||
truncation.TruncatesToWord32()) {
|
||||
if (BothInputsAre(node, Type::Signed32()) &&
|
||||
NodeProperties::GetType(node)->Is(Type::Signed32())) {
|
||||
// int32 + int32 = int32
|
||||
// => signed Int32Add/Sub
|
||||
VisitInt32Binop(node);
|
||||
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
|
||||
} else if (BothInputsAre(node, type_cache_.kAdditiveSafeInteger) &&
|
||||
truncation.TruncatesToWord32()) {
|
||||
// safe-int + safe-int = x (truncated to int32)
|
||||
// => signed Int32Add/Sub (truncated)
|
||||
VisitWord32TruncatingBinop(node);
|
||||
if (lower()) NodeProperties::ChangeOp(node, Int32Op(node));
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user