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

Issue 8277031: Give uses within a loop a greater weight when doing representation inference. (Closed)

Created:
9 years, 2 months ago by Sven Panne
Modified:
8 years, 10 months ago
CC:
v8-dev
Visibility:
Public.

Description

Give uses within a loop a greater weight when doing representation inference. Uses of a value are weighted by a factor of FLAG_loop_weight (default: 10) for every loop they are in. This makes uses in inner loops "more important", which should improve the result of the representation inference. Committed: https://code.google.com/p/v8/source/detail?r=10573

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -2 lines) Patch
M src/flag-definitions.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/hydrogen.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/hydrogen-instructions.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/hydrogen-instructions.cc View 2 chunks +14 lines, -1 line 2 comments Download

Messages

Total messages: 3 (0 generated)
Sven Panne
In theory, this should improve some benchmarks, and have at least no negative effects on ...
9 years, 2 months ago (2011-10-14 09:11:06 UTC) #1
fschneider
lgtm. Have you tried other values than 10? I'm not sure if we actually need ...
8 years, 11 months ago (2012-01-27 22:33:24 UTC) #2
Sven Panne
8 years, 10 months ago (2012-01-30 07:51:04 UTC) #3
Currently Golem is still extremely flaky, so I have a slightly uneasy feeling
about enabling this by default. Nevertheless, I think that accounting for loops
in the representation inference somehow is the way to go. Therefore I propose
the following: Let's change the default weight to 1, effectively disabling
things, and play around with the weights a bit until we are sure what a good
value is. Then we can replace the command line flag by a constant and simplify
the code a bit.

Does that sound reasonable?

https://chromiumcodereview.appspot.com/8277031/diff/1/src/hydrogen-instructio...
File src/hydrogen-instructions.cc (right):

https://chromiumcodereview.appspot.com/8277031/diff/1/src/hydrogen-instructio...
src/hydrogen-instructions.cc:77: static const int weights[] = { 1, w, w*w,
w*w*w, w*w*w*w };
On 2012/01/27 22:33:24, fschneider wrote:
> I think no need for static here. Actually, I'd also be fine with hard-coding
the
> weight to 10 here, so that the compiler can inline the constants. Once set, we
> probably don't need to change it often.

Well, initializing the array every time wouldn't be very cool, either, so I went
for a 'static' (What I really wanted to write is 'iterate (*w) 1' ;-).  But
you're right, when we figured out a sensible weight, we should probably change
this to a simple switch on block()->LoopNestingDepth() and use a real constant.

Powered by Google App Engine
This is Rietveld 408576698