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

Issue 10879036: Compute the def-use list on-demand by walking the dominator tree. (Closed)

Created:
8 years, 4 months ago by zerny-google
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Compute the def-use list on-demand by walking the dominator tree. This replaces the previous implementation that maintained the def-use lists. R=vegorov@google.com,kmillikin@google.com Committed: https://code.google.com/p/dart/source/detail?r=11241

Patch Set 1 #

Total comments: 12

Patch Set 2 : Update from reviews. #

Patch Set 3 : TODOs #

Patch Set 4 : Unneeded include. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+236 lines, -173 lines) Patch
M runtime/vm/compiler.cc View 1 2 2 chunks +8 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph.cc View 1 3 chunks +141 lines, -8 lines 3 comments Download
M runtime/vm/flow_graph_allocator.cc View 1 chunk +1 line, -4 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 2 4 chunks +4 lines, -10 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 16 chunks +38 lines, -61 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 5 chunks +43 lines, -57 lines 0 comments Download
M runtime/vm/intermediate_language_test.cc View 1 2 3 1 chunk +0 lines, -30 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
zerny-google
Hopefully this marks the end of the def-use list triathlon.
8 years, 4 months ago (2012-08-23 12:27:23 UTC) #1
Kevin Millikin (Google)
LGTM, with some comments below. https://chromiumcodereview.appspot.com/10879036/diff/1/runtime/vm/flow_graph.cc File runtime/vm/flow_graph.cc (right): https://chromiumcodereview.appspot.com/10879036/diff/1/runtime/vm/flow_graph.cc#newcode155 runtime/vm/flow_graph.cc:155: static void ComputeUsesInBlock(BlockEntryInstr* block) ...
8 years, 4 months ago (2012-08-23 13:35:34 UTC) #2
Vyacheslav Egorov (Google)
lgtm I am concerned however that use lists are not maintained automatically and transparently. The ...
8 years, 4 months ago (2012-08-23 13:51:10 UTC) #3
zerny-google
On 2012/08/23 13:51:10, Vyacheslav Egorov (Google) wrote: > lgtm > > I am concerned however ...
8 years, 4 months ago (2012-08-23 14:07:37 UTC) #4
zerny-google
Update based on your reviews. https://chromiumcodereview.appspot.com/10879036/diff/1/runtime/vm/flow_graph.cc File runtime/vm/flow_graph.cc (right): https://chromiumcodereview.appspot.com/10879036/diff/1/runtime/vm/flow_graph.cc#newcode147 runtime/vm/flow_graph.cc:147: use->set_instruction(instr); On 2012/08/23 13:51:10, ...
8 years, 4 months ago (2012-08-23 16:11:20 UTC) #5
Kevin Millikin (Google)
8 years, 4 months ago (2012-08-24 08:53:05 UTC) #6
OK, LGTM.  It seems like a good idea to keep the verification asserts after all.

https://chromiumcodereview.appspot.com/10879036/diff/4002/runtime/vm/flow_gra...
File runtime/vm/flow_graph.cc (right):

https://chromiumcodereview.appspot.com/10879036/diff/4002/runtime/vm/flow_gra...
runtime/vm/flow_graph.cc:71: class DefUseCleanup : public FlowGraphVisitor {
While it's a noun, this isn't a very tangible name for the class.

I think it's fine to just make it a free function that iterates blocks (in any
order) and instructions in each block.

You could also consider replacing the CleanupInstruction function with virtual
functions on the instruction classes.  The mutually exclusive AsJoinEntry,
AsDefinition is a bit distracting.

https://chromiumcodereview.appspot.com/10879036/diff/4002/runtime/vm/flow_gra...
runtime/vm/flow_graph.cc:75: void CleanupInstruction(Instruction* instr) {
I like "ResetInstruction" slightly better.  Cleanup sounds a bit like something
that goes after an algorithm, not before.

https://chromiumcodereview.appspot.com/10879036/diff/4002/runtime/vm/flow_gra...
runtime/vm/flow_graph.cc:91: use->set_instruction(NULL);
Here you could just use a virtual Reset function on values:

for (...) {
  instr->InputAt(i)->Reset();
}

Powered by Google App Engine
This is Rietveld 408576698