Commit b4a4c4c5 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Only replace nodes eagerly during simplified lowering if the types stay the same.

BUG=chromium:452427
LOG=n
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26286}
parent 66964395
...@@ -1032,14 +1032,16 @@ class RepresentationSelector { ...@@ -1032,14 +1032,16 @@ class RepresentationSelector {
node->op()->mnemonic(), replacement->id(), node->op()->mnemonic(), replacement->id(),
replacement->op()->mnemonic())); replacement->op()->mnemonic()));
} }
if (replacement->id() < count_) { if (replacement->id() < count_ &&
// Replace with a previously existing node eagerly. GetInfo(replacement)->output == GetInfo(node)->output) {
// Replace with a previously existing node eagerly only if the type is the
// same.
node->ReplaceUses(replacement); node->ReplaceUses(replacement);
} else { } else {
// Otherwise, we are replacing a node with a representation change. // Otherwise, we are replacing a node with a representation change.
// Such a substitution must be done after all lowering is done, because // Such a substitution must be done after all lowering is done, because
// new nodes do not have {NodeInfo} entries, and that would confuse // changing the type could confuse the representation change
// the representation change insertion for uses of it. // insertion for uses of the node.
replacements_.push_back(node); replacements_.push_back(node);
replacements_.push_back(replacement); replacements_.push_back(replacement);
} }
......
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var stdlib = {};
var foreign = {};
var heap = new ArrayBuffer(64 * 1024);
var rol = (function Module(stdlib, foreign, heap) {
"use asm";
function rol() {
y = "a" > false;
return y + (1 - y);
}
return { rol: rol };
})(stdlib, foreign, heap).rol;
assertEquals(1, rol());
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