Bug 19803 - Merge multiple loads into a single instruction
Summary: Merge multiple loads into a single instruction
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-28 16:21 PDT by Cameron Zwarich (cpst)
Modified: 2008-09-04 00:58 PDT (History)
1 user (show)

See Also:


Attachments
Patch that causes regression (6.13 KB, patch)
2008-06-28 16:24 PDT, Cameron Zwarich (cpst)
no flags Details | Formatted Diff | Diff
Patch that improves performance (6.04 KB, patch)
2008-06-29 20:14 PDT, Cameron Zwarich (cpst)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Zwarich (cpst) 2008-06-28 16:21:37 PDT
Since (load, load) is one of the most common instruction pairs on SunSpider and load has one of the smallest instruction bodies, this sounds like a good idea. However, all of my attempts to implement it lead to massive regressions on SunSpider, even if I don't even use the opcode. This points to a random GCC problem, so I'll post the code to see if we can fix it together.
Comment 1 Cameron Zwarich (cpst) 2008-06-28 16:24:21 PDT
Created attachment 21990 [details]
Patch that causes regression

Here is a patch that causes a performance regression of about 8% on SunSpider, despite the opcode not even being used. I originally had the opcode after op_load, but even moving it near the end didn't fix the regression.
Comment 2 Cameron Zwarich (cpst) 2008-06-29 19:47:41 PDT
The same thing happens with op_mov2.
Comment 3 Cameron Zwarich (cpst) 2008-06-29 20:14:03 PDT
Created attachment 22001 [details]
Patch that improves performance

I changed the code to evade GCC and now get a 0.2% progression. Maybe I could do better if I moved the opcode elsewhere?
Comment 4 Cameron Zwarich (cpst) 2008-09-04 00:58:22 PDT
This optimization was performed by different means in bug 20286.