[turboshaft] Add verification pass for load/store MemoryRepresentation [v8/v8 : main]

0 views
Skip to first unread message

Darius Mercadier (Gerrit)

unread,
Nov 7, 2025, 10:49:41 AM (12 days ago) Nov 7
to Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Nico Hartmann

Darius Mercadier added 2 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Darius Mercadier . resolved

PTAL! (feel free to take your time: I'm out next week, and I don't plan on landing before I'm back)

File src/flags/flag-definitions.h
Line 1746, Patchset 1:DEFINE_BOOL(turboshaft_load_store_verification, true,
Darius Mercadier . unresolved

TODO: make experimental before landing.

Open in Gerrit

Related details

Attention is currently required from:
  • Nico Hartmann
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 3
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Fri, 07 Nov 2025 15:49:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Gomes (Gerrit)

unread,
Nov 18, 2025, 4:13:01 AM (yesterday) Nov 18
to Darius Mercadier, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Darius Mercadier and Nico Hartmann

Victor Gomes added 5 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Victor Gomes . resolved

LGTM % comments, nits and red bot...

File src/compiler/turboshaft/code-elimination-and-simplification-phase.cc
Line 29, Patchset 5 (Latest):#ifdef DEBUG
Victor Gomes . unresolved

Nit: Not sure if it is possible, but one could avoid the #ifdefs here if we define an empty reducer for non-debug builds, since we already do a #ifdef around the definition of the class anyways. The compiler should be able to ignore it...

File src/compiler/turboshaft/load-store-verification-reducer.h
Line 71, Patchset 5 (Latest): is_wrong = __ Word32Equal(__ IsSmi(V<Object>::Cast(value)), 0);
Victor Gomes . unresolved

I guess TS doesn't have a not operation ?

Line 62, Patchset 5 (Latest): if (expected_repr != any_of(MemoryRepresentation::TaggedSigned(),
MemoryRepresentation::TaggedPointer())) {
return;
}
Victor Gomes . unresolved

Why can we not check for other representations?

File src/compiler/turboshaft/machine-lowering-reducer-inl.h
Line 3838, Patchset 5 (Latest):#if V8_COMPRESS_POINTERS
__ Word32Constant(0), MemoryRepresentation::Uint32(),
#else
__ WordPtrConstant(0), MemoryRepresentation::UintPtr(),

#endif
Victor Gomes . unresolved

Nit: I guess a follow up: we could have a CompressPtr type. So this would be
`__ CompressPtrConstant(0), MemoryRepresentation::CompressPtr()` .

Open in Gerrit

Related details

Attention is currently required from:
  • Darius Mercadier
  • Nico Hartmann
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 5
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 09:12:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Gomes (Gerrit)

unread,
Nov 18, 2025, 4:30:21 AM (yesterday) Nov 18
to Darius Mercadier, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Darius Mercadier and Nico Hartmann

Victor Gomes added 1 comment

File src/compiler/turboshaft/load-store-verification-reducer.h
Line 62, Patchset 5: if (expected_repr != any_of(MemoryRepresentation::TaggedSigned(),
MemoryRepresentation::TaggedPointer())) {
return;
}
Victor Gomes . resolved

Why can we not check for other representations?

Victor Gomes

Edit: Right, you are just checking sminess...

Open in Gerrit

Related details

Attention is currently required from:
  • Darius Mercadier
  • Nico Hartmann
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 6
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 09:30:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Victor Gomes <victo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Darius Mercadier (Gerrit)

unread,
Nov 18, 2025, 4:39:33 AM (yesterday) Nov 18
to Victor Gomes, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Nico Hartmann and Victor Gomes

Darius Mercadier added 5 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Darius Mercadier . resolved

Thanks for the comments, Victor :)

File src/compiler/turboshaft/code-elimination-and-simplification-phase.cc
Line 29, Patchset 5:#ifdef DEBUG
Victor Gomes . resolved

Nit: Not sure if it is possible, but one could avoid the #ifdefs here if we define an empty reducer for non-debug builds, since we already do a #ifdef around the definition of the class anyways. The compiler should be able to ignore it...

Darius Mercadier

That's indeed possible: nothing prevents us from defining an empty reducer and it will just be ignored by the reductions. It will still show up in the reducer stack (and stack traces if something goes wrong).
I personally would prefer not doing that though, because we then have this reducer that shows up in the stack trace / reducer stack, and it would be confusing to realize that it's actually empty.

File src/compiler/turboshaft/load-store-verification-reducer.h
Line 71, Patchset 5: is_wrong = __ Word32Equal(__ IsSmi(V<Object>::Cast(value)), 0);
Victor Gomes . resolved

I guess TS doesn't have a not operation ?

Darius Mercadier

We have a Word32BitwiseNot helper (which lowers to BitwiseXor(-1)), but this isn't what we want since it will turn both 1 and 0 into non-0. We'd need something to just flip the lowermost bit, and we don't have any operation that does this.

Line 62, Patchset 5: if (expected_repr != any_of(MemoryRepresentation::TaggedSigned(),
MemoryRepresentation::TaggedPointer())) {
return;
}
Victor Gomes . resolved

Why can we not check for other representations?

Darius Mercadier

For Loads, other representations dictate what we load, so there is nothing to be verified (ie, if the MemRep is Float64, then we'll emit a Float64 load so of course what we load is going to be a Float64). Unlike TaggedSigned/TaggedPointer where we just do the same Tagged load in both cases.

For Stores, we have verification when building an operation that the inputs have the right representation (this is done by ValidateOpInputRep). So if we have a Store with a Float64 rep and we pass it a Word32, then this other verification will already fail. But once again, this verification doesn't know the difference between TaggedSigned and TaggedPointer.

File src/compiler/turboshaft/machine-lowering-reducer-inl.h
Line 3838, Patchset 5:#if V8_COMPRESS_POINTERS

__ Word32Constant(0), MemoryRepresentation::Uint32(),
#else
__ WordPtrConstant(0), MemoryRepresentation::UintPtr(),

#endif
Victor Gomes . resolved

Nit: I guess a follow up: we could have a CompressPtr type. So this would be
`__ CompressPtrConstant(0), MemoryRepresentation::CompressPtr()` .

Darius Mercadier

Maybe, but I'm not a huge fan of having a CompressPtr thingy existing on non-compress-ptr builds... But I do agree that this #if/#else isn't pretty, so what you suggest might still be better.. I'll think about it 😊

Open in Gerrit

Related details

Attention is currently required from:
  • Nico Hartmann
  • Victor Gomes
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 6
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Attention: Victor Gomes <victo...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 09:39:29 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Gomes (Gerrit)

unread,
Nov 18, 2025, 4:56:48 AM (yesterday) Nov 18
to Darius Mercadier, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Darius Mercadier and Nico Hartmann

Victor Gomes added 1 comment

File src/compiler/turboshaft/machine-lowering-reducer-inl.h
Line 3838, Patchset 5:#if V8_COMPRESS_POINTERS
__ Word32Constant(0), MemoryRepresentation::Uint32(),
#else
__ WordPtrConstant(0), MemoryRepresentation::UintPtr(),

#endif
Victor Gomes . resolved

Nit: I guess a follow up: we could have a CompressPtr type. So this would be
`__ CompressPtrConstant(0), MemoryRepresentation::CompressPtr()` .

Darius Mercadier

Maybe, but I'm not a huge fan of having a CompressPtr thingy existing on non-compress-ptr builds... But I do agree that this #if/#else isn't pretty, so what you suggest might still be better.. I'll think about it 😊

Victor Gomes

Maybe it should be called `HeapPtr` then? Aka, a pointer to the heap that is compress in compress builds and uncompressed otherwise...

Open in Gerrit

Related details

Attention is currently required from:
  • Darius Mercadier
  • Nico Hartmann
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 6
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 09:56:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Darius Mercadier <dmerc...@chromium.org>
Comment-In-Reply-To: Victor Gomes <victo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Darius Mercadier (Gerrit)

unread,
Nov 18, 2025, 6:12:00 AM (yesterday) Nov 18
to Daniel Lehmann, Thibaud Michaud, Victor Gomes, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Nico Hartmann

Darius Mercadier added 1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Darius Mercadier . resolved

Daniel and Thibaud, any ideas about the red Windows bot that crashes in the register allocator? :/

Open in Gerrit

Related details

Attention is currently required from:
  • Nico Hartmann
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 7
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 11:11:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Lehmann (Gerrit)

unread,
Nov 18, 2025, 6:15:11 AM (yesterday) Nov 18
to Darius Mercadier, Thibaud Michaud, Victor Gomes, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Darius Mercadier and Nico Hartmann

Daniel Lehmann added 1 comment

Patchset-level comments
Darius Mercadier . resolved

Daniel and Thibaud, any ideas about the red Windows bot that crashes in the register allocator? :/

Daniel Lehmann

Unfortunately nothing comes to mind, but blame points to a CL in March 2025 https://source.chromium.org/chromium/chromium/src/+/main:v8/src/compiler/backend/register-allocator.cc;drc=f2058273f7e288855825ed6755bcf1d70224d25c;l=1503 with https://crrev.com/c/6336030, maybe Thibaud remembers more from then.

Open in Gerrit

Related details

Attention is currently required from:
  • Darius Mercadier
  • Nico Hartmann
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 7
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 11:15:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Darius Mercadier <dmerc...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Thibaud Michaud (Gerrit)

unread,
Nov 18, 2025, 8:51:06 AM (24 hours ago) Nov 18
to Darius Mercadier, Daniel Lehmann, Victor Gomes, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Daniel Lehmann, Darius Mercadier and Nico Hartmann

Thibaud Michaud added 1 comment

Patchset-level comments
Darius Mercadier . resolved

Daniel and Thibaud, any ideas about the red Windows bot that crashes in the register allocator? :/

Daniel Lehmann

Unfortunately nothing comes to mind, but blame points to a CL in March 2025 https://source.chromium.org/chromium/chromium/src/+/main:v8/src/compiler/backend/register-allocator.cc;drc=f2058273f7e288855825ed6755bcf1d70224d25c;l=1503 with https://crrev.com/c/6336030, maybe Thibaud remembers more from then.

Thibaud Michaud

I don't see a direct connection between the CL and the DCHECK at first glance so I'll have to take a closer look.
Until then a quick explanation of the DCHECK failure: it means that an instruction is using a non-allocatable register as a fixed input or output, which is generally not allowed. At least one place that relies on this assumption is spilling: regalloc only considers allocatable registers for spilling, so the corresponding virtual register would not be handled correctly.
It could be that there are specific case where this assumption can be relaxed. The CL that Daniel linked already relaxed it to allow temporaries to be non-allocatable for example.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Lehmann
  • Darius Mercadier
  • Nico Hartmann
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 7
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Tue, 18 Nov 2025 13:51:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Darius Mercadier <dmerc...@chromium.org>
Comment-In-Reply-To: Daniel Lehmann <dleh...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Thibaud Michaud (Gerrit)

unread,
Nov 18, 2025, 10:22:41 AM (22 hours ago) Nov 18
to Darius Mercadier, Daniel Lehmann, Victor Gomes, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Daniel Lehmann, Darius Mercadier and Nico Hartmann

Thibaud Michaud added 1 comment

Patchset-level comments
Darius Mercadier . resolved

Daniel and Thibaud, any ideas about the red Windows bot that crashes in the register allocator? :/

Daniel Lehmann

Unfortunately nothing comes to mind, but blame points to a CL in March 2025 https://source.chromium.org/chromium/chromium/src/+/main:v8/src/compiler/backend/register-allocator.cc;drc=f2058273f7e288855825ed6755bcf1d70224d25c;l=1503 with https://crrev.com/c/6336030, maybe Thibaud remembers more from then.

Thibaud Michaud

I don't see a direct connection between the CL and the DCHECK at first glance so I'll have to take a closer look.
Until then a quick explanation of the DCHECK failure: it means that an instruction is using a non-allocatable register as a fixed input or output, which is generally not allowed. At least one place that relies on this assumption is spilling: regalloc only considers allocatable registers for spilling, so the corresponding virtual register would not be handled correctly.
It could be that there are specific case where this assumption can be relaxed. The CL that Daniel linked already relaxed it to allow temporaries to be non-allocatable for example.

Thibaud Michaud

I was able to repro and investigate on a windows virtual machine.
The issue is with the RecordWriteSaveFP builtin. There is a call instruction there at pos 75, presumably introduced by this change, that takes an argument in rbx. The problem is that the builtin uses a restricted set of allocatable registers, defined here I think:
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/codegen/x64/interface-descriptors-x64-inl.h;drc=2e71cd722cd12b2a1f9dfe30dfc09f6eea469c34;l=54

and indeed rbx is not in the list on Windows.

Gerrit-Comment-Date: Tue, 18 Nov 2025 15:22:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Darius Mercadier <dmerc...@chromium.org>
Comment-In-Reply-To: Thibaud Michaud <thib...@chromium.org>
Comment-In-Reply-To: Daniel Lehmann <dleh...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Darius Mercadier (Gerrit)

unread,
7:45 AM (1 hour ago) 7:45 AM
to Daniel Lehmann, Thibaud Michaud, Victor Gomes, Nico Hartmann, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Daniel Lehmann, Nico Hartmann and Thibaud Michaud

Darius Mercadier added 2 comments

Patchset-level comments
Darius Mercadier . resolved

Daniel and Thibaud, any ideas about the red Windows bot that crashes in the register allocator? :/

Daniel Lehmann

Unfortunately nothing comes to mind, but blame points to a CL in March 2025 https://source.chromium.org/chromium/chromium/src/+/main:v8/src/compiler/backend/register-allocator.cc;drc=f2058273f7e288855825ed6755bcf1d70224d25c;l=1503 with https://crrev.com/c/6336030, maybe Thibaud remembers more from then.

Thibaud Michaud

I don't see a direct connection between the CL and the DCHECK at first glance so I'll have to take a closer look.
Until then a quick explanation of the DCHECK failure: it means that an instruction is using a non-allocatable register as a fixed input or output, which is generally not allowed. At least one place that relies on this assumption is spilling: regalloc only considers allocatable registers for spilling, so the corresponding virtual register would not be handled correctly.
It could be that there are specific case where this assumption can be relaxed. The CL that Daniel linked already relaxed it to allow temporaries to be non-allocatable for example.

Thibaud Michaud

I was able to repro and investigate on a windows virtual machine.
The issue is with the RecordWriteSaveFP builtin. There is a call instruction there at pos 75, presumably introduced by this change, that takes an argument in rbx. The problem is that the builtin uses a restricted set of allocatable registers, defined here I think:
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/codegen/x64/interface-descriptors-x64-inl.h;drc=2e71cd722cd12b2a1f9dfe30dfc09f6eea469c34;l=54

and indeed rbx is not in the list on Windows.

Darius Mercadier

Great find, thanks a lot, Thibaud :)

I've fixed this by not doing the runtime call when compiling functions that aren't allowed to use all general purpose registers.

File-level comment, Patchset 14 (Latest):
Darius Mercadier . resolved

PTAL, Nico :)

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Lehmann
  • Nico Hartmann
  • Thibaud Michaud
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 14
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Thibaud Michaud <thib...@chromium.org>
Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Attention: Nico Hartmann <nicoha...@chromium.org>
Gerrit-Comment-Date: Wed, 19 Nov 2025 12:45:01 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Nico Hartmann (Gerrit)

