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

Issue 10829270: Continue work on type propagation in optimizing compiler (still WIP). (Closed)

Created:
8 years, 4 months ago by regis
Modified:
8 years, 4 months ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Continue work on type propagation in optimizing compiler (still WIP). Propagated types are cached in ssa definition nodes. Type propagation iterates until fix point is reached. Type checks are marked as eliminated when possible. Committed: https://code.google.com/p/dart/source/detail?r=10475

Patch Set 1 #

Total comments: 19

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+306 lines, -167 lines) Patch
M runtime/vm/flow_graph_builder.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.h View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 2 chunks +80 lines, -11 lines 0 comments Download
M runtime/vm/il_printer.cc View 1 2 2 chunks +9 lines, -8 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 15 chunks +62 lines, -26 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 11 chunks +136 lines, -117 lines 0 comments Download
M runtime/vm/object.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
regis
8 years, 4 months ago (2012-08-09 21:26:17 UTC) #1
srdjan
LGTM with comments. You are missing code to skip code for AssertAssignableComp if it is ...
8 years, 4 months ago (2012-08-09 22:20:53 UTC) #2
regis
8 years, 4 months ago (2012-08-09 23:51:37 UTC) #3
Thanks!

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/flow_graph_...
File runtime/vm/flow_graph_builder.cc (right):

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/flow_graph_...
runtime/vm/flow_graph_builder.cc:444: const bool eliminated =
value->CompileTypeIsMoreSpecificThan(dst_type);
On 2012/08/09 22:20:53, srdjan wrote:
> Comment that propagated types are not set yet.

Done.

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/flow_graph_...
File runtime/vm/flow_graph_optimizer.cc (right):

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/flow_graph_...
runtime/vm/flow_graph_optimizer.cc:553: (comp->value() != NULL) &&
On 2012/08/09 22:20:53, srdjan wrote:
> When can comp->value() be NULL?

It cannot. Code reuse error. Removed.

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/flow_graph_...
runtime/vm/flow_graph_optimizer.cc:637: } while (still_changing_);
On 2012/08/09 22:20:53, srdjan wrote:
> This could be made more efficient by visiting only blocks that have changed
and
> not the whole graph. Please add a TODO.

Added TODO.
I think we would need to revisit blocks that depend on blocks that have changed,
not just those that have changed.

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
File runtime/vm/intermediate_language.cc (right):

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.cc:185: return PropagatedType();
On 2012/08/09 22:20:53, srdjan wrote:
> As discussed in chat, check if you want to split CompiledType (returns one
type)
> from PropagatedTypes (returns a type set/array).

I will keep that question in mind for the next step introducing type sets.

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.cc:201: input_type =
input->AsUse()->definition()->PropagatedType();
On 2012/08/09 22:20:53, srdjan wrote:
> input_type = input->AsUse()->CompileType();, and fix comment about cycles
above.

Code and comment changed:
    input_type = InputAt(i)->CompileType();

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.cc:228: }
On 2012/08/09 22:20:53, srdjan wrote:
> How can a parameter instruction have a propagated_type ?

As the TODO indicates, it would be the type obtained from type feedback and not
really a "propagated", but used similarly as one.

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.cc:1053: if (!IsEliminated()) {
This makes sure eliminated type checks are not emitted. Do you mean something
else by "You are missing code to skip code for AssertAssignableComp if it is
eliminated"?

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
File runtime/vm/intermediate_language.h (right):

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.h:150: // Compile time type of the computation.
On 2012/08/09 22:20:53, srdjan wrote:
> Compile time type or propagated type of the computation.

Yes, the compile type takes the propagated types of the inputs into
consideration, but the computation itself does not cache a propagated type of
its result. The bind instruction caches the propagated type of the computation,
not the computation itself. Added comment.

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.h:2290:
propagated_type_(AbstractType::ZoneHandle()) { }
On 2012/08/09 22:20:53, srdjan wrote:
> This could be Handle instead of ZoneHandle (propagated_type_ will not live
> longer than Definition itself.

Done.

https://chromiumcodereview.appspot.com/10829270/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.h:2315: }
On 2012/08/09 22:20:53, srdjan wrote:
> Add comment that it returns true if the type has changed.

Done.

Powered by Google App Engine
This is Rietveld 408576698