Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191339
b: refs/heads/beta
c: c7ac27b
h: refs/heads/master
i:
  191337: b9d2709
  191335: 6d94b68
  • Loading branch information
sjindel-google authored and commit-bot@chromium.org committed Aug 27, 2019
1 parent 863fb7d commit fee326e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ refs/tags/2.3.0-flutter-1.5.4-hotfix.1: a1668566e563aef64025d0af88a099cbbe847b7e
refs/tags/2.3.1: 929b013ddc83a013b49a98fc28b6b503a972bddd
refs/tags/2.3.1-dev.0.0: 1d1742efd39cd4762b844b510acf8c2f1fa6604e
refs/tags/2.3.2-dev.0.0: c567183bac8a895014d79cd3bf1d8908d45547d6
refs/heads/beta: 71f1a615f4dd95d632eea6b291d8fd3446d57e4e
refs/heads/beta: c7ac27bf504cca030881208eb0b056a5a7ff93c2
refs/heads/sjindel.mep: b113b36c157cf54b257e82550e9bbde16f05ad8d
refs/tags/2.3.2: f7ab96133aa79301daf812ef40b33c99d8ad1495
refs/tags/2.3.2-dev.0.1: ef57e27c9798b54a54e9a1f74b1bd1f9be7290b1
Expand Down
7 changes: 6 additions & 1 deletion branches/beta/runtime/vm/compiler/aot/precompiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,12 @@ bool PrecompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
pass_state.reorder_blocks =
FlowGraph::ShouldReorderBlocks(function, optimized());

if (optimized()) {
if (function.ForceOptimize()) {
ASSERT(optimized());
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");
flow_graph = CompilerPass::RunForceOptimizedPipeline(CompilerPass::kAOT,
&pass_state);
} else if (optimized()) {
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");

pass_state.inline_id_to_function.Add(&function);
Expand Down
65 changes: 33 additions & 32 deletions branches/beta/runtime/vm/compiler/compiler_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,42 +236,43 @@ void CompilerPass::RunInliningPipeline(PipelineMode mode,
INVOKE_PASS(TryOptimizePatterns);
}

FlowGraph* CompilerPass::RunPipeline(PipelineMode mode,
CompilerPassState* pass_state) {
if (mode == kForced) {
INVOKE_PASS(ComputeSSA);
if (FLAG_early_round_trip_serialization) {
INVOKE_PASS(RoundTripSerialization);
}
INVOKE_PASS(TypePropagation);
INVOKE_PASS(ApplyClassIds);
INVOKE_PASS(Canonicalize);
INVOKE_PASS(BranchSimplify);
INVOKE_PASS(IfConvert);
INVOKE_PASS(ConstantPropagation);
INVOKE_PASS(TypePropagation);
INVOKE_PASS(WidenSmiToInt32);
INVOKE_PASS(SelectRepresentations);
INVOKE_PASS(TypePropagation);
INVOKE_PASS(TryCatchOptimization);
INVOKE_PASS(EliminateEnvironments);
INVOKE_PASS(EliminateDeadPhis);
INVOKE_PASS(Canonicalize);
INVOKE_PASS(WriteBarrierElimination);
INVOKE_PASS(FinalizeGraph);
FlowGraph* CompilerPass::RunForceOptimizedPipeline(
PipelineMode mode,
CompilerPassState* pass_state) {
INVOKE_PASS(ComputeSSA);
if (FLAG_early_round_trip_serialization) {
INVOKE_PASS(RoundTripSerialization);
}
INVOKE_PASS(TypePropagation);
INVOKE_PASS(Canonicalize);
INVOKE_PASS(BranchSimplify);
INVOKE_PASS(IfConvert);
INVOKE_PASS(ConstantPropagation);
INVOKE_PASS(TypePropagation);
INVOKE_PASS(WidenSmiToInt32);
INVOKE_PASS(SelectRepresentations);
INVOKE_PASS(TypePropagation);
INVOKE_PASS(TryCatchOptimization);
INVOKE_PASS(EliminateEnvironments);
INVOKE_PASS(EliminateDeadPhis);
INVOKE_PASS(Canonicalize);
INVOKE_PASS(WriteBarrierElimination);
INVOKE_PASS(FinalizeGraph);
#if defined(DART_PRECOMPILER)
if (mode == kAOT) {
INVOKE_PASS(SerializeGraph);
}
if (mode == kAOT) {
INVOKE_PASS(SerializeGraph);
}
#endif
if (FLAG_late_round_trip_serialization) {
INVOKE_PASS(RoundTripSerialization);
}
INVOKE_PASS(AllocateRegisters);
INVOKE_PASS(ReorderBlocks);
return pass_state->flow_graph;
if (FLAG_late_round_trip_serialization) {
INVOKE_PASS(RoundTripSerialization);
}
INVOKE_PASS(AllocateRegisters);
INVOKE_PASS(ReorderBlocks);
return pass_state->flow_graph;
}

FlowGraph* CompilerPass::RunPipeline(PipelineMode mode,
CompilerPassState* pass_state) {
INVOKE_PASS(ComputeSSA);
if (FLAG_early_round_trip_serialization) {
INVOKE_PASS(RoundTripSerialization);
Expand Down
13 changes: 8 additions & 5 deletions branches/beta/runtime/vm/compiler/compiler_pass.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,7 @@ class CompilerPass {

static void ParseFilters(const char* filter);

enum PipelineMode {
kJIT, // Includes speculative and inter-procedural optimizations.
kAOT, // Includes inter-procedural optimizations.
kForced // Does not include speculative or inter-procedural optimizations.
};
enum PipelineMode { kJIT, kAOT };

static void RunGraphIntrinsicPipeline(CompilerPassState* state);

Expand All @@ -165,6 +161,13 @@ class CompilerPass {
CompilerPassState* state,
std::initializer_list<CompilerPass::Id> passes);

// Pipeline which is used for "force-optimized" functions.
//
// Must not include speculative or inter-procedural optimizations.
DART_WARN_UNUSED_RESULT
static FlowGraph* RunForceOptimizedPipeline(PipelineMode mode,
CompilerPassState* state);

protected:
// This function executes the pass. If it returns true then
// we will run Canonicalize on the graph and execute the pass
Expand Down
7 changes: 6 additions & 1 deletion branches/beta/runtime/vm/compiler/jit/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,12 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
CompilerPassState pass_state(thread(), flow_graph, &speculative_policy);
pass_state.reorder_blocks = reorder_blocks;

if (optimized()) {
if (function.ForceOptimize()) {
ASSERT(optimized());
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");
flow_graph = CompilerPass::RunForceOptimizedPipeline(CompilerPass::kJIT,
&pass_state);
} else if (optimized()) {
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");

pass_state.inline_id_to_function.Add(&function);
Expand Down

0 comments on commit fee326e

Please sign in to comment.