Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: src/compiler/simplified-lowering.cc

Issue 529893002: Fix representation change insertion for phis. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 9ccd4ed5ef7d303c156898c6aa138f952e3719ff..bcd697b69495d55fb30286505c8461ccd4ef7a61 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -255,12 +255,14 @@ class RepresentationSelector {
void VisitPhi(Node* node, MachineTypeUnion use) {
// First, propagate the usage information to inputs of the phi.
int values = OperatorProperties::GetValueInputCount(node->op());
Michael Starzinger 2014/09/02 08:37:01 nit: Can we move the values into the condition (i.
titzer 2014/09/02 10:14:58 Done.
- Node::Inputs inputs = node->inputs();
- for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
- ++iter, --values) {
+ if (!lower()) {
// Propagate {use} of the phi to value inputs, and 0 to control.
- // TODO(titzer): it'd be nice to have distinguished edge kinds here.
- ProcessInput(node, iter.index(), values > 0 ? use : 0);
+ Node::Inputs inputs = node->inputs();
+ for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
+ ++iter, --values) {
+ // TODO(titzer): it'd be nice to have distinguished edge kinds here.
+ ProcessInput(node, iter.index(), values > 0 ? use : 0);
+ }
}
// Phis adapt to whatever output representation their uses demand,
// pushing representation changes to their inputs.
@@ -296,7 +298,18 @@ class RepresentationSelector {
}
// Preserve the usage type, but set the representation.
Type* upper = NodeProperties::GetBounds(node).upper;
- SetOutput(node, rep | changer_->TypeFromUpperBound(upper));
+ MachineTypeUnion output_type = rep | changer_->TypeFromUpperBound(upper);
+ SetOutput(node, output_type);
+
+ if (lower()) {
+ // Convert inputs to the output representation of this phi.
+ Node::Inputs inputs = node->inputs();
+ for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
+ ++iter, --values) {
+ // TODO(titzer): it'd be nice to have distinguished edge kinds here.
+ ProcessInput(node, iter.index(), values > 0 ? output_type : 0);
+ }
+ }
}
Operator* Int32Op(Node* node) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698