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

Issue 10665022: Make IL instructions a doubly-linked list within basic blocks. (Closed)

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

Description

Make IL instructions a doubly-linked list within basic blocks. In order to be able to efficiently iterate backwards over instructions and removing or replacing instructions in the graph we want them to be a double-linked list inside basic blocks. The list has the following 1. Block entry instructions do not have a previous instruction. 2. The last instruction in a block may or may not have a next instruction: - Branches have a NULL-successor. - Normal block exits have a block entry instructions as successor. This CL also makes the accessor for previous and next instruction in this list non-virtual. This avoidis the current code duplication there. Committed: https://code.google.com/p/dart/source/detail?r=9297

Patch Set 1 #

Patch Set 2 : use_ssa flag off by default #

Total comments: 11

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -140 lines) Patch
M vm/flow_graph_allocator.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M vm/flow_graph_builder.cc View 1 2 16 chunks +49 lines, -42 lines 0 comments Download
M vm/flow_graph_compiler.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M vm/flow_graph_optimizer.cc View 1 2 5 chunks +5 lines, -5 lines 0 comments Download
M vm/il_printer.cc View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M vm/intermediate_language.h View 1 2 26 chunks +39 lines, -77 lines 0 comments Download
M vm/intermediate_language.cc View 1 2 3 chunks +45 lines, -8 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
8 years, 6 months ago (2012-06-25 12:50:15 UTC) #1
srdjan
LGTM I am worried about inconsistent state when removing instructions and would like as many ...
8 years, 6 months ago (2012-06-25 15:57:16 UTC) #2
Vyacheslav Egorov (Google)
lgtm with Srdjan's comments addressed.
8 years, 6 months ago (2012-06-25 16:02:44 UTC) #3
Florian Schneider
8 years, 5 months ago (2012-07-02 09:20:42 UTC) #4
https://chromiumcodereview.appspot.com/10665022/diff/4001/vm/intermediate_lan...
File vm/intermediate_language.cc (right):

https://chromiumcodereview.appspot.com/10665022/diff/4001/vm/intermediate_lan...
vm/intermediate_language.cc:534: void Instruction::SetSuccessor(Instruction*
instr) {
On 2012/06/25 15:57:16, srdjan wrote:
> The two methods are (at least now) very simple setter and could be renamed to
> set_successor, set_previous and moved into  header file. Or are there plans to
> make them more complex?

Done.

https://chromiumcodereview.appspot.com/10665022/diff/4001/vm/intermediate_lan...
vm/intermediate_language.cc:558: if (next != NULL && !next->IsBlockEntry()) {
On 2012/06/25 15:57:16, srdjan wrote:
> Add parenthesis. Quick question: when is it possible to remove the last
> instruction (next == NULL)? I.e., should (next != NULL) be an assert or is it
> possible?


It can happen. But this just made me realize that we need to do more here:

The last instruction currently acts as an implicit Goto-instruction. So we need
to update the last_instruction of the block_entry if we want to remove it.

This would mean I need to find the entry corresponding to the current block from
every instruction. Maybe it would be nicer to have an explicit Goto-instruction
instead?

https://chromiumcodereview.appspot.com/10665022/diff/4001/vm/intermediate_lan...
vm/intermediate_language.cc:560: }
On 2012/06/25 15:57:16, srdjan wrote:
> Set successor and previous of this instruction to NULL

Done.

https://chromiumcodereview.appspot.com/10665022/diff/4001/vm/intermediate_lan...
File vm/intermediate_language.h (right):

https://chromiumcodereview.appspot.com/10665022/diff/4001/vm/intermediate_lan...
vm/intermediate_language.h:1763: Instruction* StraightLineSuccessor() const {
return successor_; }
On 2012/06/25 15:57:16, srdjan wrote:
> Since it is a very simple setter now, maybe rename it to successor?

Done.

https://chromiumcodereview.appspot.com/10665022/diff/4001/vm/intermediate_lan...
vm/intermediate_language.h:1766: Instruction* Previous() const { return
previous_; }
On 2012/06/25 15:57:16, srdjan wrote:
> s/Previous/previous/

Done.

Powered by Google App Engine
This is Rietveld 408576698