Closed
Bug 459755
Opened 17 years ago
Closed 17 years ago
TM: Support LIR_merge
Categories
(Core :: JavaScript Engine, enhancement)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: gal, Unassigned)
Details
Attachments
(1 file)
|
5.21 KB,
patch
|
Details | Diff | Splinter Review |
It would be nice to be able to merge results after a branch without having to go through memory. A limited form might be sufficient, i.e. LIR_merge sets the register assignment for both arguments to the same register, but requires both values to be defined immediately before LIR_merge along the two incoming control-flow edges to make sure there are no spills interfering. Any ideas?
Updated•17 years ago
|
Severity: normal → enhancement
Comment 1•17 years ago
|
||
is LIR_merge(a,b) semantically the same as phi(a,b)?
| Reporter | ||
Updated•17 years ago
|
Summary: TM: Remove LIR_loop and replace with LIR_merge → TM: Support LIR_merge
| Reporter | ||
Comment 2•17 years ago
|
||
| Reporter | ||
Comment 3•17 years ago
|
||
Ed, what do you think about this approach? We basically use the stack whenever we want to merge values after a jump. So boxing for example would look like this:
if !fits_in_jsint(i) goto x;
push (i)
goto y;
x:
push(call box_as_double(i))
y:
jsval = pop()
Push and pop are very fast on x86, so even performance should be alright.
Comment 4•17 years ago
|
||
is this faster than:
t = LIR_alloc 4 // or 8
if !fits_in_jsint(i) goto x;
store i, t[0]
goto y;
x:
d = call box_as_double(i)
store d, t[0]
y:
jsval = ld t[0]
iow are push/pop better than store/load? really?
i mean, sure, i get that its not great to have to store to memory, but both of these store to memory. so it comes down to push/pop vs store/load, right? what other considerations are there?
my (weak, very weak) concerns about push/pop are just that they now introduce an explicit stack pointer into LIR semantics, i'm not sure but are we making trouble for ourselves for writing lir manipulation code, that now has to learn about push/pop and stack modelling.
| Reporter | ||
Comment 5•17 years ago
|
||
Not having run any benchmarks on this, I am reasonably certain push/pop are crazy fast on x86. At the very least we save ourselves some register pressure. That having said, I like the LIR_alloc solution as well. We are losing massive performance due to the builtin call right now. Anything but that is an improvement, so I think I will go your route and once we are at the end of that route and need still better code we revisit this bug. I will mask wontfix in the meantime.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Comment 6•17 years ago
|
||
I am hoping that once i get time to work on LIR_def/use, that will give us a nice replacement for LIR_alloc/st/ld, that can keep things in registers.
| Reporter | ||
Comment 7•17 years ago
|
||
The generate code looks pretty reasonable to be honest, and since the slow path contains a call most registers end up getting spilled anyway.
You need to log in
before you can comment on or make changes to this bug.
Description
•