unread,
7:55 AM (1 hour ago) 7:55 AM
to Darius Mercadier, Daniel Lehmann, Thibaud Michaud, Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Daniel Lehmann, Darius Mercadier and Thibaud Michaud

Nico Hartmann voted and added 2 comments

Votes added by Nico Hartmann

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 14:
Nico Hartmann . resolved

LGTM % comment

File src/compiler/turboshaft/pipelines.h
Line 59, Patchset 14: Pipeline(PipelineData* data, const Linkage* linkage) : data_(data) {
Nico Hartmann . unresolved

I really don't like it that the linkage is an argument to the `Pipeline`. Can't we make this a field on the `PipelineData`? I am pretty sure this should already be there somewhere.

Edit: I see that currently we always pass in the `Linkage` to the functions on the `Pipeline`. Maybe we should change this also at some point.

If you feel like there is no easy alternative to putting this onto the pipeline, I'm okay with leaving it there for now, but please put a TODO at least. Thanks

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Lehmann
  • Darius Mercadier
  • Thibaud Michaud
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 14
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Attention: Thibaud Michaud <thib...@chromium.org>
Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Comment-Date: Wed, 19 Nov 2025 12:55:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Nico Hartmann (Gerrit)

unread,
7:56 AM (1 hour ago) 7:56 AM
to Darius Mercadier, Daniel Lehmann, Thibaud Michaud, Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Daniel Lehmann, Darius Mercadier and Thibaud Michaud

Nico Hartmann voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Lehmann
  • Darius Mercadier
  • Thibaud Michaud
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
Gerrit-Change-Number: 7130227
Gerrit-PatchSet: 15
Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
Gerrit-CC: Victor Gomes <victo...@chromium.org>
Gerrit-Attention: Darius Mercadier <dmerc...@chromium.org>
Gerrit-Attention: Thibaud Michaud <thib...@chromium.org>
Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
Gerrit-Comment-Date: Wed, 19 Nov 2025 12:56:07 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Darius Mercadier (Gerrit)

unread,
8:13 AM (19 minutes ago) 8:13 AM
to Nico Hartmann, Daniel Lehmann, Thibaud Michaud, Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Daniel Lehmann and Thibaud Michaud

Darius Mercadier voted and added 3 comments

Votes added by Darius Mercadier

Commit-Queue+2

3 comments

Patchset-level comments
File-level comment, Patchset 15:
Darius Mercadier . resolved

Thanks :)

