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

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

Issue 545153002: [turbofan] Add MachineType to Phi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case. 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 | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/test-phi-reducer.cc » ('j') | 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 960c93aaba1e583bd895f0a424c82d2b7034f404..a635f98314dc5e4a1a3358dbccee9499dadac700 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -267,7 +267,8 @@ class RepresentationSelector {
void VisitUint64Cmp(Node* node) { VisitBinop(node, kMachUint64, kRepBit); }
// Helper for handling phis.
- void VisitPhi(Node* node, MachineTypeUnion use) {
+ void VisitPhi(Node* node, MachineTypeUnion use,
+ SimplifiedLowering* lowering) {
// First, propagate the usage information to inputs of the phi.
if (!lower()) {
int values = OperatorProperties::GetValueInputCount(node->op());
@@ -318,6 +319,13 @@ class RepresentationSelector {
if (lower()) {
int values = OperatorProperties::GetValueInputCount(node->op());
+
+ // Update the phi operator.
+ MachineType type = static_cast<MachineType>(output_type);
+ if (type != OpParameter<MachineType>(node)) {
+ node->set_op(lowering->common()->Phi(type, values));
+ }
+
// Convert inputs to the output representation of this phi.
Node::Inputs inputs = node->inputs();
for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
@@ -384,7 +392,7 @@ class RepresentationSelector {
Enqueue(NodeProperties::GetControlInput(node, 0));
break;
case IrOpcode::kPhi:
- return VisitPhi(node, use);
+ return VisitPhi(node, use, lowering);
//------------------------------------------------------------------
// JavaScript operators.
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/test-phi-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698