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(const HInstruction* node, in ArrayAccessMayAlias() argument
84 size_t node_heap_loc = ArrayAccessHeapLocation(node->InputAt(0), node->InputAt(1)); 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(const 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(const HInstruction* node, in HasSideEffectDependency() argument
269 if (HasMemoryDependency(node, other)) { in HasSideEffectDependency()
276 if (HasExceptionDependency(node, other)) { in HasSideEffectDependency()
362 bool SchedulingGraph::HasImmediateDataDependency(const SchedulingNode* node, in HasImmediateDataDependency() argument
364 return ContainsElement(node->GetDataPredecessors(), other); in HasImmediateDataDependency()
369 const SchedulingNode* node = GetNode(instruction); in HasImmediateDataDependency() local
371 if (node == nullptr || other == nullptr) { in HasImmediateDataDependency()
378 return HasImmediateDataDependency(node, other); in HasImmediateDataDependency()
381 bool SchedulingGraph::HasImmediateOtherDependency(const SchedulingNode* node, in HasImmediateOtherDependency() argument
383 return ContainsElement(node->GetOtherPredecessors(), other); in HasImmediateOtherDependency()
388 const SchedulingNode* node = GetNode(instruction); in HasImmediateOtherDependency() local
390 if (node == nullptr || other == nullptr) { in HasImmediateOtherDependency()
397 return HasImmediateOtherDependency(node, other); in HasImmediateOtherDependency()
406 static void DumpAsDotNode(std::ostream& output, const SchedulingNode* node) { in DumpAsDotNode() argument
407 const HInstruction* instruction = node->GetInstruction(); in DumpAsDotNode()
421 output << "\\ninternal_latency: " << node->GetInternalLatency(); in DumpAsDotNode()
422 output << "\\ncritical_path: " << node->GetCriticalPath(); in DumpAsDotNode()
423 if (node->IsSchedulingBarrier()) { in DumpAsDotNode()
429 for (const SchedulingNode* predecessor : node->GetDataPredecessors()) { in DumpAsDotNode()
434 for (const SchedulingNode* predecessor : node->GetOtherPredecessors()) { in DumpAsDotNode()
451 SchedulingNode* node = entry.second.get(); in DumpAsDotGraph() local
452 DumpAsDotNode(output, node); in DumpAsDotGraph()
455 for (SchedulingNode* node : initial_candidates) { in DumpAsDotGraph()
456 const HInstruction* instruction = node->GetInstruction(); in DumpAsDotGraph()
458 << "[label=\"" << node->GetLatency() << "\",dir=back]\n"; in DumpAsDotGraph()
572 SchedulingNode* node = scheduling_graph_.AddNode(instruction, IsSchedulingBarrier(instruction)); in Schedule() local
573 CalculateLatency(node); in Schedule()
574 scheduling_nodes.push_back(node); in Schedule()
586 for (SchedulingNode* node : scheduling_nodes) { in Schedule()
587 if (!node->HasUnscheduledSuccessors()) { in Schedule()
588 node->MaybeUpdateCriticalPath(node->GetLatency()); in Schedule()
589 candidates_.push_back(node); in Schedule()