How to enable turboshaft in v8_unittests?

24 views
Skip to first unread message

yahan lu

unread,
May 30, 2024, 5:07:07 AMMay 30
to v8-dev
I want to run instruction-selector-riscv64-unittest  in   turboshaft.

yahan lu

unread,
May 30, 2024, 5:16:14 AMMay 30
to v8-dev
```
DEFINE_BOOL(turboshaft, true, "enable TurboFan's Turboshaft phases for JS")
```
v8 enbale turboshaft. But don't run instruction-selector test in turboshaft mode

yahan lu

unread,
May 30, 2024, 5:26:58 AMMay 30
to v8-dev
I think i should port turboshaft-instruction-selector-unittest into instruction-selector-xxx-unittests

Nico Hartmann

unread,
Jun 3, 2024, 1:16:18 AMJun 3
to v8-...@googlegroups.com
Hi,

First of all, a small detail here that might be important: The --turboshaft flag (enabled by default) runs the a large section of the compilation pipeline (up to, but excluding instruction selection) using the new Turboshaft infrastructure. In order to run instruction selection on the Turboshaft CFG produced by the pipeline, the --turboshaft-instruction-selection flag (also enabled by default now) must be set. Otherwise we convert back to the old TurboFan sea-of-nodes graph and select on this. We will drop this fallback solution in the near future, though.

Now, when it comes to the instruction selector unit tests, those cannot just be flipped by providing those flags as they are specifically built for TurboFan. Those need some adjustment to run with the Turboshaft instruction selection. For an example see the port of the x64 unit tests in turboshaft-instruction-selector-x64-unittest.cc.

Hope that helps,
Nico


--
--
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/b1c016e8-fc94-4967-a95c-21b1b916707en%40googlegroups.com.


--
Nico Hartmann | Software Engineer | nicoha...@google.com | Chrome - V8

Matthias Liedtke

unread,
Jun 3, 2024, 1:16:18 AMJun 3
to v8-...@googlegroups.com
Hi,

I think you'll have to copy it over into a new file, then replace InstructionSelectorTestWithParam with TurboshaftInstructionSelectorTestWithParam and adapt all the graph building blocks with their turboshaft equivalents.
Darius has done some prior work here and ported most of the x64 unittests which should give a good overview on this.

Best regards,
Matthias

On Thu, May 30, 2024 at 11:27 AM yahan lu <luyah...@gmail.com> wrote:

dmerc...@google.com

unread,
Jun 3, 2024, 2:41:02 AMJun 3
to v8-dev
Hi there,

Nico and Matthias said it all already pretty much, but, for completeness and to give an example, here are the CLs that ported the x64 instruction selector unit tests:

Cheers,
Darius

Reply all
Reply to author
Forward
0 new messages