summaryrefslogtreecommitdiff
path: root/compiler/optimizing/scheduler.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-02-12 11:17:28 +0100
committer VladimĂ­r Marko <vmarko@google.com> 2024-02-13 15:28:35 +0000
commit77e5997b524a133d38585da8bf58420f2411f7ad (patch)
tree0273c71559a03593b358f04ef060214796159863 /compiler/optimizing/scheduler.cc
parent2389869ed372eebd886c2f984f23ec7e342da22b (diff)
Optimizing: Refactor `HScheduler`.
Move `SchedulingLatencyVisitor{ARM,ARM64}` to .cc files. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: run-gtests.sh Test: testrunner.py --target --optimizing Change-Id: I15cb1a4cbef00a328fec947189412c502bf80f46
Diffstat (limited to 'compiler/optimizing/scheduler.cc')
-rw-r--r--compiler/optimizing/scheduler.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/compiler/optimizing/scheduler.cc b/compiler/optimizing/scheduler.cc
index 4236a545bc..f4cf7b0a49 100644
--- a/compiler/optimizing/scheduler.cc
+++ b/compiler/optimizing/scheduler.cc
@@ -548,20 +548,10 @@ void HScheduler::Schedule(HGraph* graph) {
void HScheduler::Schedule(HBasicBlock* block,
const HeapLocationCollector* heap_location_collector) {
ScopedArenaAllocator allocator(block->GetGraph()->GetArenaStack());
- ScopedArenaVector<SchedulingNode*> scheduling_nodes(allocator.Adapter(kArenaAllocScheduler));
// Build the scheduling graph.
- SchedulingGraph scheduling_graph(&allocator, heap_location_collector);
- for (HBackwardInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
- HInstruction* instruction = it.Current();
- CHECK_EQ(instruction->GetBlock(), block)
- << instruction->DebugName()
- << " is in block " << instruction->GetBlock()->GetBlockId()
- << ", and expected in block " << block->GetBlockId();
- SchedulingNode* node = scheduling_graph.AddNode(instruction, IsSchedulingBarrier(instruction));
- CalculateLatency(node);
- scheduling_nodes.push_back(node);
- }
+ auto [scheduling_graph, scheduling_nodes] =
+ BuildSchedulingGraph(block, &allocator, heap_location_collector);
if (scheduling_graph.Size() <= 1) {
return;
@@ -803,8 +793,7 @@ bool HInstructionScheduling::Run(bool only_optimize_loop_blocks,
#if defined(ART_ENABLE_CODEGEN_arm)
case InstructionSet::kThumb2:
case InstructionSet::kArm: {
- arm::SchedulingLatencyVisitorARM arm_latency_visitor(codegen_);
- arm::HSchedulerARM scheduler(selector, &arm_latency_visitor);
+ arm::HSchedulerARM scheduler(selector, codegen_);
scheduler.SetOnlyOptimizeLoopBlocks(only_optimize_loop_blocks);
scheduler.Schedule(graph_);
break;