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

Issue 2709093003: Fixup redefinitions before doing code motion (Closed)

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

Description

Fixup redefinitions before doing code motion Also use redefined receiver consistently when inlining recognized methods. This CL re-enables type propagation from CheckClassId instructions which was disabled as a temporary stop-gap to prevent illegal code motion. (reverts https://codereview.chromium.org/1928633002) Now uses of redefined values that are dominated by the redefinition are renamed before doing LICM. Related to #26347. R=vegorov@google.com Committed: https://github.com/dart-lang/sdk/commit/521526d25903e15b002f82a64b09f2018b53fbba

Patch Set 1 #

Total comments: 13

Patch Set 2 : addressed comments #

Patch Set 3 : fix build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -62 lines) Patch
M runtime/vm/compiler.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph.h View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph.cc View 1 2 chunks +45 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 28 chunks +77 lines, -60 lines 0 comments Download
M runtime/vm/flow_graph_type_propagator.cc View 1 chunk +11 lines, -2 lines 0 comments Download
M runtime/vm/precompiler.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
A tests/language/vm/regress_licm_test.dart View 1 chunk +80 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
Florian Schneider
3 years, 10 months ago (2017-02-22 22:12:08 UTC) #2
Vyacheslav Egorov (Google)
LGTM Though I would really preferred if we tightly tied redefinitions and type propagation. Currently ...
3 years, 10 months ago (2017-02-23 13:47:27 UTC) #4
Florian Schneider
https://codereview.chromium.org/2709093003/diff/1/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/2709093003/diff/1/runtime/vm/compiler.cc#newcode897 runtime/vm/compiler.cc:897: licm.OptimisticallySpecializeSmiPhis(); On 2017/02/23 13:47:27, Vyacheslav Egorov (Google) wrote: > ...
3 years, 10 months ago (2017-02-23 19:26:39 UTC) #5
Florian Schneider
Committed patchset #3 (id:40001) manually as 521526d25903e15b002f82a64b09f2018b53fbba (presubmit successful).
3 years, 10 months ago (2017-02-23 20:35:03 UTC) #7
Vyacheslav Egorov (Google)
3 years, 10 months ago (2017-02-23 20:53:18 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/2709093003/diff/1/runtime/vm/flow_graph.cc
File runtime/vm/flow_graph.cc (right):

https://codereview.chromium.org/2709093003/diff/1/runtime/vm/flow_graph.cc#ne...
runtime/vm/flow_graph.cc:2136: Definition* original =
redefinition->value()->definition();
On 2017/02/23 19:26:35, Florian Schneider wrote:
> On 2017/02/23 13:47:27, Vyacheslav Egorov (Google) wrote:
> > Can we have multiple Redefinitions(), e.g.
> > 
> > v0 <- something
> > 
> > | v1 <- Redefinition(v0)
> > |
> > | | v2 <- Redefinition(v0)
> > | |
> > | | use(v1)
> > 
> > in this case we will not rename use(v1) to v2 which might lead to incorrect
> code
> > motion. 
> > 
> 
> I have not seen this case: I think if redefinitions are properly inserted, v2
> would redefine v1 if there is a dependency. Otherwise the two are independent.
> How about we do CSE of redefinitions to make sure that it does not occur?

I think this can occur in the situation like this:

class A {
  foo(obj) => obj.x();
}

bar(obj) {
  obj.foo(obj); // inline foo polymorphically here and then inline obj.x
polymorphically
}

but then our type propagation will take care of it.

I did not try to craft example where it goes south, but I will try.

Powered by Google App Engine
This is Rietveld 408576698