Files
sdk/runtime/vm/compiler/backend/block_scheduler.h
T
Martin Kustermann d31e83b909 [VM] Do simple block re-ordering in AOT by moving throwing blocks to the end
If we inline something inside a loop which might throw, the throwing blocks
are currently spliced in the middle of the loop.  This CL moves those blocks
to the very end.

This improves a number of typed data benchmarks in dart-aot mode by 5-10%.

Issue https://github.com/dart-lang/sdk/issues/31954

Change-Id: I5dc86291240d8dac61798ff873ffa7205edc0007
Reviewed-on: https://dart-review.googlesource.com/c/85263
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-26 17:22:56 +00:00

33 lines
839 B
C++

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_
#define RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_
#include "vm/allocation.h"
namespace dart {
class FlowGraph;
class BlockScheduler : public ValueObject {
public:
explicit BlockScheduler(FlowGraph* flow_graph) : flow_graph_(flow_graph) {}
FlowGraph* flow_graph() const { return flow_graph_; }
void AssignEdgeWeights() const;
void ReorderBlocks() const;
private:
void ReorderBlocksAOT() const;
void ReorderBlocksJIT() const;
FlowGraph* const flow_graph_;
};
} // namespace dart
#endif // RUNTIME_VM_COMPILER_BACKEND_BLOCK_SCHEDULER_H_