Propose to lower Store IR

27 views
Skip to first unread message

manji...@gmail.com

unread,
Dec 1, 2019, 10:42:54 PM12/1/19
to v8-dev
Currently, the Store IR has the barrier built-in, like Store[(kRepTaggedSigned : NoWriteBarrier)](10, 43, 46, 36, 59).
And rely one the OutOfLineRecordWrite to lower the barrier.

Should we change it into simple Store without any built-in, and call RecordWrite builtin using turbofan?
That approach will make RecordWrite's calling convention more consistent, rather than saving all the float-points registers itself or restrict the register allocation.


Yang Guo

unread,
Dec 2, 2019, 8:35:40 AM12/2/19
to v8-...@googlegroups.com, Michael Stanton, Tobias Tebbi, Georg Neis

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/70d469ee-4ab7-452e-a5f8-04a80c438a5c%40googlegroups.com.

Tobias Tebbi

unread,
Dec 2, 2019, 8:44:45 AM12/2/19
to Yang Guo, v8-...@googlegroups.com, Michael Stanton, Georg Neis
Of course, it would be more uniform if we didn't use a different calling convention for RecordWrite, but it's important for both performance on the fast-path and generated code size:
By using a mostly callee-save calling convention, we can avoid many spills and unspills in generated code and do them instead in the slow-path of the RecordWrite builtin.
We don't generally support a callee-saved calling convention since it's difficult to support that in the presence of GC-triggering calls, but RecordWrite can never trigger allocation, so it's easier to do a callee-saved calling convention there. The restricted register allocation is essentially a hack to ensure that most registers are not modified by RecordWrite while still using Turbofan to generate the code.

manji...@gmail.com

unread,
Dec 2, 2019, 10:18:38 AM12/2/19
to v8-dev
Current implementation stores all the registers used as parameters before the call, then restores after the call.
If it's a turbofan call, we may get a chance to tell the register allocated that the registers as parameters get clobbered. That may generate better code. And that's what I have done in my llvm turbofan compiler.

manji...@gmail.com

unread,
Dec 2, 2019, 10:19:41 AM12/2/19
to v8-dev
the register allocator, sorry.

manji...@gmail.com

unread,
Dec 2, 2019, 10:32:09 AM12/2/19
to v8-dev
And for other case, like a function only uses one float point register, and the RecordWrite has to save all the float point registers except C's csr.
Reply all
Reply to author
Forward
0 new messages