Lines Matching refs:node
36 void SchedulingGraph::AddDependency(SchedulingNode* node, in AddDependency() argument
39 if (node == nullptr || dependency == nullptr) { in AddDependency()
46 if (!HasImmediateDataDependency(node, dependency)) { in AddDependency()
47 node->AddDataPredecessor(dependency); in AddDependency()
49 } else if (!HasImmediateOtherDependency(node, dependency)) { in AddDependency()
50 node->AddOtherPredecessor(dependency); in AddDependency()
54 static bool MayHaveReorderingDependency(SideEffects node, SideEffects other) { in MayHaveReorderingDependency() argument
56 if (node.MayDependOn(other)) { in MayHaveReorderingDependency()
61 if (other.MayDependOn(node)) { in MayHaveReorderingDependency()
66 if (node.DoesAnyWrite() && other.DoesAnyWrite()) { in MayHaveReorderingDependency()
81 bool SchedulingGraph::ArrayAccessMayAlias(HInstruction* node, in ArrayAccessMayAlias() argument
84 size_t node_heap_loc = ArrayAccessHeapLocation(node); in ArrayAccessMayAlias()
163 bool SchedulingGraph::FieldAccessMayAlias(const HInstruction* node, in FieldAccessMayAlias() argument
168 if ((IsInstanceFieldAccess(node) && IsStaticFieldAccess(other)) || in FieldAccessMayAlias()
169 (IsStaticFieldAccess(node) && IsInstanceFieldAccess(other))) { in FieldAccessMayAlias()
174 if (IsUnresolvedFieldAccess(node) || IsUnresolvedFieldAccess(other)) { in FieldAccessMayAlias()
180 const FieldInfo* node_field = GetFieldInfo(node); in FieldAccessMayAlias()
183 size_t node_loc = FieldAccessHeapLocation(node->InputAt(0), node_field); in FieldAccessMayAlias()
197 bool SchedulingGraph::HasMemoryDependency(HInstruction* node, in HasMemoryDependency() argument
199 if (!MayHaveReorderingDependency(node->GetSideEffects(), other->GetSideEffects())) { in HasMemoryDependency()
211 if (IsArrayAccess(node) && IsArrayAccess(other)) { in HasMemoryDependency()
212 return ArrayAccessMayAlias(node, other); in HasMemoryDependency()
214 if (IsFieldAccess(node) && IsFieldAccess(other)) { in HasMemoryDependency()
215 return FieldAccessMayAlias(node, other); in HasMemoryDependency()
219 if (node->IsVecMemoryOperation() && other->IsVecMemoryOperation()) { in HasMemoryDependency()
222 if (node->IsVecMemoryOperation() && IsArrayAccess(other)) { in HasMemoryDependency()
225 if (IsArrayAccess(node) && other->IsVecMemoryOperation()) { in HasMemoryDependency()
230 if (IsArrayAccess(node) && IsFieldAccess(other)) { in HasMemoryDependency()
233 if (IsFieldAccess(node) && IsArrayAccess(other)) { in HasMemoryDependency()
236 if (node->IsVecMemoryOperation() && IsFieldAccess(other)) { in HasMemoryDependency()
239 if (IsFieldAccess(node) && other->IsVecMemoryOperation()) { in HasMemoryDependency()
248 bool SchedulingGraph::HasExceptionDependency(const HInstruction* node, in HasExceptionDependency() argument
250 if (other->CanThrow() && node->GetSideEffects().DoesAnyWrite()) { in HasExceptionDependency()
253 if (other->GetSideEffects().DoesAnyWrite() && node->CanThrow()) { in HasExceptionDependency()
256 if (other->CanThrow() && node->CanThrow()) { in HasExceptionDependency()
267 bool SchedulingGraph::HasSideEffectDependency(HInstruction* node, in HasSideEffectDependency() argument
269 if (HasMemoryDependency(node, other)) { in HasSideEffectDependency()
276 if (HasExceptionDependency(node, other)) { in HasSideEffectDependency()
391 bool SchedulingGraph::HasImmediateDataDependency(const SchedulingNode* node, in HasImmediateDataDependency() argument
393 return ContainsElement(node->GetDataPredecessors(), other); in HasImmediateDataDependency()
398 const SchedulingNode* node = GetNode(instruction); in HasImmediateDataDependency() local
400 if (node == nullptr || other == nullptr) { in HasImmediateDataDependency()
407 return HasImmediateDataDependency(node, other); in HasImmediateDataDependency()
410 bool SchedulingGraph::HasImmediateOtherDependency(const SchedulingNode* node, in HasImmediateOtherDependency() argument
412 return ContainsElement(node->GetOtherPredecessors(), other); in HasImmediateOtherDependency()
417 const SchedulingNode* node = GetNode(instruction); in HasImmediateOtherDependency() local
419 if (node == nullptr || other == nullptr) { in HasImmediateOtherDependency()
426 return HasImmediateOtherDependency(node, other); in HasImmediateOtherDependency()
435 static void DumpAsDotNode(std::ostream& output, const SchedulingNode* node) { in DumpAsDotNode() argument
436 const HInstruction* instruction = node->GetInstruction(); in DumpAsDotNode()
450 output << "\\ninternal_latency: " << node->GetInternalLatency(); in DumpAsDotNode()
451 output << "\\ncritical_path: " << node->GetCriticalPath(); in DumpAsDotNode()
452 if (node->IsSchedulingBarrier()) { in DumpAsDotNode()
458 for (const SchedulingNode* predecessor : node->GetDataPredecessors()) { in DumpAsDotNode()
463 for (const SchedulingNode* predecessor : node->GetOtherPredecessors()) { in DumpAsDotNode()
480 SchedulingNode* node = entry.second.get(); in DumpAsDotGraph() local
481 DumpAsDotNode(output, node); in DumpAsDotGraph()
484 for (SchedulingNode* node : initial_candidates) { in DumpAsDotGraph()
485 const HInstruction* instruction = node->GetInstruction(); in DumpAsDotGraph()
487 << "[label=\"" << node->GetLatency() << "\",dir=back]\n"; in DumpAsDotGraph()
604 SchedulingNode* node = scheduling_graph.AddNode(instruction, IsSchedulingBarrier(instruction)); in Schedule() local
605 CalculateLatency(node); in Schedule()
606 scheduling_nodes.push_back(node); in Schedule()
620 for (SchedulingNode* node : scheduling_nodes) { in Schedule()
621 if (!node->HasUnscheduledSuccessors()) { in Schedule()
622 node->MaybeUpdateCriticalPath(node->GetLatency()); in Schedule()
623 candidates.push_back(node); in Schedule()
636 SchedulingNode* node = selector_->PopHighestPriorityNode(&candidates, scheduling_graph); in Schedule() local
637 Schedule(node, &candidates); in Schedule()