`namespace dawn {` was written before some #includes
Bug: dawn:302
Change-Id: I1f0e507f63cc47b180d2021cf859d7964cfa4613
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133622
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Kokoro: Austin Eng <enga@chromium.org>
DAWN_DEBUG_BREAK_ON_ERROR executes dawn::BreakPoint inside
ErrorData::Create so that an application can inspect their callstack
immediately when an error is generated.
Bug: dawn:1789
Change-Id: I3f31b9713414d31b69ed469474e0f3c0f714540a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133562
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Some of the IR classes require setters in order to update dependant
information. In order to keep the IR access symmetrical this CL moves
the IR back to using accessors and private fields.
Bug: tint:1718
Change-Id: I101edda004671e07c4594bdcae4b1576e5771782
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133640
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Maths was wonky, causing the blocks to go back one on a whole integer.
Change-Id: I1f7d49c1d1b12050dd48b2090dbeff9d4a1c6c38
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133600
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This CL updates the IR builder to deduplicate constants such that for a
given constant value only a single `ir::Constant` will be created.
Bug: tint:1935
Change-Id: Ia743cdb7782cf7ea9918b913dac70b0a3dde4499
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133241
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
The change must be authored by the user and requires the following labels:
* Code-Review+2
* Auto-Submit+2
* Kokoro+2
And must not have failed CQ with the latest patchset.
Change-Id: Ic7b76a69a8dd134c11cb1c2a9964ab11d9fdde34
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133468
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
This CL adds parameters to functions in the IR. Attributes will be
handled in a later CL.
Bug: tint:1915
Change-Id: I99f9342e95ef957e5117465bb396db0b3822ba7d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133401
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
- Adds the feature and the major backend supports.
- Adds initial validation testing.
Bug: dawn:1664
Change-Id: I9918c3de8cce379319d3d1877e45c51acb388961
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133281
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Jones <bajones@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Bug: dawn:302
Change-Id: I8af045c609d1552c491d6e6f48b13b172172c2ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133520
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Bug: dawn:302
Change-Id: I91c9dd26456c7f7b8b72a24c332d1aae053fd73d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133365
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Austin Eng <enga@chromium.org>
Kokoro: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Currently runs only dawn_end2end_tests and its variants
Bug: chromium:1363409
Change-Id: I4465caccb316e4d3db559c1f96fb2d4b07c8a812
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132700
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Kokoro: Austin Eng <enga@chromium.org>
* Ignore changes on non-main branches
* Increase the timeout for git cloning the repo
* Improve the error message on git error
Change-Id: I22af2b8042c14c3c413f52d65dc5b89b7f5c3f11
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132820
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Change-Id: Ib6dfa2452f8c33d29fb9433159295bdcc5bf6d76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133362
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
- Before since it was in the TearDown, cleanup can be called before
the device was gone which meant that async tasks could still be in
flight.
Bug: dawn:1374
Change-Id: I4cd5a4e096a3fe13e230197a6a4d4d57daea31c8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133480
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This CL updates the IR to only show types on the LHS of an assignment.
The RHS does not show the types anymore. This removes a lot of clutter
from the output.
Bug: tint:1718
Change-Id: I5e9cff2ae5cd727a7a8cb256d08b417233a197d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133240
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
These sources cannot build without the IR being explicitly enabled, as
they depend on code in headers that would be `#ifdef`'d out.
Change-Id: Id542f41679c3e6e6f210ca632e85ca796e61a746
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133402
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Also add `_ir` to the names of test files.This makes it less likely to
confuse IR code with non-IR code.
Bug: tint:1906
Change-Id: I2db85440c815c2834d7bab1899afa0fafc89ce6a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133222
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
When converting an AST expression to IR, check for a sem::Load node
and emit a load instruction if present.
Update conversion of compound assignment and increment/decrement to
load from the LHS.
Convert load instructions to inline variable references when going
back to the AST.
Bug: tint:1718
Change-Id: Ib2b850efb304a71eff95aadac825f015623b6eb3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133220
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Only Constants.h remains in no namespace; but it may be addressed
in the future as well.
Bug: dawn:302
Change-Id: Ib9b9ab4b974ad1de1bb9f2302f4d24d8216f55e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132841
Kokoro: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Change the type of a `var` to a pointer. Fold away address-of and
indirection.
Fixed: tint:1912
Change-Id: Ib1f07538c63df9349c5b6171062b6f79750c1439
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133400
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Adds support for both `If` and `Block` flow nodes as branch
targets. Also support a nullptr branch target by emitting
OpUnreachable.
Bug: tint:1906
Change-Id: I1adea83ce6c7c85c6a2e2dae9327499cb7f850bd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132861
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Use it in the SPIR-V writer.
Bug: tint:1718, tint:1906
Change-Id: If8f29300712c457a02ddc9eb2fd76e0b49ee8fea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132682
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Enable the transform manager to run a pipeline that mixes AST and IR
transforms, automatically converting the current program as necessary.
Bug: tint:1718
Change-Id: I8df76db61edd94e0b1d7c2aaabc18b394db3d8de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132502
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: James Price <jrprice@google.com>
The RHS of a compound assignment statement may need to be
materialized. This was showing up when converting things like `i += 1`
to IR, as abstract types were creeping into the IR.
Change-Id: Idf9b1523d1751e26c28a795af07769ca85a65f14
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133221
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This CL adds phony assignment to the IR. The assignment part is ignored
and the RHS of the expression is generated. This creates a result value
which is then never used.
Bug: tint:1918
Change-Id: Ic87fdcb387cb4d9783c4dbbe26ebc76f67a3cdd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133260
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
The Instructions are now inheriting from Value so they can use the value
block allocator. Remove the instruction allocator.
Bug: tint:1718
Change-Id: Ia8f3b8b106d03883b3c72ebead392ae972a86c4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133164
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: dan sinclair <dsinclair@google.com>
This CL adds the ability to add parameters to blocks and emits the
params as needed in the disassembly.
The ShortCircuit is updated to use block arguments instead of creating
a return value.
Bug: tint:1909
Change-Id: I92afa6cf8ff4e01bfa3de46e76c26c465f0d6062
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133200
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
The address space and access mode both exist on the type of the Var,
storing the information into Var is redundant. This CL removes them from
var in favour of the type fields.
Bug: tint:1718
Change-Id: I0198a8794d6359834592562251b2788e8a0347ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133163
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
And implement functions with return values.
Bug: tint:1902
Change-Id: Id4015aa83bf75de2a0f3dfdbfe19f728c05226c8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133142
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Returns with values requires fleshing out of functions, which comes next
Bug: tint:1902
Change-Id: I5f956805441b99038f2d48758d1bd767ea4e1a1d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133141
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Ben Clayton <bclayton@google.com>