Closed
Bug 1124377
Opened 10 years ago
Closed 10 years ago
Try to provide scratch registers for memory->memory MoveGroup moves
Categories
(Core :: JavaScript Engine: JIT, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: bhackett1024, Assigned: bhackett1024)
References
Details
Attachments
(1 file)
|
15.57 KB,
patch
|
sunfish
:
review+
|
Details | Diff | Splinter Review |
Even after bug 1123874, on x86 the backtracking allocator still does a fair number of memory->memory moves in movegroups, which are implemented using push/pop instructions on stack locations. This is done because there is no scratch register available on x86, but in many of these move groups there happens to be some register that is not currently live, and could be used as a scratch register.
The attached patch makes this change. A new pass is added to the backtracking allocator which only runs on x86 and looks at every move group to see if they can be marked with a scratch register that is not allocated at the point of the move group or by intervals involved in the group. This scratch register is then used by the move emitter to avoid push/pop instructions during memory->memory moves.
After bug 1123874, on x86 octane-mandreel this eliminates all remaining memory->memory push/pops which are executed when using the backtracking allocator. This improves the score from 27500 to 29700, just shy of LSRA at 30100 or so.
Attachment #8552652 -
Flags: review?(sunfish)
Comment 1•10 years ago
|
||
Comment on attachment 8552652 [details] [diff] [review]
patch
Review of attachment 8552652 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/LIR-Common.h
@@ +108,5 @@
> {
> js::Vector<LMove, 2, JitAllocPolicy> moves_;
>
> + // Optional general register available for use when executing moves.
> + LAllocation scratchRegister_;
It looks like this field can be guarded by #ifdef JS_CODEGEN_X86.
@@ +140,5 @@
> + void setScratchRegister(Register reg) {
> + scratchRegister_ = LGeneralReg(reg);
> + }
> + LAllocation maybeScratchRegister() {
> + return scratchRegister_;
When !defined(JS_CODEGEN_X86), this can just return LAllocation().
Attachment #8552652 -
Flags: review?(sunfish) → review+
| Assignee | ||
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 4•10 years ago
|
||
This patch was a 4.3% win on Octane-zlib and puts SM back in the lead. Nice!
You need to log in
before you can comment on or make changes to this bug.
Description
•