Open Bug 772265 Opened 12 years ago Updated 2 years ago

IonMonkey: Redundant movegroups in loop backedge

Categories

(Core :: JavaScript Engine: JIT, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: sstangl, Unassigned)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [ion:t])

Attachments

(2 files)

Register allocation displays local silliness on a small allocation benchmark from dvander, related to earley-boyer. In the attached PNG image of the LIR after regalloc, Block 26 contains the following instructions:

(%esi is the loop counter)

> movegroup ()[=esi -> =eax]
> addi ([i:62 (=eax)]) (=eax), (c)
> movegroup ()[=eax -> =esi]

This is done in order to preserve the original value in a register in the case of bailout. 
We could trivially save a register move by reversing the logic to instead allocate a register for purposes of preserving the original value:

> movegroup ()[=esi -> =eax]
> addi (i:62 (=esi)]) (=esi), (c)

(Range analysis should also let us know that the add in question is infallible.)
Attached file Benchmark used.
Assignee: general → nobody
Component: JavaScript Engine → JavaScript Engine: JIT
Blocks: 1701164
Blocks: sm-regalloc
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: