mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
tint/utils: Add TINT_LIKELY / TINT_UNLIKELY macros
Emits branch prediction hints. Give unlikely hints about where we call TINT_ICE. Change-Id: Ied5bc3d7c8b3a838e96e5a0a64156048f90411c6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116875 Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
2915fadce4
commit
884f95258d
@@ -1097,7 +1097,8 @@ struct DirectVariableAccess::State {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto* member = std::get_if<Symbol>(&op)) {
|
||||
auto* member = std::get_if<Symbol>(&op);
|
||||
if (TINT_LIKELY(member)) {
|
||||
ss << sym.NameFor(*member);
|
||||
continue;
|
||||
}
|
||||
@@ -1145,7 +1146,8 @@ struct DirectVariableAccess::State {
|
||||
return b.IndexAccessor(expr, idx);
|
||||
}
|
||||
|
||||
if (auto* member = std::get_if<Symbol>(&access)) {
|
||||
auto* member = std::get_if<Symbol>(&access);
|
||||
if (TINT_LIKELY(member)) {
|
||||
/// The access is a member access.
|
||||
return b.MemberAccessor(expr, ctx.Clone(*member));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user