Revision: 24930
Author: [email protected]
Date: Tue Oct 28 11:38:22 2014 UTC
Log: Make floating merges respected minimum RPO of coupled phis.
[email protected], [email protected]
TEST=cctest/test-scheduler/LoopedFloatingDiamond
Review URL: https://codereview.chromium.org/682983003
https://code.google.com/p/v8/source/detail?r=24930
Modified:
/branches/bleeding_edge/src/compiler/scheduler.cc
/branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc
=======================================
--- /branches/bleeding_edge/src/compiler/scheduler.cc Tue Oct 28 09:34:35
2014 UTC
+++ /branches/bleeding_edge/src/compiler/scheduler.cc Tue Oct 28 11:38:22
2014 UTC
@@ -1001,6 +1001,12 @@
// No need to propagate to fixed node, it's guaranteed to be a root.
if (scheduler_->GetPlacement(node) == Scheduler::kFixed) return;
+
+ // Coupled nodes influence schedule early position of their control.
+ if (scheduler_->GetPlacement(node) == Scheduler::kCoupled) {
+ Node* control = NodeProperties::GetControlInput(node);
+ PropagateMinimumRPOToNode(block, control);
+ }
// Propagate new position if it is larger than the current.
if (block->rpo_number() > data->minimum_block_->rpo_number()) {
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc Mon Oct
27 22:33:52 2014 UTC
+++ /branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc Tue Oct
28 11:38:22 2014 UTC
@@ -1800,6 +1800,45 @@
ComputeAndVerifySchedule(23, &graph);
}
+
+
+TEST(LoopedFloatingDiamond) {
+ HandleAndZoneScope scope;
+ Graph graph(scope.main_zone());
+ CommonOperatorBuilder common(scope.main_zone());
+ SimplifiedOperatorBuilder simplified(scope.main_zone());
+ MachineOperatorBuilder machine;
+
+ Node* start = graph.NewNode(common.Start(2));
+ graph.SetStart(start);
+
+ Node* p0 = graph.NewNode(common.Parameter(0), start);
+
+ Node* c = graph.NewNode(common.Int32Constant(7));
+ Node* loop = graph.NewNode(common.Loop(2), start, start);
+ Node* ind = graph.NewNode(common.Phi(kMachAnyTagged, 2), p0, p0, loop);
+ Node* add = graph.NewNode(machine.IntAdd(), ind, c);
+
+ Node* br = graph.NewNode(common.Branch(), add, loop);
+ Node* t = graph.NewNode(common.IfTrue(), br);
+ Node* f = graph.NewNode(common.IfFalse(), br);
+
+ Node* br1 = graph.NewNode(common.Branch(), p0, graph.start());
+ Node* t1 = graph.NewNode(common.IfTrue(), br1);
+ Node* f1 = graph.NewNode(common.IfFalse(), br1);
+ Node* m1 = graph.NewNode(common.Merge(2), t1, f1);
+ Node* phi1 = graph.NewNode(common.Phi(kMachAnyTagged, 2), add, p0, m1);
+
+ loop->ReplaceInput(1, t); // close loop.
+ ind->ReplaceInput(1, phi1); // close induction variable.
+
+ Node* ret = graph.NewNode(common.Return(), ind, start, f);
+ Node* end = graph.NewNode(common.End(), ret, f);
+
+ graph.SetEnd(end);
+
+ ComputeAndVerifySchedule(20, &graph);
+}
TEST(PhisPushedDownToDifferentBranches) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.