Bug 19803

Summary: Merge multiple loads into a single instruction
Product: WebKit Reporter: Cameron Zwarich (cpst) <zwarich>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mjs
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch that causes regression
none
Patch that improves performance none

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.