Chromium Code Reviews
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 #
Messages
Total messages: 10 (2 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||