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

Issue 10539108: First step to SSA construction: Phi insertion. (Closed)

Created:
8 years, 6 months ago by Florian Schneider
Modified:
8 years, 6 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

First step to SSA construction: Phi insertion. This CL contains the phi insertion step of the SSA construction algorithmus: The phi instructions inserted are not functional yet. Renaming is not included yet. I based it on Kevin's CL (http://codereview.chromium.org/10388161/), rebased and fixed a bug (added missing iterator.Advance()) there. It also reintroduces the Definition IL class because Phi-instructions are also definitions that are referenced by UseVal. I also added the set of immediately dominated blocks to each basic block. This will be needed for pre-order dominator-tree traversal in the renaming pass. Committed: https://code.google.com/p/dart/source/detail?r=8604

Patch Set 1 #

Total comments: 27

Patch Set 2 : addressed comments, fixed bug in BitVector::Contains #

Unified diffs Side-by-side diffs Delta from patch set Stats (+297 lines, -26 lines) Patch
M vm/bit_vector.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M vm/bit_vector_test.cc View 1 3 chunks +9 lines, -0 lines 0 comments Download
M vm/flow_graph_builder.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M vm/flow_graph_builder.cc View 1 4 chunks +64 lines, -2 lines 0 comments Download
M vm/il_printer.cc View 3 chunks +41 lines, -2 lines 0 comments Download
M vm/intermediate_language.h View 1 12 chunks +81 lines, -17 lines 0 comments Download
M vm/intermediate_language.cc View 3 chunks +85 lines, -1 line 0 comments Download
M vm/scopes.h View 1 chunk +3 lines, -1 line 0 comments Download
M vm/scopes.cc View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Florian Schneider
8 years, 6 months ago (2012-06-12 14:41:32 UTC) #1
srdjan
LGTM, but please wait on Slava's comments as well. Thanks. https://chromiumcodereview.appspot.com/10539108/diff/1/vm/bit_vector.h File vm/bit_vector.h (right): https://chromiumcodereview.appspot.com/10539108/diff/1/vm/bit_vector.h#newcode69 ...
8 years, 6 months ago (2012-06-12 17:34:37 UTC) #2
Florian Schneider
https://chromiumcodereview.appspot.com/10539108/diff/1/vm/bit_vector.h File vm/bit_vector.h (right): https://chromiumcodereview.appspot.com/10539108/diff/1/vm/bit_vector.h#newcode69 vm/bit_vector.h:69: return (block & (1U << (i % sizeof(uword)))) != ...
8 years, 6 months ago (2012-06-13 10:53:40 UTC) #3
Vyacheslav Egorov (Google)
lgtm
8 years, 6 months ago (2012-06-13 13:15:24 UTC) #4
srdjan
8 years, 6 months ago (2012-06-13 18:45:26 UTC) #5
https://chromiumcodereview.appspot.com/10539108/diff/1/vm/intermediate_langua...
File vm/intermediate_language.h (right):

https://chromiumcodereview.appspot.com/10539108/diff/1/vm/intermediate_langua...
vm/intermediate_language.h:1837: void InsertPhi(intptr_t var_index, intptr_t
var_count);
On 2012/06/13 10:53:40, Florian Schneider wrote:
> On 2012/06/12 17:34:37, srdjan wrote:
> > Get rid of var_count, it is used only to allocate optimal capacity of
growable
> > array.
> 
> Growable arrays incur a high cost when not used with good initial size
> estimates. (in this case I actually want a fixed-size array). I need some
> initial size and this is readily available to avoid reallocating 3 times for
> adding very few elements.
> 

Yes, but the 'var_count' looks weird in the API, as it has nothing to do with
the computation of phis. Have we measured a negative performance impact so that
it validates the more complicate API?  We must refrain from premature
optimizations (e.g., passing isolates, zones, best allocation size)!

Powered by Google App Engine
This is Rietveld 408576698