[spirv] Rewrite MergeReturn
This change is intended to simplify the transform and make it easier
to work with, without changing any functionality.
It separates the process into two main passes:
1. Replace all `return` instructions with `exit` instructions. Set
the flag to signal that we are returning and record the control
instruction that we will exit to.
2. Conditionalize the merge blocks that we now exit to from the
first pass. This may discover additional merge blocks that also
need to be conditionalized as we walk back up the control flow
stack.
The minor changes in some of the E2E tests are just a result of
iterating over instructions in a different order.
Bug: 420345727
Change-Id: I476ca8a086a99afbfd29b26f2cb01630526f5a8e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/244474
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.