Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Issue 3010673002: [vm] Implement gradual refinement of types (Closed)

Created:
3 years, 3 months ago by alexmarkov
Modified:
3 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[vm] Implement gradual refinement of types Before this CL, each invocation of FlowGraphTypePropagator discarded (overwritten) all previously inferred types. Due to re-structuring of the IR (for example, InstanceCall to _simpleInstanceOf may be replaced with various IR sequences), FlowGraphTypePropagator may yield better or worse results (for example, not all replacements of _simpleInstanceOf are recognized by FlowGraphTypePropagator). As the result, inferred type information could be lost at later stages of the compilation pipeline. Code generation, which looks at the types may not see the same types as earlier stages of compilation pipeline, so EmitNativeCode() may generate code which is out of sync with ComputeCanDeoptimize(). This CL introduces refinement of types: old type is no longer blindly replaced with newly inferred type. Instead, more specific type is selected among new and old types. Conservatively, the new type is preferred if the types are unrelated (it could happen in certain corner cases, such as unreachable code). This CL also contains the following minor changes: * Fix reaching type of the CheckSmi argument when CheckSmi is moved in LICM::TrySpecializeSmiPhi. It looks like it was previosuly unnoticed due to full recomputation of types in type propagator. * Rename local variables to better follow style guide (follow-up to my previous change). * Handle kNE along with other comparisons in AOT. R=rmacnak@google.com, vegorov@google.com Issue: https://github.com/dart-lang/sdk/issues/30480 Committed: https://github.com/dart-lang/sdk/commit/3cc0cea37e56bc5c590905f2da4bc5d9db9d73e6

Patch Set 1 #

Total comments: 4

Patch Set 2 : Rename compile_type to abstract_type #

Total comments: 7

Patch Set 3 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -20 lines) Patch
M runtime/vm/aot_optimizer.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_type_propagator.cc View 1 2 9 chunks +80 lines, -17 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 2 chunks +11 lines, -3 lines 0 comments Download
M runtime/vm/redundancy_elimination.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
alexmarkov
3 years, 3 months ago (2017-08-29 21:35:53 UTC) #2
rmacnak
lgtm https://codereview.chromium.org/3010673002/diff/1/runtime/vm/flow_graph_type_propagator.cc File runtime/vm/flow_graph_type_propagator.cc (right): https://codereview.chromium.org/3010673002/diff/1/runtime/vm/flow_graph_type_propagator.cc#newcode552 runtime/vm/flow_graph_type_propagator.cc:552: const AbstractType* compile_type = ToAbstractType(); abstract_type https://codereview.chromium.org/3010673002/diff/1/runtime/vm/flow_graph_type_propagator.cc#newcode553 runtime/vm/flow_graph_type_propagator.cc:553: ...
3 years, 3 months ago (2017-08-29 23:02:42 UTC) #3
alexmarkov
https://codereview.chromium.org/3010673002/diff/1/runtime/vm/flow_graph_type_propagator.cc File runtime/vm/flow_graph_type_propagator.cc (right): https://codereview.chromium.org/3010673002/diff/1/runtime/vm/flow_graph_type_propagator.cc#newcode552 runtime/vm/flow_graph_type_propagator.cc:552: const AbstractType* compile_type = ToAbstractType(); On 2017/08/29 23:02:42, rmacnak ...
3 years, 3 months ago (2017-08-29 23:10:37 UTC) #4
Vyacheslav Egorov (Google)
LGTM I think this should work OK, but I need to think more about it. ...
3 years, 3 months ago (2017-08-30 17:11:47 UTC) #5
alexmarkov
https://codereview.chromium.org/3010673002/diff/20001/runtime/vm/flow_graph_type_propagator.cc File runtime/vm/flow_graph_type_propagator.cc (right): https://codereview.chromium.org/3010673002/diff/20001/runtime/vm/flow_graph_type_propagator.cc#newcode532 runtime/vm/flow_graph_type_propagator.cc:532: CompileType* CompileType::Refine(CompileType* other) { On 2017/08/30 17:11:46, Vyacheslav Egorov ...
3 years, 3 months ago (2017-08-30 18:11:57 UTC) #6
Vyacheslav Egorov (Google)
https://codereview.chromium.org/3010673002/diff/20001/runtime/vm/flow_graph_type_propagator.cc File runtime/vm/flow_graph_type_propagator.cc (right): https://codereview.chromium.org/3010673002/diff/20001/runtime/vm/flow_graph_type_propagator.cc#newcode545 runtime/vm/flow_graph_type_propagator.cc:545: if (other->ToCid() != kDynamicCid) { On 2017/08/30 18:11:57, alexmarkov ...
3 years, 3 months ago (2017-08-30 18:13:56 UTC) #7
alexmarkov
On 2017/08/30 18:13:56, Vyacheslav Egorov (Google) wrote: > https://codereview.chromium.org/3010673002/diff/20001/runtime/vm/flow_graph_type_propagator.cc > File runtime/vm/flow_graph_type_propagator.cc (right): > > ...
3 years, 3 months ago (2017-08-30 18:29:24 UTC) #8
alexmarkov
3 years, 3 months ago (2017-08-30 19:12:23 UTC) #10
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
3cc0cea37e56bc5c590905f2da4bc5d9db9d73e6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698