Commit Graph

6 Commits

Author SHA1 Message Date
dan sinclair 46c32d882d Early out Is checks.
This CL adds a check to the `Is` castable methods to determine if the
target type is `final`. If the type being compared too is `final` we
bail out early in the walk up the hierarchy as it won't be a parent
class.

Change-Id: Ieba4dd686e47207a3db0cf3a8ea46fbc1a8d1c91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96600
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-07-20 15:53:14 +00:00
Ben Clayton 4a92a3c904 tint: Optimize sem node lookup
Add a 'NodeID' to each ast::Node which is the sequentially allocated
index of the node. Use this in sem::Info to map the AST node to the
semantic node, instead of using a std::unordered_map.

Optimised very hot code by entirely eliminating map lookups, and
dramatically reducing cache misses (lookups are usually sequentually
ordered).

Timings running
'webgpu:shader,execution,expression,call,builtin,atan2:f32:inputSource="const";vectorize="_undef_"'
with dawn/node, using SwiftShader:

    Without change: 3.22647107s
    With change:    3.10578879s

Bug: tint:1613
Change-Id: I22ec48d933b2e5f9da04494bff4e979e6f7b1982
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96140
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-07-18 20:50:02 +00:00
Ben Clayton 8822e2966a tint: Merge [S|U]intLiteralExpression
Merge SintLiteralExpression and UintLiteralExpression with
IntLiteralExpression. IntLiteralExpression has a new Suffix field which
indicates whether the literal is either a:
• 'i' suffixed integer literal
• 'u' suffixed integer literal
• no-suffix integer literal

Have the SPIR-V reader produce no-suffixed literals for i32 types, to
keep this change small. In future changes the SPIR-V reader will
produce 'i' suffixed types for these.

Have all consumers of IntLiteralExpression treat unsuffixed integers the
same as 'i'-suffixed literals. Unsuffixed will be treated as abstract in
future changes.

Removed SemHelper::TypeOf(const ast::LiteralExpression* lit).

Fixed: tint:1510
Bug: tint:1504
Change-Id: I443f41984e637ddd948182ee756af1010c5f8226
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88842
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-04 22:18:49 +00:00
dan sinclair 41e4d9a34c Consistent formatting for Dawn/Tint.
This CL updates the clang format files to have a single shared format
between Dawn and Tint. The major changes are tabs are 4 spaces, lines
are 100 columns and namespaces are not indented.

Bug: dawn:1339
Change-Id: I4208742c95643998d9fd14e77a9cc558071ded39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87603
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-05-01 14:40:55 +00:00
dan sinclair 34323ac069 Condense namespaces in tint/ast.
This PR condenses the namespaces in the tint/ast folder.

Change-Id: I77a84fb03f921b4db7135572005a08563f2fb60b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86038
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
2022-04-07 18:39:35 +00:00
Ryan Harrison dbc13af287 tint->dawn: Shuffle source tree in preperation of merging repos
docs/    -> docs/tint/
fuzzers/ -> src/tint/fuzzers/
samples/ -> src/tint/cmd/
src/     -> src/tint/
test/    -> test/tint/

BUG=tint:1418,tint:1433

Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2022-02-21 15:19:07 +00:00