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 10583014: Fix a bug in SSA renaming. (Closed)

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

Description

Fix a bug in SSA renaming. This CL changes the order of step 2a and 2b in the SSA renaming: Uses of LoadLocal/StoreLocal must be renamed first so that the environment is correctly updated for StoreLocal instructions. A simple example showing the bug: test_xy() { var x = 1; var y = 2; var z = 3; for (var i = 0; i < 5; i++) { y = z = x; x++; } return x + y + z; } Also in this change: - changed the printing of SSA operands to v0, v1, .. instead of t0, t1 to better distinguish them from non-SSA operands. - make sure that UseVal are always copied when renaming phi input operands. Committed: https://code.google.com/p/dart/source/detail?r=8893

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -48 lines) Patch
M vm/flow_graph_builder.cc View 1 5 chunks +46 lines, -43 lines 0 comments Download
M vm/il_printer.cc View 5 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
8 years, 6 months ago (2012-06-19 13:18:40 UTC) #1
Florian Schneider
Adding srdjan.
8 years, 6 months ago (2012-06-19 13:50:45 UTC) #2
srdjan
LGTM http://codereview.chromium.org/10583014/diff/1/vm/flow_graph_builder.cc File vm/flow_graph_builder.cc (right): http://codereview.chromium.org/10583014/diff/1/vm/flow_graph_builder.cc#newcode2646 vm/flow_graph_builder.cc:2646: // enviroment. s/enviroment/environment/ http://codereview.chromium.org/10583014/diff/1/vm/flow_graph_builder.cc#newcode2677 vm/flow_graph_builder.cc:2677: if ((load != ...
8 years, 6 months ago (2012-06-19 16:45:06 UTC) #3
Florian Schneider
8 years, 6 months ago (2012-06-21 08:15:47 UTC) #4
http://codereview.chromium.org/10583014/diff/1/vm/flow_graph_builder.cc
File vm/flow_graph_builder.cc (right):

http://codereview.chromium.org/10583014/diff/1/vm/flow_graph_builder.cc#newco...
vm/flow_graph_builder.cc:2646: // enviroment.
On 2012/06/19 16:45:06, srdjan wrote:
> s/enviroment/environment/

Done.

http://codereview.chromium.org/10583014/diff/1/vm/flow_graph_builder.cc#newco...
vm/flow_graph_builder.cc:2677: if ((load != NULL) || (store != NULL)) {
On 2012/06/19 16:45:06, srdjan wrote:
> I think it would be more readable if you split it (since it is not possible
that
> both store and load are not NULL:
> 
> if (load != NULL) {
>   // Remove instruction with LoadLocal
>   prev->SetSuccessor(current->StraightLineSuccessor());
> } else if (store != NULL) {
>   // Remove instruction with StoreLocal
>   prev->SetSuccessor(current->StraightLineSuccessor());
>   (*env)[store->local().BitIndexIn(var_count)] = store->value();
> } else {
>   // Assign new SSA temporary.
> ...
> }
> 
> You may (or not)  merge the functionality with if-s above.

Done.

http://codereview.chromium.org/10583014/diff/1/vm/flow_graph_builder.cc#newco...
vm/flow_graph_builder.cc:2715: // Rename input operand and make a copy if it is
a UseVal.
On 2012/06/19 16:45:06, srdjan wrote:
> Indent comment

Done.

Powered by Google App Engine
This is Rietveld 408576698