Bug 279701

Summary: [WASM] Fix and fuse br_on_null/non_null in BBQ
Product: WebKit Reporter: David Degazio <d_degazio>
Component: WebAssemblyAssignee: David Degazio <d_degazio>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

David Degazio
Reported 2024-09-13 17:10:54 PDT
rdar://135586113 The implementation of br_on_null and br_on_non_null in BBQ currently works by materializing the condition into a value, potentially pinning that value to the scratch register, then calling the base BBQJIT::addBranch() as a helper. This isn't really how addBranch() is supposed to be used, and in particular, the fact that a pinned value can flow into parameter passing logic trips debug assertions in BBQJIT (and I think potentially could lead to niche register allocation bugs, since the scratch register isn't necessarily preserved through branch parameter shuffling). I think we should just make these instructions manage emitting the branch themselves, so we don't have to communicate intermediate values to the BBQ register allocator, and also skip an intermediate setcc/cset instruction.
Attachments
David Degazio
Comment 1 2024-09-13 17:18:07 PDT
EWS
Comment 2 2024-09-16 21:39:45 PDT
Committed 283745@main (17bdcc9f8477): <https://commits.webkit.org/283745@main> Reviewed commits have been landed. Closing PR #33650 and removing active labels.
EWS
Comment 3 2024-09-24 11:00:44 PDT
Committed 283286.116@safari-7620-branch (b1988e84c4af): <https://commits.webkit.org/283286.116@safari-7620-branch> Reviewed commits have been landed. Closing PR #1884 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.