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

Issue 6624061: Improve dead phi elimination.... (Closed)

Created:
9 years, 9 months ago by fschneider
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Improve dead phi elimination. This change splits the existing phi elimination into two phases: 1. Remove redundant phis 2. Remove dead phis with a fixed point iteration. The new approach allows us to remove dead phis that are connected in a cycle. Committed: http://code.google.com/p/v8/source/detail?r=7085

Patch Set 1 #

Total comments: 6

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -26 lines) Patch
M src/hydrogen.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/hydrogen.cc View 1 4 chunks +48 lines, -17 lines 0 comments Download
M src/hydrogen-instructions.h View 1 11 chunks +14 lines, -9 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
fschneider
9 years, 9 months ago (2011-03-07 18:16:38 UTC) #1
Kevin Millikin (Chromium)
LGTM. We can optimize the phi GC to avoid extra data lists on the side, ...
9 years, 9 months ago (2011-03-08 08:51:03 UTC) #2
fschneider
9 years, 9 months ago (2011-03-08 10:03:39 UTC) #3
http://codereview.chromium.org/6624061/diff/1/src/hydrogen-instructions.cc
File src/hydrogen-instructions.cc (right):

http://codereview.chromium.org/6624061/diff/1/src/hydrogen-instructions.cc#ne...
src/hydrogen-instructions.cc:936: bool HPhi::HasRealUses() {
On 2011/03/08 08:51:03, Kevin Millikin wrote:
> The boolean variable seems too much:
> 
> for (...) {
>   if (!uses()->at(i)->IsPhi()) return true;
> }
> return false;

Done.

http://codereview.chromium.org/6624061/diff/1/src/hydrogen.cc
File src/hydrogen.cc (right):

http://codereview.chromium.org/6624061/diff/1/src/hydrogen.cc#newcode724
src/hydrogen.cc:724: for (int i = 0; i < uses->length(); ++i) {
On 2011/03/08 08:51:03, Kevin Millikin wrote:
> This pair of loops that copies the uses off to the side drives me nuts.  I
> wonder if we could just write
> 
>   while (!uses->is_empty()) {
>     HValue* use = uses->RemoveLast();
>     if (use != NULL) {
>       phi->ReplaceAtUse(use, value);
>       if (use->IsPhi()) worklist.Add(HPhi::cast(use));
>     }
>   }

Done.

http://codereview.chromium.org/6624061/diff/1/src/hydrogen.h
File src/hydrogen.h (right):

http://codereview.chromium.org/6624061/diff/1/src/hydrogen.h#newcode237
src/hydrogen.h:237: void EliminateDeadPhis();
On 2011/03/08 08:51:03, Kevin Millikin wrote:
> "Dead" is ambiguous.  Maybe "Unreachable" is more accurate (that is, not
> reachable in any use-def chain from the non-phi uses).

Done.

Powered by Google App Engine
This is Rietveld 408576698