Skip to content

Commit fee326e

Browse files
sjindel-googlecommit-bot@chromium.org
authored andcommitted
---
yaml --- r: 191339 b: refs/heads/beta c: c7ac27b h: refs/heads/master i: 191337: b9d2709 191335: 6d94b68
1 parent 863fb7d commit fee326e

File tree

5 files changed

+54
-40
lines changed

5 files changed

+54
-40
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ refs/tags/2.3.0-flutter-1.5.4-hotfix.1: a1668566e563aef64025d0af88a099cbbe847b7e
911911
refs/tags/2.3.1: 929b013ddc83a013b49a98fc28b6b503a972bddd
912912
refs/tags/2.3.1-dev.0.0: 1d1742efd39cd4762b844b510acf8c2f1fa6604e
913913
refs/tags/2.3.2-dev.0.0: c567183bac8a895014d79cd3bf1d8908d45547d6
914-
refs/heads/beta: 71f1a615f4dd95d632eea6b291d8fd3446d57e4e
914+
refs/heads/beta: c7ac27bf504cca030881208eb0b056a5a7ff93c2
915915
refs/heads/sjindel.mep: b113b36c157cf54b257e82550e9bbde16f05ad8d
916916
refs/tags/2.3.2: f7ab96133aa79301daf812ef40b33c99d8ad1495
917917
refs/tags/2.3.2-dev.0.1: ef57e27c9798b54a54e9a1f74b1bd1f9be7290b1

branches/beta/runtime/vm/compiler/aot/precompiler.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,12 @@ bool PrecompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
22852285
pass_state.reorder_blocks =
22862286
FlowGraph::ShouldReorderBlocks(function, optimized());
22872287

2288-
if (optimized()) {
2288+
if (function.ForceOptimize()) {
2289+
ASSERT(optimized());
2290+
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");
2291+
flow_graph = CompilerPass::RunForceOptimizedPipeline(CompilerPass::kAOT,
2292+
&pass_state);
2293+
} else if (optimized()) {
22892294
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");
22902295

22912296
pass_state.inline_id_to_function.Add(&function);

branches/beta/runtime/vm/compiler/compiler_pass.cc

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -236,42 +236,43 @@ void CompilerPass::RunInliningPipeline(PipelineMode mode,
236236
INVOKE_PASS(TryOptimizePatterns);
237237
}
238238

239-
FlowGraph* CompilerPass::RunPipeline(PipelineMode mode,
240-
CompilerPassState* pass_state) {
241-
if (mode == kForced) {
242-
INVOKE_PASS(ComputeSSA);
243-
if (FLAG_early_round_trip_serialization) {
244-
INVOKE_PASS(RoundTripSerialization);
245-
}
246-
INVOKE_PASS(TypePropagation);
247-
INVOKE_PASS(ApplyClassIds);
248-
INVOKE_PASS(Canonicalize);
249-
INVOKE_PASS(BranchSimplify);
250-
INVOKE_PASS(IfConvert);
251-
INVOKE_PASS(ConstantPropagation);
252-
INVOKE_PASS(TypePropagation);
253-
INVOKE_PASS(WidenSmiToInt32);
254-
INVOKE_PASS(SelectRepresentations);
255-
INVOKE_PASS(TypePropagation);
256-
INVOKE_PASS(TryCatchOptimization);
257-
INVOKE_PASS(EliminateEnvironments);
258-
INVOKE_PASS(EliminateDeadPhis);
259-
INVOKE_PASS(Canonicalize);
260-
INVOKE_PASS(WriteBarrierElimination);
261-
INVOKE_PASS(FinalizeGraph);
239+
FlowGraph* CompilerPass::RunForceOptimizedPipeline(
240+
PipelineMode mode,
241+
CompilerPassState* pass_state) {
242+
INVOKE_PASS(ComputeSSA);
243+
if (FLAG_early_round_trip_serialization) {
244+
INVOKE_PASS(RoundTripSerialization);
245+
}
246+
INVOKE_PASS(TypePropagation);
247+
INVOKE_PASS(Canonicalize);
248+
INVOKE_PASS(BranchSimplify);
249+
INVOKE_PASS(IfConvert);
250+
INVOKE_PASS(ConstantPropagation);
251+
INVOKE_PASS(TypePropagation);
252+
INVOKE_PASS(WidenSmiToInt32);
253+
INVOKE_PASS(SelectRepresentations);
254+
INVOKE_PASS(TypePropagation);
255+
INVOKE_PASS(TryCatchOptimization);
256+
INVOKE_PASS(EliminateEnvironments);
257+
INVOKE_PASS(EliminateDeadPhis);
258+
INVOKE_PASS(Canonicalize);
259+
INVOKE_PASS(WriteBarrierElimination);
260+
INVOKE_PASS(FinalizeGraph);
262261
#if defined(DART_PRECOMPILER)
263-
if (mode == kAOT) {
264-
INVOKE_PASS(SerializeGraph);
265-
}
262+
if (mode == kAOT) {
263+
INVOKE_PASS(SerializeGraph);
264+
}
266265
#endif
267-
if (FLAG_late_round_trip_serialization) {
268-
INVOKE_PASS(RoundTripSerialization);
269-
}
270-
INVOKE_PASS(AllocateRegisters);
271-
INVOKE_PASS(ReorderBlocks);
272-
return pass_state->flow_graph;
266+
if (FLAG_late_round_trip_serialization) {
267+
INVOKE_PASS(RoundTripSerialization);
273268
}
269+
INVOKE_PASS(AllocateRegisters);
270+
INVOKE_PASS(ReorderBlocks);
271+
return pass_state->flow_graph;
272+
}
274273

274+
FlowGraph* CompilerPass::RunPipeline(PipelineMode mode,
275+
CompilerPassState* pass_state) {
275276
INVOKE_PASS(ComputeSSA);
276277
if (FLAG_early_round_trip_serialization) {
277278
INVOKE_PASS(RoundTripSerialization);

branches/beta/runtime/vm/compiler/compiler_pass.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,7 @@ class CompilerPass {
141141

142142
static void ParseFilters(const char* filter);
143143

144-
enum PipelineMode {
145-
kJIT, // Includes speculative and inter-procedural optimizations.
146-
kAOT, // Includes inter-procedural optimizations.
147-
kForced // Does not include speculative or inter-procedural optimizations.
148-
};
144+
enum PipelineMode { kJIT, kAOT };
149145

150146
static void RunGraphIntrinsicPipeline(CompilerPassState* state);
151147

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

164+
// Pipeline which is used for "force-optimized" functions.
165+
//
166+
// Must not include speculative or inter-procedural optimizations.
167+
DART_WARN_UNUSED_RESULT
168+
static FlowGraph* RunForceOptimizedPipeline(PipelineMode mode,
169+
CompilerPassState* state);
170+
168171
protected:
169172
// This function executes the pass. If it returns true then
170173
// we will run Canonicalize on the graph and execute the pass

branches/beta/runtime/vm/compiler/jit/compiler.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,12 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
616616
CompilerPassState pass_state(thread(), flow_graph, &speculative_policy);
617617
pass_state.reorder_blocks = reorder_blocks;
618618

619-
if (optimized()) {
619+
if (function.ForceOptimize()) {
620+
ASSERT(optimized());
621+
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");
622+
flow_graph = CompilerPass::RunForceOptimizedPipeline(CompilerPass::kJIT,
623+
&pass_state);
624+
} else if (optimized()) {
620625
TIMELINE_DURATION(thread(), CompilerVerbose, "OptimizationPasses");
621626

622627
pass_state.inline_id_to_function.Add(&function);

0 commit comments

Comments
 (0)