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

Issue 10824349: Implement class id checks as a separate instruction and add a local CSE optimization pass. (Closed)

Created:
8 years, 4 months ago by Florian Schneider
Modified:
8 years, 4 months ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Implement class id checks as a separate instruction and add a local CSE optimization pass. This CL contains: A new CheckClassComp instruction. Currently it is used only for instance loads: (LoadInstanceFieldComp) A pass LocalCSE that performs block-local common subexpression elimination. To identify redundant expressions I use a hash map per basic block. Computations that do not have side effects can participate in CSE. For now, I only enabled it for CheckClass. Any computation that participates in CSE must implement the AttributesEqual function. Other smaller fixes: Places where we can pass the correct initial size for GrowableArrays that have a known size. We should consider having a FixedLengthArray for this purpose. Made the accessors ic_data() and set_ic_data() use a const ICData*. Committed: https://code.google.com/p/dart/source/detail?r=10948

Patch Set 1 #

Total comments: 28

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+511 lines, -27 lines) Patch
M runtime/vm/code_generator.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/code_generator.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/compiler.cc View 2 chunks +10 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_optimizer.h View 3 chunks +19 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 7 chunks +65 lines, -11 lines 0 comments Download
A runtime/vm/hash_map.h View 1 1 chunk +169 lines, -0 lines 0 comments Download
A runtime/vm/hash_map_test.cc View 1 1 chunk +35 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 11 chunks +68 lines, -7 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 3 chunks +55 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 chunk +41 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 chunk +41 lines, -0 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
8 years, 4 months ago (2012-08-17 13:14:28 UTC) #1
srdjan
LGTM with comments. Once we propagate class-id sets, we could add class checks between two ...
8 years, 4 months ago (2012-08-17 22:30:22 UTC) #2
Florian Schneider
Thanks for the review. http://codereview.chromium.org/10824349/diff/1/runtime/vm/flow_graph_optimizer.cc File runtime/vm/flow_graph_optimizer.cc (right): http://codereview.chromium.org/10824349/diff/1/runtime/vm/flow_graph_optimizer.cc#newcode373 runtime/vm/flow_graph_optimizer.cc:373: } else { On 2012/08/17 ...
8 years, 4 months ago (2012-08-20 12:09:37 UTC) #3
Florian Schneider
8 years, 4 months ago (2012-08-20 12:37:04 UTC) #4
On 2012/08/17 22:30:22, srdjan wrote:
> LGTM with comments.
> 
> Once we propagate class-id sets, we could add class checks between two nodes,
> i.e., all nodes referring to the input of a class check node would now refer
to
> the output of that class check node, and thus we could have check elimination
> across blocks. What do you think?
> 

I think I'll start with across-basic-block elimination today. As a first step,
I'll do a traversal of the dominator tree and use the same hash map to record
redundant computations. That should already work even without having
check-instructions produce a result that is used by the depending instruction.

Powered by Google App Engine
This is Rietveld 408576698