File src/compiler/turboshaft/pipelines.h
Line 59, Patchset 14: Pipeline(PipelineData* data, const Linkage* linkage) : data_(data) {
Nico Hartmann . resolved

I really don't like it that the linkage is an argument to the `Pipeline`. Can't we make this a field on the `PipelineData`? I am pretty sure this should already be there somewhere.

Edit: I see that currently we always pass in the `Linkage` to the functions on the `Pipeline`. Maybe we should change this also at some point.

If you feel like there is no easy alternative to putting this onto the pipeline, I'm okay with leaving it there for now, but please put a TODO at least. Thanks

Darius Mercadier

So this CL adds the Linkage field to PipelineData, but the reason why it's set from Pipeline is to avoid forgetting setting it where it's needed. I didn't find a clean way to do this otherwise.

I was planning to remove all the passing around of Linkage in a follow up, now that it's easier to access through PipelineData. While I'm at it I'll try a bit harder to make Linkage an non-optional parameter of the PipelineData constructor :)

File src/flags/flag-definitions.h
Line 1746, Patchset 1:DEFINE_BOOL(turboshaft_load_store_verification, true,
Darius Mercadier . resolved

TODO: make experimental before landing.

Darius Mercadier

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Lehmann
  • Thibaud Michaud
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
    Gerrit-Change-Number: 7130227
    Gerrit-PatchSet: 15
    Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
    Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
    Gerrit-CC: Victor Gomes <victo...@chromium.org>
    Gerrit-Attention: Thibaud Michaud <thib...@chromium.org>
    Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-Comment-Date: Wed, 19 Nov 2025 13:13:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Darius Mercadier <dmerc...@chromium.org>
    Comment-In-Reply-To: Nico Hartmann <nicoha...@chromium.org>
    satisfied_requirement
    open
    diffy

    Darius Mercadier (Gerrit)

    unread,
    8:13 AM (19 minutes ago) 8:13 AM
    to Nico Hartmann, Daniel Lehmann, Thibaud Michaud, Victor Gomes, V8 LUCI CQ, dmercadi...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com, victorgo...@chromium.org
    Attention needed from Daniel Lehmann and Thibaud Michaud

    Darius Mercadier voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Lehmann
    • Thibaud Michaud
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib9ce2c4f874a4ebd0599a1c141b96a6b1aaba4b8
    Gerrit-Change-Number: 7130227
    Gerrit-PatchSet: 16
    Gerrit-Owner: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Darius Mercadier <dmerc...@chromium.org>
    Gerrit-Reviewer: Nico Hartmann <nicoha...@chromium.org>
    Gerrit-CC: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-CC: Thibaud Michaud <thib...@chromium.org>
    Gerrit-CC: Victor Gomes <victo...@chromium.org>
    Gerrit-Attention: Thibaud Michaud <thib...@chromium.org>
    Gerrit-Attention: Daniel Lehmann <dleh...@chromium.org>
    Gerrit-Comment-Date: Wed, 19 Nov 2025 13:13:14 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages