[ir] Change disassembled block names to $Bn
Also change the declaration of a block from `%bn = block` to `$Bn:`.
Change-Id: I7ceea6013bda5b47dcfdc7225901c5b126f9449c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/185901
Reviewed-by: dan sinclair <dsinclair@google.com>
diff --git a/src/tint/lang/core/ir/disassembler.cc b/src/tint/lang/core/ir/disassembler.cc
index 43fd100..556a5b5 100644
--- a/src/tint/lang/core/ir/disassembler.cc
+++ b/src/tint/lang/core/ir/disassembler.cc
@@ -184,7 +184,7 @@
Indent();
SourceMarker sm(this);
- out_ << "%b" << IdOf(blk) << " = block";
+ out_ << "$B" << IdOf(blk);
if (auto* merge = blk->As<MultiInBlock>()) {
if (!merge->Params().IsEmpty()) {
out_ << " (";
@@ -201,7 +201,7 @@
}
sm.Store(blk);
- out_ << " {";
+ out_ << ": {";
if (!comment.empty()) {
out_ << " # " << comment;
}
@@ -621,9 +621,9 @@
bool has_false = !if_->False()->IsEmpty();
- out_ << " [t: %b" << IdOf(if_->True());
+ out_ << " [t: $B" << IdOf(if_->True());
if (has_false) {
- out_ << ", f: %b" << IdOf(if_->False());
+ out_ << ", f: $B" << IdOf(if_->False());
}
out_ << "]";
sm.Store(if_);
@@ -657,12 +657,12 @@
void Disassembler::EmitLoop(const Loop* l) {
Vector<std::string, 3> parts;
if (!l->Initializer()->IsEmpty()) {
- parts.Push("i: %b" + std::to_string(IdOf(l->Initializer())));
+ parts.Push("i: $B" + std::to_string(IdOf(l->Initializer())));
}
- parts.Push("b: %b" + std::to_string(IdOf(l->Body())));
+ parts.Push("b: $B" + std::to_string(IdOf(l->Body())));
if (!l->Continuing()->IsEmpty()) {
- parts.Push("c: %b" + std::to_string(IdOf(l->Continuing())));
+ parts.Push("c: $B" + std::to_string(IdOf(l->Continuing())));
}
SourceMarker sm(this);
if (auto results = l->Results(); !results.IsEmpty()) {
@@ -734,7 +734,7 @@
EmitValue(selector.val);
}
}
- out_ << ", %b" << IdOf(c.block) << ")";
+ out_ << ", $B" << IdOf(c.block) << ")";
}
out_ << "]";
sm.Store(s);
@@ -761,7 +761,7 @@
args_offset = ir::Return::kArgsOperandOffset;
},
[&](const ir::Continue* cont) {
- out_ << "continue %b" << IdOf(cont->Loop()->Continuing());
+ out_ << "continue $B" << IdOf(cont->Loop()->Continuing());
args_offset = ir::Continue::kArgsOperandOffset;
},
[&](const ir::ExitIf*) {
@@ -777,14 +777,14 @@
args_offset = ir::ExitLoop::kArgsOperandOffset;
},
[&](const ir::NextIteration* ni) {
- out_ << "next_iteration %b" << IdOf(ni->Loop()->Body());
+ out_ << "next_iteration $B" << IdOf(ni->Loop()->Body());
args_offset = ir::NextIteration::kArgsOperandOffset;
},
[&](const ir::Unreachable*) { out_ << "unreachable"; },
[&](const ir::BreakIf* bi) {
out_ << "break_if ";
EmitValue(bi->Condition());
- out_ << " %b" << IdOf(bi->Loop()->Body());
+ out_ << " $B" << IdOf(bi->Loop()->Body());
args_offset = ir::BreakIf::kArgsOperandOffset;
},
[&](const ir::TerminateInvocation*) { out_ << "terminate_invocation"; },
diff --git a/src/tint/lang/core/ir/transform/add_empty_entry_point_test.cc b/src/tint/lang/core/ir/transform/add_empty_entry_point_test.cc
index e4edcec..6a449d7 100644
--- a/src/tint/lang/core/ir/transform/add_empty_entry_point_test.cc
+++ b/src/tint/lang/core/ir/transform/add_empty_entry_point_test.cc
@@ -39,7 +39,7 @@
TEST_F(IR_AddEmptyEntryPointTest, EmptyModule) {
auto* expect = R"(
%unused_entry_point = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -56,7 +56,7 @@
auto* expect = R"(
%main = @fragment func():void {
- %b1 = block {
+ $B1: {
ret
}
}
diff --git a/src/tint/lang/core/ir/transform/bgra8unorm_polyfill_test.cc b/src/tint/lang/core/ir/transform/bgra8unorm_polyfill_test.cc
index 07a16d3..1e4b39e 100644
--- a/src/tint/lang/core/ir/transform/bgra8unorm_polyfill_test.cc
+++ b/src/tint/lang/core/ir/transform/bgra8unorm_polyfill_test.cc
@@ -46,7 +46,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -78,12 +78,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 2)
}
%foo = func(%value:vec4<f32>, %coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d<rgba8unorm, write> = load %texture
%6:void = textureStore %5, %coords, %value
ret
@@ -116,7 +116,7 @@
auto* src = R"(
%foo = func(%texture:texture_storage_2d<rgba8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void {
- %b1 = block {
+ $B1: {
%5:void = textureStore %texture, %coords, %value
ret
}
@@ -151,12 +151,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<bgra8unorm, write>, read> = var @binding_point(1, 2)
}
%foo = func(%value:vec4<f32>, %coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d<bgra8unorm, write> = load %texture
%6:void = textureStore %5, %coords, %value
ret
@@ -164,12 +164,12 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 2)
}
%foo = func(%value:vec4<f32>, %coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d<rgba8unorm, write> = load %texture
%6:vec4<f32> = swizzle %value, zyxw
%7:void = textureStore %5, %coords, %6
@@ -202,7 +202,7 @@
auto* src = R"(
%foo = func(%texture:texture_storage_2d<bgra8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void {
- %b1 = block {
+ $B1: {
%5:void = textureStore %texture, %coords, %value
ret
}
@@ -210,7 +210,7 @@
)";
auto* expect = R"(
%foo = func(%texture:texture_storage_2d<rgba8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = swizzle %value, zyxw
%6:void = textureStore %texture, %coords, %5
ret
@@ -259,18 +259,18 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<bgra8unorm, write>, read> = var @binding_point(1, 2)
}
%bar = func(%texture_1:texture_storage_2d<bgra8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void { # %texture_1: 'texture'
- %b2 = block {
+ $B2: {
%6:void = textureStore %texture_1, %coords, %value
ret
}
}
%foo = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%10:texture_storage_2d<bgra8unorm, write> = load %texture
%11:void = call %bar, %10, %coords_1, %value_1
ret
@@ -278,19 +278,19 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 2)
}
%bar = func(%texture_1:texture_storage_2d<rgba8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void { # %texture_1: 'texture'
- %b2 = block {
+ $B2: {
%6:vec4<f32> = swizzle %value, zyxw
%7:void = textureStore %texture_1, %coords, %6
ret
}
}
%foo = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%11:texture_storage_2d<rgba8unorm, write> = load %texture
%12:void = call %bar, %11, %coords_1, %value_1
ret
@@ -351,14 +351,14 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture_a:ptr<handle, texture_storage_2d<bgra8unorm, write>, read> = var @binding_point(1, 2)
%texture_b:ptr<handle, texture_storage_2d<bgra8unorm, write>, read> = var @binding_point(1, 3)
%texture_c:ptr<handle, texture_storage_2d<bgra8unorm, write>, read> = var @binding_point(1, 4)
}
%bar = func(%texture_a_1:texture_storage_2d<bgra8unorm, write>, %texture_b_1:texture_storage_2d<bgra8unorm, write>, %texture_b_2:texture_storage_2d<bgra8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void { # %texture_a_1: 'texture_a', %texture_b_1: 'texture_b', %texture_b_2: 'texture_b'
- %b2 = block {
+ $B2: {
%10:void = textureStore %texture_a_1, %coords, %value
%11:void = textureStore %texture_b_1, %coords, %value
%12:void = textureStore %texture_b_2, %coords, %value
@@ -366,7 +366,7 @@
}
}
%foo = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%16:texture_storage_2d<bgra8unorm, write> = load %texture_a
%17:texture_storage_2d<bgra8unorm, write> = load %texture_b
%18:texture_storage_2d<bgra8unorm, write> = load %texture_c
@@ -376,14 +376,14 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture_a:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 2)
%texture_b:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 3)
%texture_c:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 4)
}
%bar = func(%texture_a_1:texture_storage_2d<rgba8unorm, write>, %texture_b_1:texture_storage_2d<rgba8unorm, write>, %texture_b_2:texture_storage_2d<rgba8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void { # %texture_a_1: 'texture_a', %texture_b_1: 'texture_b', %texture_b_2: 'texture_b'
- %b2 = block {
+ $B2: {
%10:vec4<f32> = swizzle %value, zyxw
%11:void = textureStore %texture_a_1, %coords, %10
%12:vec4<f32> = swizzle %value, zyxw
@@ -394,7 +394,7 @@
}
}
%foo = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%19:texture_storage_2d<rgba8unorm, write> = load %texture_a
%20:texture_storage_2d<rgba8unorm, write> = load %texture_b
%21:texture_storage_2d<rgba8unorm, write> = load %texture_c
@@ -451,12 +451,12 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<bgra8unorm, write>, read> = var @binding_point(1, 2)
}
%bar = func(%texture_1:texture_storage_2d<bgra8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void { # %texture_1: 'texture'
- %b2 = block {
+ $B2: {
%6:void = textureStore %texture_1, %coords, %value
%7:void = textureStore %texture_1, %coords, %value
%8:void = textureStore %texture_1, %coords, %value
@@ -464,7 +464,7 @@
}
}
%foo = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%12:texture_storage_2d<bgra8unorm, write> = load %texture
%13:void = textureStore %12, %coords_1, %value_1
%14:texture_storage_2d<bgra8unorm, write> = load %texture
@@ -476,12 +476,12 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 2)
}
%bar = func(%texture_1:texture_storage_2d<rgba8unorm, write>, %coords:vec2<u32>, %value:vec4<f32>):void { # %texture_1: 'texture'
- %b2 = block {
+ $B2: {
%6:vec4<f32> = swizzle %value, zyxw
%7:void = textureStore %texture_1, %coords, %6
%8:vec4<f32> = swizzle %value, zyxw
@@ -492,7 +492,7 @@
}
}
%foo = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%15:texture_storage_2d<rgba8unorm, write> = load %texture
%16:vec4<f32> = swizzle %value_1, zyxw
%17:void = textureStore %15, %coords_1, %16
@@ -533,12 +533,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d_array<bgra8unorm, write>, read> = var @binding_point(1, 2)
}
%foo = func(%value:vec4<f32>, %coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d_array<bgra8unorm, write> = load %texture
%6:void = textureStore %5, %coords, %index, %value
ret
@@ -546,12 +546,12 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d_array<rgba8unorm, write>, read> = var @binding_point(1, 2)
}
%foo = func(%value:vec4<f32>, %coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d_array<rgba8unorm, write> = load %texture
%6:vec4<f32> = swizzle %value, zyxw
%7:void = textureStore %5, %coords, %index, %6
@@ -585,12 +585,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<bgra8unorm, write>, read> = var @binding_point(1, 2)
}
%foo = func():vec2<u32> {
- %b2 = block {
+ $B2: {
%3:texture_storage_2d<bgra8unorm, write> = load %texture
%dims:vec2<u32> = textureDimensions %3
ret %dims
@@ -598,12 +598,12 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(1, 2)
}
%foo = func():vec2<u32> {
- %b2 = block {
+ $B2: {
%3:texture_storage_2d<rgba8unorm, write> = load %texture
%dims:vec2<u32> = textureDimensions %3
ret %dims
@@ -638,12 +638,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<bgra8unorm, read>, read> = var @binding_point(1, 2)
}
%foo = func(%coords:vec2<u32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_2d<bgra8unorm, read> = load %texture
%result:vec4<f32> = textureLoad %4, %coords
ret %result
@@ -651,12 +651,12 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, read>, read> = var @binding_point(1, 2)
}
%foo = func(%coords:vec2<u32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_2d<rgba8unorm, read> = load %texture
%result:vec4<f32> = textureLoad %4, %coords
%6:vec4<f32> = swizzle %result, zyxw
@@ -693,12 +693,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<bgra8unorm, read_write>, read> = var @binding_point(1, 2)
}
%foo = func(%coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%4:texture_storage_2d<bgra8unorm, read_write> = load %texture
%result:vec4<f32> = textureLoad %4, %coords
%6:void = textureStore %4, %coords, %result
@@ -707,12 +707,12 @@
}
)";
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, read_write>, read> = var @binding_point(1, 2)
}
%foo = func(%coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%4:texture_storage_2d<rgba8unorm, read_write> = load %texture
%result:vec4<f32> = textureLoad %4, %coords
%6:vec4<f32> = swizzle %result, zyxw
diff --git a/src/tint/lang/core/ir/transform/binary_polyfill_test.cc b/src/tint/lang/core/ir/transform/binary_polyfill_test.cc
index 20a325b..1711351 100644
--- a/src/tint/lang/core/ir/transform/binary_polyfill_test.cc
+++ b/src/tint/lang/core/ir/transform/binary_polyfill_test.cc
@@ -66,7 +66,7 @@
Build(BinaryOp::kShiftLeft, ty.i32(), ty.i32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:u32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = shl %lhs, %rhs
ret %result
}
@@ -86,7 +86,7 @@
Build(BinaryOp::kShiftRight, ty.i32(), ty.i32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:u32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = shr %lhs, %rhs
ret %result
}
@@ -106,7 +106,7 @@
Build(BinaryOp::kShiftLeft, ty.i32(), ty.i32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:u32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = shl %lhs, %rhs
ret %result
}
@@ -114,7 +114,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:i32, %rhs:u32):i32 {
- %b1 = block {
+ $B1: {
%4:u32 = and %rhs, 31u
%result:i32 = shl %lhs, %4
ret %result
@@ -134,7 +134,7 @@
Build(BinaryOp::kShiftLeft, ty.u32(), ty.u32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = shl %lhs, %rhs
ret %result
}
@@ -142,7 +142,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = and %rhs, 31u
%result:u32 = shl %lhs, %4
ret %result
@@ -162,7 +162,7 @@
Build(BinaryOp::kShiftLeft, ty.vec2<i32>(), ty.vec2<i32>(), ty.vec2<u32>());
auto* src = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<u32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = shl %lhs, %rhs
ret %result
}
@@ -170,7 +170,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<u32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%4:vec2<u32> = and %rhs, vec2<u32>(31u)
%result:vec2<i32> = shl %lhs, %4
ret %result
@@ -190,7 +190,7 @@
Build(BinaryOp::kShiftLeft, ty.vec3<u32>(), ty.vec3<u32>(), ty.vec3<u32>());
auto* src = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%result:vec3<u32> = shl %lhs, %rhs
ret %result
}
@@ -198,7 +198,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%4:vec3<u32> = and %rhs, vec3<u32>(31u)
%result:vec3<u32> = shl %lhs, %4
ret %result
@@ -218,7 +218,7 @@
Build(BinaryOp::kShiftRight, ty.i32(), ty.i32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:u32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = shr %lhs, %rhs
ret %result
}
@@ -226,7 +226,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:i32, %rhs:u32):i32 {
- %b1 = block {
+ $B1: {
%4:u32 = and %rhs, 31u
%result:i32 = shr %lhs, %4
ret %result
@@ -246,7 +246,7 @@
Build(BinaryOp::kShiftRight, ty.u32(), ty.u32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = shr %lhs, %rhs
ret %result
}
@@ -254,7 +254,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = and %rhs, 31u
%result:u32 = shr %lhs, %4
ret %result
@@ -274,7 +274,7 @@
Build(BinaryOp::kShiftRight, ty.vec2<i32>(), ty.vec2<i32>(), ty.vec2<u32>());
auto* src = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<u32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = shr %lhs, %rhs
ret %result
}
@@ -282,7 +282,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<u32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%4:vec2<u32> = and %rhs, vec2<u32>(31u)
%result:vec2<i32> = shr %lhs, %4
ret %result
@@ -302,7 +302,7 @@
Build(BinaryOp::kShiftRight, ty.vec3<u32>(), ty.vec3<u32>(), ty.vec3<u32>());
auto* src = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%result:vec3<u32> = shr %lhs, %rhs
ret %result
}
@@ -310,7 +310,7 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%4:vec3<u32> = and %rhs, vec3<u32>(31u)
%result:vec3<u32> = shr %lhs, %4
ret %result
@@ -330,7 +330,7 @@
Build(BinaryOp::kDivide, ty.i32(), ty.i32(), ty.i32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = div %lhs, %rhs
ret %result
}
@@ -350,7 +350,7 @@
Build(BinaryOp::kModulo, ty.i32(), ty.i32(), ty.i32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = mod %lhs, %rhs
ret %result
}
@@ -370,7 +370,7 @@
Build(BinaryOp::kDivide, ty.i32(), ty.i32(), ty.i32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = div %lhs, %rhs
ret %result
}
@@ -378,13 +378,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:i32, %rhs:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = call %tint_div_i32, %lhs, %rhs
ret %result
}
}
%tint_div_i32 = func(%lhs_1:i32, %rhs_1:i32):i32 { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:bool = eq %rhs_1, 0i
%9:bool = eq %lhs_1, -2147483648i
%10:bool = eq %rhs_1, -1i
@@ -409,7 +409,7 @@
Build(BinaryOp::kDivide, ty.u32(), ty.u32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = div %lhs, %rhs
ret %result
}
@@ -417,13 +417,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = call %tint_div_u32, %lhs, %rhs
ret %result
}
}
%tint_div_u32 = func(%lhs_1:u32, %rhs_1:u32):u32 { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:bool = eq %rhs_1, 0u
%9:u32 = select %rhs_1, 1u, %8
%10:u32 = div %lhs_1, %9
@@ -444,7 +444,7 @@
Build(BinaryOp::kDivide, ty.vec2<i32>(), ty.vec2<i32>(), ty.vec2<i32>());
auto* src = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<i32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = div %lhs, %rhs
ret %result
}
@@ -452,13 +452,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<i32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = call %tint_div_v2i32, %lhs, %rhs
ret %result
}
}
%tint_div_v2i32 = func(%lhs_1:vec2<i32>, %rhs_1:vec2<i32>):vec2<i32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:vec2<bool> = eq %rhs_1, vec2<i32>(0i)
%9:vec2<bool> = eq %lhs_1, vec2<i32>(-2147483648i)
%10:vec2<bool> = eq %rhs_1, vec2<i32>(-1i)
@@ -483,7 +483,7 @@
Build(BinaryOp::kDivide, ty.vec3<u32>(), ty.vec3<u32>(), ty.vec3<u32>());
auto* src = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%result:vec3<u32> = div %lhs, %rhs
ret %result
}
@@ -491,13 +491,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%result:vec3<u32> = call %tint_div_v3u32, %lhs, %rhs
ret %result
}
}
%tint_div_v3u32 = func(%lhs_1:vec3<u32>, %rhs_1:vec3<u32>):vec3<u32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:vec3<bool> = eq %rhs_1, vec3<u32>(0u)
%9:vec3<u32> = select %rhs_1, vec3<u32>(1u), %8
%10:vec3<u32> = div %lhs_1, %9
@@ -518,7 +518,7 @@
Build(BinaryOp::kModulo, ty.i32(), ty.i32(), ty.i32());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = mod %lhs, %rhs
ret %result
}
@@ -526,13 +526,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:i32, %rhs:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = call %tint_mod_i32, %lhs, %rhs
ret %result
}
}
%tint_mod_i32 = func(%lhs_1:i32, %rhs_1:i32):i32 { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:bool = eq %rhs_1, 0i
%9:bool = eq %lhs_1, -2147483648i
%10:bool = eq %rhs_1, -1i
@@ -559,7 +559,7 @@
Build(BinaryOp::kModulo, ty.u32(), ty.u32(), ty.u32());
auto* src = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = mod %lhs, %rhs
ret %result
}
@@ -567,13 +567,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:u32, %rhs:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = call %tint_mod_u32, %lhs, %rhs
ret %result
}
}
%tint_mod_u32 = func(%lhs_1:u32, %rhs_1:u32):u32 { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:bool = eq %rhs_1, 0u
%9:u32 = select %rhs_1, 1u, %8
%10:u32 = div %lhs_1, %9
@@ -596,7 +596,7 @@
Build(BinaryOp::kModulo, ty.vec2<i32>(), ty.vec2<i32>(), ty.vec2<i32>());
auto* src = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<i32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = mod %lhs, %rhs
ret %result
}
@@ -604,13 +604,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec2<i32>, %rhs:vec2<i32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = call %tint_mod_v2i32, %lhs, %rhs
ret %result
}
}
%tint_mod_v2i32 = func(%lhs_1:vec2<i32>, %rhs_1:vec2<i32>):vec2<i32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:vec2<bool> = eq %rhs_1, vec2<i32>(0i)
%9:vec2<bool> = eq %lhs_1, vec2<i32>(-2147483648i)
%10:vec2<bool> = eq %rhs_1, vec2<i32>(-1i)
@@ -637,7 +637,7 @@
Build(BinaryOp::kModulo, ty.vec3<u32>(), ty.vec3<u32>(), ty.vec3<u32>());
auto* src = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%result:vec3<u32> = mod %lhs, %rhs
ret %result
}
@@ -645,13 +645,13 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec3<u32>, %rhs:vec3<u32>):vec3<u32> {
- %b1 = block {
+ $B1: {
%result:vec3<u32> = call %tint_mod_v3u32, %lhs, %rhs
ret %result
}
}
%tint_mod_v3u32 = func(%lhs_1:vec3<u32>, %rhs_1:vec3<u32>):vec3<u32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%8:vec3<bool> = eq %rhs_1, vec3<u32>(0u)
%9:vec3<u32> = select %rhs_1, vec3<u32>(1u), %8
%10:vec3<u32> = div %lhs_1, %9
@@ -674,7 +674,7 @@
Build(BinaryOp::kDivide, ty.vec4<i32>(), ty.i32(), ty.vec4<i32>());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = div %lhs, %rhs
ret %result
}
@@ -682,14 +682,14 @@
)";
auto* expect = R"(
%foo = func(%lhs:i32, %rhs:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = construct %lhs
%result:vec4<i32> = call %tint_div_v4i32, %4, %rhs
ret %result
}
}
%tint_div_v4i32 = func(%lhs_1:vec4<i32>, %rhs_1:vec4<i32>):vec4<i32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%9:vec4<bool> = eq %rhs_1, vec4<i32>(0i)
%10:vec4<bool> = eq %lhs_1, vec4<i32>(-2147483648i)
%11:vec4<bool> = eq %rhs_1, vec4<i32>(-1i)
@@ -714,7 +714,7 @@
Build(BinaryOp::kDivide, ty.vec4<i32>(), ty.vec4<i32>(), ty.i32());
auto* src = R"(
%foo = func(%lhs:vec4<i32>, %rhs:i32):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = div %lhs, %rhs
ret %result
}
@@ -722,14 +722,14 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec4<i32>, %rhs:i32):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = construct %rhs
%result:vec4<i32> = call %tint_div_v4i32, %lhs, %4
ret %result
}
}
%tint_div_v4i32 = func(%lhs_1:vec4<i32>, %rhs_1:vec4<i32>):vec4<i32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%9:vec4<bool> = eq %rhs_1, vec4<i32>(0i)
%10:vec4<bool> = eq %lhs_1, vec4<i32>(-2147483648i)
%11:vec4<bool> = eq %rhs_1, vec4<i32>(-1i)
@@ -754,7 +754,7 @@
Build(BinaryOp::kModulo, ty.vec4<i32>(), ty.i32(), ty.vec4<i32>());
auto* src = R"(
%foo = func(%lhs:i32, %rhs:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = mod %lhs, %rhs
ret %result
}
@@ -762,14 +762,14 @@
)";
auto* expect = R"(
%foo = func(%lhs:i32, %rhs:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = construct %lhs
%result:vec4<i32> = call %tint_mod_v4i32, %4, %rhs
ret %result
}
}
%tint_mod_v4i32 = func(%lhs_1:vec4<i32>, %rhs_1:vec4<i32>):vec4<i32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%9:vec4<bool> = eq %rhs_1, vec4<i32>(0i)
%10:vec4<bool> = eq %lhs_1, vec4<i32>(-2147483648i)
%11:vec4<bool> = eq %rhs_1, vec4<i32>(-1i)
@@ -796,7 +796,7 @@
Build(BinaryOp::kModulo, ty.vec4<i32>(), ty.vec4<i32>(), ty.i32());
auto* src = R"(
%foo = func(%lhs:vec4<i32>, %rhs:i32):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = mod %lhs, %rhs
ret %result
}
@@ -804,14 +804,14 @@
)";
auto* expect = R"(
%foo = func(%lhs:vec4<i32>, %rhs:i32):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = construct %rhs
%result:vec4<i32> = call %tint_mod_v4i32, %lhs, %4
ret %result
}
}
%tint_mod_v4i32 = func(%lhs_1:vec4<i32>, %rhs_1:vec4<i32>):vec4<i32> { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%9:vec4<bool> = eq %rhs_1, vec4<i32>(0i)
%10:vec4<bool> = eq %lhs_1, vec4<i32>(-2147483648i)
%11:vec4<bool> = eq %rhs_1, vec4<i32>(-1i)
@@ -894,7 +894,7 @@
auto* src = R"(
%foo_i32 = func(%lhs:i32, %rhs:i32):void {
- %b1 = block {
+ $B1: {
%4:i32 = div %lhs, %rhs
%5:i32 = div %lhs, %rhs
%6:i32 = mod %lhs, %rhs
@@ -903,7 +903,7 @@
}
}
%foo_u32 = func(%lhs_1:u32, %rhs_1:u32):void { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%11:u32 = div %lhs_1, %rhs_1
%12:u32 = div %lhs_1, %rhs_1
%13:u32 = mod %lhs_1, %rhs_1
@@ -912,7 +912,7 @@
}
}
%foo_vec4i = func(%lhs_2:vec4<i32>, %rhs_2:vec4<i32>):void { # %lhs_2: 'lhs', %rhs_2: 'rhs'
- %b3 = block {
+ $B3: {
%18:vec4<i32> = div %lhs_2, %rhs_2
%19:vec4<i32> = div %lhs_2, %rhs_2
%20:vec4<i32> = mod %lhs_2, %rhs_2
@@ -921,7 +921,7 @@
}
}
%foo_vec4u = func(%lhs_3:vec4<u32>, %rhs_3:vec4<u32>):void { # %lhs_3: 'lhs', %rhs_3: 'rhs'
- %b4 = block {
+ $B4: {
%25:vec4<u32> = div %lhs_3, %rhs_3
%26:vec4<u32> = div %lhs_3, %rhs_3
%27:vec4<u32> = mod %lhs_3, %rhs_3
@@ -932,7 +932,7 @@
)";
auto* expect = R"(
%foo_i32 = func(%lhs:i32, %rhs:i32):void {
- %b1 = block {
+ $B1: {
%4:i32 = call %tint_div_i32, %lhs, %rhs
%6:i32 = call %tint_div_i32, %lhs, %rhs
%7:i32 = call %tint_mod_i32, %lhs, %rhs
@@ -941,7 +941,7 @@
}
}
%foo_u32 = func(%lhs_1:u32, %rhs_1:u32):void { # %lhs_1: 'lhs', %rhs_1: 'rhs'
- %b2 = block {
+ $B2: {
%13:u32 = call %tint_div_u32, %lhs_1, %rhs_1
%15:u32 = call %tint_div_u32, %lhs_1, %rhs_1
%16:u32 = call %tint_mod_u32, %lhs_1, %rhs_1
@@ -950,7 +950,7 @@
}
}
%foo_vec4i = func(%lhs_2:vec4<i32>, %rhs_2:vec4<i32>):void { # %lhs_2: 'lhs', %rhs_2: 'rhs'
- %b3 = block {
+ $B3: {
%22:vec4<i32> = call %tint_div_v4i32, %lhs_2, %rhs_2
%24:vec4<i32> = call %tint_div_v4i32, %lhs_2, %rhs_2
%25:vec4<i32> = call %tint_mod_v4i32, %lhs_2, %rhs_2
@@ -959,7 +959,7 @@
}
}
%foo_vec4u = func(%lhs_3:vec4<u32>, %rhs_3:vec4<u32>):void { # %lhs_3: 'lhs', %rhs_3: 'rhs'
- %b4 = block {
+ $B4: {
%31:vec4<u32> = call %tint_div_v4u32, %lhs_3, %rhs_3
%33:vec4<u32> = call %tint_div_v4u32, %lhs_3, %rhs_3
%34:vec4<u32> = call %tint_mod_v4u32, %lhs_3, %rhs_3
@@ -968,7 +968,7 @@
}
}
%tint_div_i32 = func(%lhs_4:i32, %rhs_4:i32):i32 { # %lhs_4: 'lhs', %rhs_4: 'rhs'
- %b5 = block {
+ $B5: {
%39:bool = eq %rhs_4, 0i
%40:bool = eq %lhs_4, -2147483648i
%41:bool = eq %rhs_4, -1i
@@ -980,7 +980,7 @@
}
}
%tint_mod_i32 = func(%lhs_5:i32, %rhs_5:i32):i32 { # %lhs_5: 'lhs', %rhs_5: 'rhs'
- %b6 = block {
+ $B6: {
%48:bool = eq %rhs_5, 0i
%49:bool = eq %lhs_5, -2147483648i
%50:bool = eq %rhs_5, -1i
@@ -994,7 +994,7 @@
}
}
%tint_div_u32 = func(%lhs_6:u32, %rhs_6:u32):u32 { # %lhs_6: 'lhs', %rhs_6: 'rhs'
- %b7 = block {
+ $B7: {
%59:bool = eq %rhs_6, 0u
%60:u32 = select %rhs_6, 1u, %59
%61:u32 = div %lhs_6, %60
@@ -1002,7 +1002,7 @@
}
}
%tint_mod_u32 = func(%lhs_7:u32, %rhs_7:u32):u32 { # %lhs_7: 'lhs', %rhs_7: 'rhs'
- %b8 = block {
+ $B8: {
%64:bool = eq %rhs_7, 0u
%65:u32 = select %rhs_7, 1u, %64
%66:u32 = div %lhs_7, %65
@@ -1012,7 +1012,7 @@
}
}
%tint_div_v4i32 = func(%lhs_8:vec4<i32>, %rhs_8:vec4<i32>):vec4<i32> { # %lhs_8: 'lhs', %rhs_8: 'rhs'
- %b9 = block {
+ $B9: {
%71:vec4<bool> = eq %rhs_8, vec4<i32>(0i)
%72:vec4<bool> = eq %lhs_8, vec4<i32>(-2147483648i)
%73:vec4<bool> = eq %rhs_8, vec4<i32>(-1i)
@@ -1024,7 +1024,7 @@
}
}
%tint_mod_v4i32 = func(%lhs_9:vec4<i32>, %rhs_9:vec4<i32>):vec4<i32> { # %lhs_9: 'lhs', %rhs_9: 'rhs'
- %b10 = block {
+ $B10: {
%80:vec4<bool> = eq %rhs_9, vec4<i32>(0i)
%81:vec4<bool> = eq %lhs_9, vec4<i32>(-2147483648i)
%82:vec4<bool> = eq %rhs_9, vec4<i32>(-1i)
@@ -1038,7 +1038,7 @@
}
}
%tint_div_v4u32 = func(%lhs_10:vec4<u32>, %rhs_10:vec4<u32>):vec4<u32> { # %lhs_10: 'lhs', %rhs_10: 'rhs'
- %b11 = block {
+ $B11: {
%91:vec4<bool> = eq %rhs_10, vec4<u32>(0u)
%92:vec4<u32> = select %rhs_10, vec4<u32>(1u), %91
%93:vec4<u32> = div %lhs_10, %92
@@ -1046,7 +1046,7 @@
}
}
%tint_mod_v4u32 = func(%lhs_11:vec4<u32>, %rhs_11:vec4<u32>):vec4<u32> { # %lhs_11: 'lhs', %rhs_11: 'rhs'
- %b12 = block {
+ $B12: {
%96:vec4<bool> = eq %rhs_11, vec4<u32>(0u)
%97:vec4<u32> = select %rhs_11, vec4<u32>(1u), %96
%98:vec4<u32> = div %lhs_11, %97
diff --git a/src/tint/lang/core/ir/transform/binding_remapper_test.cc b/src/tint/lang/core/ir/transform/binding_remapper_test.cc
index ee9fb3c..15eda22 100644
--- a/src/tint/lang/core/ir/transform/binding_remapper_test.cc
+++ b/src/tint/lang/core/ir/transform/binding_remapper_test.cc
@@ -45,7 +45,7 @@
mod.root_block->Append(buffer);
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(0, 0)
}
@@ -66,7 +66,7 @@
mod.root_block->Append(buffer);
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(0, 0)
}
@@ -88,7 +88,7 @@
mod.root_block->Append(buffer);
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(1, 2)
}
@@ -96,7 +96,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(3, 2)
}
@@ -115,7 +115,7 @@
mod.root_block->Append(buffer);
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(1, 2)
}
@@ -123,7 +123,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(1, 3)
}
@@ -142,7 +142,7 @@
mod.root_block->Append(buffer);
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(1, 2)
}
@@ -150,7 +150,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, i32, read> = var @binding_point(3, 4)
}
@@ -172,7 +172,7 @@
mod.root_block->Append(buffer_b);
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer_a:ptr<uniform, i32, read> = var @binding_point(1, 2)
%buffer_b:ptr<uniform, i32, read> = var @binding_point(3, 4)
}
@@ -181,7 +181,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer_a:ptr<uniform, i32, read> = var @binding_point(3, 4)
%buffer_b:ptr<uniform, i32, read> = var @binding_point(1, 2)
}
@@ -212,13 +212,13 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer_a:ptr<uniform, i32, read> = var @binding_point(1, 2)
%buffer_b:ptr<uniform, i32, read> = var @binding_point(3, 4)
}
%main = @fragment func():void {
- %b2 = block {
+ $B2: {
%4:i32 = load %buffer_a
%5:i32 = load %buffer_b
ret
@@ -228,13 +228,13 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer_a:ptr<uniform, i32, read> = var @binding_point(0, 1)
%buffer_b:ptr<uniform, i32, read> = var @binding_point(0, 1)
}
%main = @fragment func():void {
- %b2 = block {
+ $B2: {
%4:i32 = load %buffer_a
%5:i32 = load %buffer_b
ret
diff --git a/src/tint/lang/core/ir/transform/block_decorated_structs_test.cc b/src/tint/lang/core/ir/transform/block_decorated_structs_test.cc
index ed4eae90..f85e4dd 100644
--- a/src/tint/lang/core/ir/transform/block_decorated_structs_test.cc
+++ b/src/tint/lang/core/ir/transform/block_decorated_structs_test.cc
@@ -48,7 +48,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -75,12 +75,12 @@
tint_symbol:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<uniform, tint_symbol_1, read> = var @binding_point(0, 0)
}
%foo = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, i32, read> = access %1, 0u
%4:i32 = load %3
ret %4
@@ -107,12 +107,12 @@
tint_symbol:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read_write> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<storage, i32, read_write> = access %1, 0u
store %3, 42i
ret
@@ -139,12 +139,12 @@
tint_symbol:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<push_constant, tint_symbol_1, read> = var
}
%foo = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<push_constant, i32, read> = access %1, 0u
%4:i32 = load %3
ret %4
@@ -175,12 +175,12 @@
tint_symbol:array<i32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read_write> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<storage, array<i32>, read_write> = access %1, 0u
%4:ptr<storage, i32, read_write> = access %3, 1u
store %4, 42i
@@ -223,12 +223,12 @@
arr:array<i32> @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<storage, i32, read_write> = access %1, 0u
%4:i32 = load %3
%5:ptr<storage, i32, read_write> = access %1, 1u, 3u
@@ -268,12 +268,12 @@
arr:array<i32> @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%root:ptr<storage, MyStruct, read_write> = let %1
%4:ptr<storage, array<i32>, read_write> = access %root, 1u
%arr:ptr<storage, array<i32>, read_write> = let %4
@@ -316,13 +316,13 @@
tint_symbol:MyStruct @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read_write> = var @binding_point(0, 0)
%2:ptr<private, MyStruct, read_write> = var
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%4:MyStruct = load %2
%5:ptr<storage, MyStruct, read_write> = access %1, 0u
store %5, %4
@@ -369,14 +369,14 @@
tint_symbol_4:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read_write> = var @binding_point(0, 0)
%2:ptr<storage, tint_symbol_3, read_write> = var @binding_point(0, 1)
%3:ptr<storage, tint_symbol_5, read_write> = var @binding_point(0, 2)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%5:ptr<storage, i32, read_write> = access %2, 0u
%6:i32 = load %5
%7:ptr<storage, i32, read_write> = access %3, 0u
diff --git a/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc b/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc
index a483bbb..0e1dd0a 100644
--- a/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc
+++ b/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc
@@ -65,7 +65,7 @@
Build(core::BuiltinFn::kSaturate, ty.f32(), Vector{ty.f32()});
auto* src = R"(
%foo = func(%arg:f32):f32 {
- %b1 = block {
+ $B1: {
%result:f32 = saturate %arg
ret %result
}
@@ -85,7 +85,7 @@
Build(core::BuiltinFn::kSaturate, ty.f32(), Vector{ty.f32()});
auto* src = R"(
%foo = func(%arg:f32):f32 {
- %b1 = block {
+ $B1: {
%result:f32 = saturate %arg
ret %result
}
@@ -93,7 +93,7 @@
)";
auto* expect = R"(
%foo = func(%arg:f32):f32 {
- %b1 = block {
+ $B1: {
%result:f32 = clamp %arg, 0.0f, 1.0f
ret %result
}
@@ -112,7 +112,7 @@
Build(core::BuiltinFn::kSaturate, ty.f16(), Vector{ty.f16()});
auto* src = R"(
%foo = func(%arg:f16):f16 {
- %b1 = block {
+ $B1: {
%result:f16 = saturate %arg
ret %result
}
@@ -120,7 +120,7 @@
)";
auto* expect = R"(
%foo = func(%arg:f16):f16 {
- %b1 = block {
+ $B1: {
%result:f16 = clamp %arg, 0.0h, 1.0h
ret %result
}
@@ -138,7 +138,7 @@
Build(core::BuiltinFn::kSaturate, ty.vec2<f32>(), Vector{ty.vec2<f32>()});
auto* src = R"(
%foo = func(%arg:vec2<f32>):vec2<f32> {
- %b1 = block {
+ $B1: {
%result:vec2<f32> = saturate %arg
ret %result
}
@@ -146,7 +146,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec2<f32>):vec2<f32> {
- %b1 = block {
+ $B1: {
%result:vec2<f32> = clamp %arg, vec2<f32>(0.0f), vec2<f32>(1.0f)
ret %result
}
@@ -165,7 +165,7 @@
Build(core::BuiltinFn::kSaturate, ty.vec4<f16>(), Vector{ty.vec4<f16>()});
auto* src = R"(
%foo = func(%arg:vec4<f16>):vec4<f16> {
- %b1 = block {
+ $B1: {
%result:vec4<f16> = saturate %arg
ret %result
}
@@ -173,7 +173,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec4<f16>):vec4<f16> {
- %b1 = block {
+ $B1: {
%result:vec4<f16> = clamp %arg, vec4<f16>(0.0h), vec4<f16>(1.0h)
ret %result
}
@@ -192,7 +192,7 @@
Build(core::BuiltinFn::kCountLeadingZeros, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = countLeadingZeros %arg
ret %result
}
@@ -212,7 +212,7 @@
Build(core::BuiltinFn::kCountLeadingZeros, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = countLeadingZeros %arg
ret %result
}
@@ -220,7 +220,7 @@
)";
auto* expect = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%3:bool = lte %arg, 65535u
%4:u32 = select 0u, 16u, %3
%5:u32 = shl %arg, %4
@@ -260,7 +260,7 @@
Build(core::BuiltinFn::kCountLeadingZeros, ty.i32(), Vector{ty.i32()});
auto* src = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = countLeadingZeros %arg
ret %result
}
@@ -268,7 +268,7 @@
)";
auto* expect = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%3:u32 = bitcast %arg
%4:bool = lte %3, 65535u
%5:u32 = select 0u, 16u, %4
@@ -310,7 +310,7 @@
Build(core::BuiltinFn::kCountLeadingZeros, ty.vec2<u32>(), Vector{ty.vec2<u32>()});
auto* src = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = countLeadingZeros %arg
ret %result
}
@@ -318,7 +318,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<bool> = lte %arg, vec2<u32>(65535u)
%4:vec2<u32> = select vec2<u32>(0u), vec2<u32>(16u), %3
%5:vec2<u32> = shl %arg, %4
@@ -358,7 +358,7 @@
Build(core::BuiltinFn::kCountLeadingZeros, ty.vec4<i32>(), Vector{ty.vec4<i32>()});
auto* src = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = countLeadingZeros %arg
ret %result
}
@@ -366,7 +366,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = bitcast %arg
%4:vec4<bool> = lte %3, vec4<u32>(65535u)
%5:vec4<u32> = select vec4<u32>(0u), vec4<u32>(16u), %4
@@ -408,7 +408,7 @@
Build(core::BuiltinFn::kCountTrailingZeros, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = countTrailingZeros %arg
ret %result
}
@@ -428,7 +428,7 @@
Build(core::BuiltinFn::kCountTrailingZeros, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = countTrailingZeros %arg
ret %result
}
@@ -436,7 +436,7 @@
)";
auto* expect = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = and %arg, 65535u
%4:bool = eq %3, 0u
%5:u32 = select 0u, 16u, %4
@@ -480,7 +480,7 @@
Build(core::BuiltinFn::kCountTrailingZeros, ty.i32(), Vector{ty.i32()});
auto* src = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = countTrailingZeros %arg
ret %result
}
@@ -488,7 +488,7 @@
)";
auto* expect = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%3:u32 = bitcast %arg
%4:u32 = and %3, 65535u
%5:bool = eq %4, 0u
@@ -534,7 +534,7 @@
Build(core::BuiltinFn::kCountTrailingZeros, ty.vec2<u32>(), Vector{ty.vec2<u32>()});
auto* src = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = countTrailingZeros %arg
ret %result
}
@@ -542,7 +542,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = and %arg, vec2<u32>(65535u)
%4:vec2<bool> = eq %3, vec2<u32>(0u)
%5:vec2<u32> = select vec2<u32>(0u), vec2<u32>(16u), %4
@@ -586,7 +586,7 @@
Build(core::BuiltinFn::kCountTrailingZeros, ty.vec4<i32>(), Vector{ty.vec4<i32>()});
auto* src = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = countTrailingZeros %arg
ret %result
}
@@ -594,7 +594,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = countTrailingZeros %arg
ret %result
}
@@ -613,7 +613,7 @@
Build(core::BuiltinFn::kExtractBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%result:u32 = extractBits %arg, %arg_1, %arg_2
ret %result
}
@@ -633,7 +633,7 @@
Build(core::BuiltinFn::kExtractBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%result:u32 = extractBits %arg, %arg_1, %arg_2
ret %result
}
@@ -641,7 +641,7 @@
)";
auto* expect = R"(
%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%5:u32 = min %arg_1, 32u
%6:u32 = sub 32u, %5
%7:u32 = min %arg_2, %6
@@ -663,7 +663,7 @@
Build(core::BuiltinFn::kExtractBits, ty.i32(), Vector{ty.i32(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:i32, %arg_1:u32, %arg_2:u32):i32 { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%result:i32 = extractBits %arg, %arg_1, %arg_2
ret %result
}
@@ -671,7 +671,7 @@
)";
auto* expect = R"(
%foo = func(%arg:i32, %arg_1:u32, %arg_2:u32):i32 { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%5:u32 = min %arg_1, 32u
%6:u32 = sub 32u, %5
%7:u32 = min %arg_2, %6
@@ -694,7 +694,7 @@
Vector{ty.vec2<u32>(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:vec2<u32>, %arg_1:u32, %arg_2:u32):vec2<u32> { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%result:vec2<u32> = extractBits %arg, %arg_1, %arg_2
ret %result
}
@@ -702,7 +702,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec2<u32>, %arg_1:u32, %arg_2:u32):vec2<u32> { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%5:u32 = min %arg_1, 32u
%6:u32 = sub 32u, %5
%7:u32 = min %arg_2, %6
@@ -725,7 +725,7 @@
Vector{ty.vec4<i32>(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:vec4<i32>, %arg_1:u32, %arg_2:u32):vec4<i32> { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%result:vec4<i32> = extractBits %arg, %arg_1, %arg_2
ret %result
}
@@ -733,7 +733,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec4<i32>, %arg_1:u32, %arg_2:u32):vec4<i32> { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%5:u32 = min %arg_1, 32u
%6:u32 = sub 32u, %5
%7:u32 = min %arg_2, %6
@@ -755,7 +755,7 @@
Build(core::BuiltinFn::kFirstLeadingBit, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = firstLeadingBit %arg
ret %result
}
@@ -775,7 +775,7 @@
Build(core::BuiltinFn::kFirstLeadingBit, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = firstLeadingBit %arg
ret %result
}
@@ -783,7 +783,7 @@
)";
auto* expect = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = and %arg, 4294901760u
%4:bool = eq %3, 0u
%5:u32 = select 16u, 0u, %4
@@ -826,7 +826,7 @@
Build(core::BuiltinFn::kFirstLeadingBit, ty.i32(), Vector{ty.i32()});
auto* src = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = firstLeadingBit %arg
ret %result
}
@@ -834,7 +834,7 @@
)";
auto* expect = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%3:u32 = bitcast %arg
%4:u32 = complement %3
%5:bool = lt %3, 2147483648u
@@ -882,7 +882,7 @@
Build(core::BuiltinFn::kFirstLeadingBit, ty.vec2<u32>(), Vector{ty.vec2<u32>()});
auto* src = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = firstLeadingBit %arg
ret %result
}
@@ -890,7 +890,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = and %arg, vec2<u32>(4294901760u)
%4:vec2<bool> = eq %3, vec2<u32>(0u)
%5:vec2<u32> = select vec2<u32>(16u), vec2<u32>(0u), %4
@@ -933,7 +933,7 @@
Build(core::BuiltinFn::kFirstLeadingBit, ty.vec4<i32>(), Vector{ty.vec4<i32>()});
auto* src = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = firstLeadingBit %arg
ret %result
}
@@ -941,7 +941,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = bitcast %arg
%4:vec4<u32> = complement %3
%5:vec4<bool> = lt %3, vec4<u32>(2147483648u)
@@ -989,7 +989,7 @@
Build(core::BuiltinFn::kFirstTrailingBit, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = firstTrailingBit %arg
ret %result
}
@@ -1009,7 +1009,7 @@
Build(core::BuiltinFn::kFirstTrailingBit, ty.u32(), Vector{ty.u32()});
auto* src = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = firstTrailingBit %arg
ret %result
}
@@ -1017,7 +1017,7 @@
)";
auto* expect = R"(
%foo = func(%arg:u32):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = and %arg, 65535u
%4:bool = eq %3, 0u
%5:u32 = select 0u, 16u, %4
@@ -1060,7 +1060,7 @@
Build(core::BuiltinFn::kFirstTrailingBit, ty.i32(), Vector{ty.i32()});
auto* src = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = firstTrailingBit %arg
ret %result
}
@@ -1068,7 +1068,7 @@
)";
auto* expect = R"(
%foo = func(%arg:i32):i32 {
- %b1 = block {
+ $B1: {
%3:u32 = bitcast %arg
%4:u32 = and %3, 65535u
%5:bool = eq %4, 0u
@@ -1113,7 +1113,7 @@
Build(core::BuiltinFn::kFirstTrailingBit, ty.vec2<u32>(), Vector{ty.vec2<u32>()});
auto* src = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = firstTrailingBit %arg
ret %result
}
@@ -1121,7 +1121,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec2<u32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = and %arg, vec2<u32>(65535u)
%4:vec2<bool> = eq %3, vec2<u32>(0u)
%5:vec2<u32> = select vec2<u32>(0u), vec2<u32>(16u), %4
@@ -1164,7 +1164,7 @@
Build(core::BuiltinFn::kFirstTrailingBit, ty.vec4<i32>(), Vector{ty.vec4<i32>()});
auto* src = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = firstTrailingBit %arg
ret %result
}
@@ -1172,7 +1172,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = bitcast %arg
%4:vec4<u32> = and %3, vec4<u32>(65535u)
%5:vec4<bool> = eq %4, vec4<u32>(0u)
@@ -1217,7 +1217,7 @@
Build(core::BuiltinFn::kInsertBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%result:u32 = insertBits %arg, %arg_1, %arg_2, %arg_3
ret %result
}
@@ -1237,7 +1237,7 @@
Build(core::BuiltinFn::kInsertBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%result:u32 = insertBits %arg, %arg_1, %arg_2, %arg_3
ret %result
}
@@ -1245,7 +1245,7 @@
)";
auto* expect = R"(
%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%6:u32 = min %arg_2, 32u
%7:u32 = sub 32u, %6
%8:u32 = min %arg_3, %7
@@ -1267,7 +1267,7 @@
Build(core::BuiltinFn::kInsertBits, ty.i32(), Vector{ty.i32(), ty.i32(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:i32, %arg_1:i32, %arg_2:u32, %arg_3:u32):i32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%result:i32 = insertBits %arg, %arg_1, %arg_2, %arg_3
ret %result
}
@@ -1275,7 +1275,7 @@
)";
auto* expect = R"(
%foo = func(%arg:i32, %arg_1:i32, %arg_2:u32, %arg_3:u32):i32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%6:u32 = min %arg_2, 32u
%7:u32 = sub 32u, %6
%8:u32 = min %arg_3, %7
@@ -1298,7 +1298,7 @@
Vector{ty.vec2<u32>(), ty.vec2<u32>(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:vec2<u32>, %arg_1:vec2<u32>, %arg_2:u32, %arg_3:u32):vec2<u32> { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%result:vec2<u32> = insertBits %arg, %arg_1, %arg_2, %arg_3
ret %result
}
@@ -1306,7 +1306,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec2<u32>, %arg_1:vec2<u32>, %arg_2:u32, %arg_3:u32):vec2<u32> { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%6:u32 = min %arg_2, 32u
%7:u32 = sub 32u, %6
%8:u32 = min %arg_3, %7
@@ -1329,7 +1329,7 @@
Vector{ty.vec4<i32>(), ty.vec4<i32>(), ty.u32(), ty.u32()});
auto* src = R"(
%foo = func(%arg:vec4<i32>, %arg_1:vec4<i32>, %arg_2:u32, %arg_3:u32):vec4<i32> { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%result:vec4<i32> = insertBits %arg, %arg_1, %arg_2, %arg_3
ret %result
}
@@ -1337,7 +1337,7 @@
)";
auto* expect = R"(
%foo = func(%arg:vec4<i32>, %arg_1:vec4<i32>, %arg_2:u32, %arg_3:u32):vec4<i32> { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg'
- %b1 = block {
+ $B1: {
%6:u32 = min %arg_2, 32u
%7:u32 = sub 32u, %6
%8:u32 = min %arg_3, %7
@@ -1362,7 +1362,7 @@
Vector{texture_ty, ty.sampler(), ty.vec2<f32>()});
auto* src = R"(
%foo = func(%arg:texture_2d<f32>, %arg_1:sampler, %arg_2:vec2<f32>):vec4<f32> { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%result:vec4<f32> = textureSampleBaseClampToEdge %arg, %arg_1, %arg_2
ret %result
}
@@ -1385,7 +1385,7 @@
Vector{texture_ty, ty.sampler(), ty.vec2<f32>()});
auto* src = R"(
%foo = func(%arg:texture_2d<f32>, %arg_1:sampler, %arg_2:vec2<f32>):vec4<f32> { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%result:vec4<f32> = textureSampleBaseClampToEdge %arg, %arg_1, %arg_2
ret %result
}
@@ -1393,7 +1393,7 @@
)";
auto* expect = R"(
%foo = func(%arg:texture_2d<f32>, %arg_1:sampler, %arg_2:vec2<f32>):vec4<f32> { # %arg_1: 'arg', %arg_2: 'arg'
- %b1 = block {
+ $B1: {
%5:vec2<u32> = textureDimensions %arg
%6:vec2<f32> = convert %5
%7:vec2<f32> = div vec2<f32>(0.5f), %6
@@ -1418,7 +1418,7 @@
auto* src = R"(
%foo = func(%arg:vec4<i32>):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = pack4xI8 %arg
ret %result
}
@@ -1428,7 +1428,7 @@
auto* expect = R"(
%foo = func(%arg:vec4<i32>):u32 {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = construct 0u, 8u, 16u, 24u
%4:vec4<u32> = bitcast %arg
%5:vec4<u32> = construct 255u
@@ -1453,7 +1453,7 @@
auto* src = R"(
%foo = func(%arg:vec4<u32>):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = pack4xU8 %arg
ret %result
}
@@ -1463,7 +1463,7 @@
auto* expect = R"(
%foo = func(%arg:vec4<u32>):u32 {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = construct 0u, 8u, 16u, 24u
%4:vec4<u32> = construct 255u
%5:vec4<u32> = and %arg, %4
@@ -1487,7 +1487,7 @@
auto* src = R"(
%foo = func(%arg:vec4<i32>):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = pack4xI8Clamp %arg
ret %result
}
@@ -1497,7 +1497,7 @@
auto* expect = R"(
%foo = func(%arg:vec4<i32>):u32 {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = construct 0u, 8u, 16u, 24u
%4:vec4<i32> = construct -128i
%5:vec4<i32> = construct 127i
@@ -1525,7 +1525,7 @@
auto* src = R"(
%foo = func(%arg:vec4<u32>):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = pack4xU8Clamp %arg
ret %result
}
@@ -1535,7 +1535,7 @@
auto* expect = R"(
%foo = func(%arg:vec4<u32>):u32 {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = construct 0u, 8u, 16u, 24u
%4:vec4<u32> = construct 0u
%5:vec4<u32> = construct 255u
@@ -1560,7 +1560,7 @@
auto* src = R"(
%foo = func(%arg:u32):vec4<i32> {
- %b1 = block {
+ $B1: {
%result:vec4<i32> = unpack4xI8 %arg
ret %result
}
@@ -1570,7 +1570,7 @@
auto* expect = R"(
%foo = func(%arg:u32):vec4<i32> {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = construct 24u, 16u, 8u, 0u
%4:vec4<u32> = construct %arg
%5:vec4<u32> = shl %4, %3
@@ -1594,7 +1594,7 @@
auto* src = R"(
%foo = func(%arg:u32):vec4<u32> {
- %b1 = block {
+ $B1: {
%result:vec4<u32> = unpack4xU8 %arg
ret %result
}
@@ -1604,7 +1604,7 @@
auto* expect = R"(
%foo = func(%arg:u32):vec4<u32> {
- %b1 = block {
+ $B1: {
%3:vec4<u32> = construct 0u, 8u, 16u, 24u
%4:vec4<u32> = construct %arg
%5:vec4<u32> = shr %4, %3
@@ -1627,7 +1627,7 @@
auto* src = R"(
%foo = func(%arg:u32, %arg_1:u32):i32 { # %arg_1: 'arg'
- %b1 = block {
+ $B1: {
%result:i32 = dot4I8Packed %arg, %arg_1
ret %result
}
@@ -1637,7 +1637,7 @@
auto* expect = R"(
%foo = func(%arg:u32, %arg_1:u32):i32 { # %arg_1: 'arg'
- %b1 = block {
+ $B1: {
%4:vec4<u32> = construct 24u, 16u, 8u, 0u
%5:vec4<u32> = construct %arg
%6:vec4<u32> = shl %5, %4
@@ -1668,7 +1668,7 @@
auto* src = R"(
%foo = func(%arg:u32, %arg_1:u32):u32 { # %arg_1: 'arg'
- %b1 = block {
+ $B1: {
%result:u32 = dot4U8Packed %arg, %arg_1
ret %result
}
@@ -1678,7 +1678,7 @@
auto* expect = R"(
%foo = func(%arg:u32, %arg_1:u32):u32 { # %arg_1: 'arg'
- %b1 = block {
+ $B1: {
%4:vec4<u32> = construct 0u, 8u, 16u, 24u
%5:vec4<u32> = construct %arg
%6:vec4<u32> = shr %5, %4
diff --git a/src/tint/lang/core/ir/transform/combine_access_instructions_test.cc b/src/tint/lang/core/ir/transform/combine_access_instructions_test.cc
index 80e7e65..49c3430 100644
--- a/src/tint/lang/core/ir/transform/combine_access_instructions_test.cc
+++ b/src/tint/lang/core/ir/transform/combine_access_instructions_test.cc
@@ -73,12 +73,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, MyStruct, read> = access %buffer
%4:MyStruct = load %3
%5:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
@@ -127,12 +127,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:ptr<uniform, mat3x3<f32>, read> = access %3, 1u
%5:ptr<uniform, vec3<f32>, read> = access %4, 2u
@@ -148,12 +148,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec3<f32>, read> = access %buffer, 0u, 1u, 2u
%4:vec3<f32> = load %3
ret
@@ -191,12 +191,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, MyStruct, read> = access %buffer
%4:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %3, 0u
%5:array<mat3x3<f32>, 4> = load %4
@@ -211,12 +211,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:array<mat3x3<f32>, 4> = load %3
ret
@@ -255,12 +255,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %3
%5:ptr<uniform, mat3x3<f32>, read> = access %4, 1u
@@ -276,12 +276,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, mat3x3<f32>, read> = access %buffer, 0u, 1u
%4:mat3x3<f32> = load %3
ret
@@ -320,12 +320,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:ptr<uniform, mat3x3<f32>, read> = access %3, 1u
%5:ptr<uniform, mat3x3<f32>, read> = access %4
@@ -341,12 +341,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, mat3x3<f32>, read> = access %buffer, 0u, 1u
%4:mat3x3<f32> = load %3
ret
@@ -399,12 +399,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:ptr<uniform, mat3x3<f32>, read> = access %3, 1u
%5:ptr<uniform, vec3<f32>, read> = access %4, 2u
@@ -426,12 +426,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec3<f32>, read> = access %buffer, 0u, 1u, 2u
%4:vec3<f32> = load %3
%5:ptr<uniform, vec3<f32>, read> = access %buffer, 0u, 2u, 0u
@@ -486,12 +486,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:ptr<uniform, mat3x3<f32>, read> = access %3, 1u
%5:ptr<uniform, vec3<f32>, read> = access %4, 2u
@@ -511,12 +511,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec3<f32>, read> = access %buffer, 0u, 1u, 2u
%4:vec3<f32> = load %3
%5:ptr<uniform, vec3<f32>, read> = access %buffer, 0u, 1u, 0u
@@ -561,12 +561,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:array<mat3x3<f32>, 4> = load %3
%5:ptr<uniform, mat3x3<f32>, read> = access %3, 1u
@@ -583,12 +583,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:array<mat3x3<f32>, 4> = load %3
%5:ptr<uniform, vec3<f32>, read> = access %buffer, 0u, 1u, 2u
@@ -631,12 +631,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
%4:ptr<uniform, mat3x3<f32>, read> = access %3, 1u
%5:mat3x3<f32> = load %4
@@ -653,12 +653,12 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, mat3x3<f32>, read> = access %buffer, 0u, 1u
%4:mat3x3<f32> = load %3
%5:ptr<uniform, vec3<f32>, read> = access %buffer, 0u, 1u, 2u
@@ -685,7 +685,7 @@
auto* src = R"(
%foo = func():f32 {
- %b1 = block {
+ $B1: {
%2:u32 = access %indices, 1u
%4:f32 = access %values, %2
ret %4
@@ -734,20 +734,20 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
- if true [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ if true [t: $B3, f: $B4] { # if_1
+ $B3: { # true
%4:ptr<uniform, mat3x3<f32>, read> = access %3, 1u
%5:mat3x3<f32> = load %4
exit_if # if_1
}
- %b4 = block { # false
+ $B4: { # false
%6:ptr<uniform, mat3x3<f32>, read> = access %3, 2u
%7:mat3x3<f32> = load %6
exit_if # if_1
@@ -764,19 +764,19 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
- if true [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B2: {
+ if true [t: $B3, f: $B4] { # if_1
+ $B3: { # true
%3:ptr<uniform, mat3x3<f32>, read> = access %buffer, 0u, 1u
%4:mat3x3<f32> = load %3
exit_if # if_1
}
- %b4 = block { # false
+ $B4: { # false
%5:ptr<uniform, mat3x3<f32>, read> = access %buffer, 0u, 2u
%6:mat3x3<f32> = load %5
exit_if # if_1
@@ -825,23 +825,23 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<mat3x3<f32>, 4>, read> = access %buffer, 0u
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
%4:ptr<uniform, mat3x3<f32>, read> = access %3, 2u
%5:mat3x3<f32> = load %4
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%6:ptr<uniform, mat3x3<f32>, read> = access %3, 3u
%7:mat3x3<f32> = load %6
- break_if true %b3
+ break_if true $B3
}
}
ret
@@ -855,22 +855,22 @@
a:array<mat3x3<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
+ $B2: {
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
%3:ptr<uniform, mat3x3<f32>, read> = access %buffer, 0u, 2u
%4:mat3x3<f32> = load %3
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%5:ptr<uniform, mat3x3<f32>, read> = access %buffer, 0u, 3u
%6:mat3x3<f32> = load %5
- break_if true %b3
+ break_if true $B3
}
}
ret
diff --git a/src/tint/lang/core/ir/transform/conversion_polyfill_test.cc b/src/tint/lang/core/ir/transform/conversion_polyfill_test.cc
index ee42b6b..cdb2db9 100644
--- a/src/tint/lang/core/ir/transform/conversion_polyfill_test.cc
+++ b/src/tint/lang/core/ir/transform/conversion_polyfill_test.cc
@@ -59,7 +59,7 @@
Build(ty.i32(), ty.f32());
auto* src = R"(
%foo = func(%src:i32):f32 {
- %b1 = block {
+ $B1: {
%result:f32 = convert %src
ret %result
}
@@ -80,7 +80,7 @@
Build(ty.u32(), ty.f32());
auto* src = R"(
%foo = func(%src:u32):f32 {
- %b1 = block {
+ $B1: {
%result:f32 = convert %src
ret %result
}
@@ -100,7 +100,7 @@
Build(ty.f32(), ty.i32());
auto* src = R"(
%foo = func(%src:f32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = convert %src
ret %result
}
@@ -120,7 +120,7 @@
Build(ty.f32(), ty.i32());
auto* src = R"(
%foo = func(%src:f32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = convert %src
ret %result
}
@@ -128,13 +128,13 @@
)";
auto* expect = R"(
%foo = func(%src:f32):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = call %tint_f32_to_i32, %src
ret %result
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = convert %value
%7:bool = gte %value, -2147483648.0f
%8:i32 = select -2147483648i, %6, %7
@@ -157,7 +157,7 @@
Build(ty.f32(), ty.u32());
auto* src = R"(
%foo = func(%src:f32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = convert %src
ret %result
}
@@ -165,13 +165,13 @@
)";
auto* expect = R"(
%foo = func(%src:f32):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = call %tint_f32_to_u32, %src
ret %result
}
}
%tint_f32_to_u32 = func(%value:f32):u32 {
- %b2 = block {
+ $B2: {
%6:u32 = convert %value
%7:bool = gte %value, 0.0f
%8:u32 = select 0u, %6, %7
@@ -194,7 +194,7 @@
Build(ty.vec2<f32>(), ty.vec2<i32>());
auto* src = R"(
%foo = func(%src:vec2<f32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = convert %src
ret %result
}
@@ -202,13 +202,13 @@
)";
auto* expect = R"(
%foo = func(%src:vec2<f32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = call %tint_v2f32_to_v2i32, %src
ret %result
}
}
%tint_v2f32_to_v2i32 = func(%value:vec2<f32>):vec2<i32> {
- %b2 = block {
+ $B2: {
%6:vec2<i32> = convert %value
%7:vec2<bool> = gte %value, vec2<f32>(-2147483648.0f)
%8:vec2<i32> = select vec2<i32>(-2147483648i), %6, %7
@@ -231,7 +231,7 @@
Build(ty.vec2<f32>(), ty.vec2<u32>());
auto* src = R"(
%foo = func(%src:vec2<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = convert %src
ret %result
}
@@ -239,13 +239,13 @@
)";
auto* expect = R"(
%foo = func(%src:vec2<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = call %tint_v2f32_to_v2u32, %src
ret %result
}
}
%tint_v2f32_to_v2u32 = func(%value:vec2<f32>):vec2<u32> {
- %b2 = block {
+ $B2: {
%6:vec2<u32> = convert %value
%7:vec2<bool> = gte %value, vec2<f32>(0.0f)
%8:vec2<u32> = select vec2<u32>(0u), %6, %7
@@ -268,7 +268,7 @@
Build(ty.f16(), ty.i32());
auto* src = R"(
%foo = func(%src:f16):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = convert %src
ret %result
}
@@ -276,13 +276,13 @@
)";
auto* expect = R"(
%foo = func(%src:f16):i32 {
- %b1 = block {
+ $B1: {
%result:i32 = call %tint_f16_to_i32, %src
ret %result
}
}
%tint_f16_to_i32 = func(%value:f16):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = convert %value
%7:bool = gte %value, -65504.0h
%8:i32 = select -2147483648i, %6, %7
@@ -305,7 +305,7 @@
Build(ty.f16(), ty.u32());
auto* src = R"(
%foo = func(%src:f16):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = convert %src
ret %result
}
@@ -313,13 +313,13 @@
)";
auto* expect = R"(
%foo = func(%src:f16):u32 {
- %b1 = block {
+ $B1: {
%result:u32 = call %tint_f16_to_u32, %src
ret %result
}
}
%tint_f16_to_u32 = func(%value:f16):u32 {
- %b2 = block {
+ $B2: {
%6:u32 = convert %value
%7:bool = gte %value, 0.0h
%8:u32 = select 0u, %6, %7
@@ -342,7 +342,7 @@
Build(ty.vec2<f16>(), ty.vec2<i32>());
auto* src = R"(
%foo = func(%src:vec2<f16>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = convert %src
ret %result
}
@@ -350,13 +350,13 @@
)";
auto* expect = R"(
%foo = func(%src:vec2<f16>):vec2<i32> {
- %b1 = block {
+ $B1: {
%result:vec2<i32> = call %tint_v2f16_to_v2i32, %src
ret %result
}
}
%tint_v2f16_to_v2i32 = func(%value:vec2<f16>):vec2<i32> {
- %b2 = block {
+ $B2: {
%6:vec2<i32> = convert %value
%7:vec2<bool> = gte %value, vec2<f16>(-65504.0h)
%8:vec2<i32> = select vec2<i32>(-2147483648i), %6, %7
@@ -379,7 +379,7 @@
Build(ty.vec2<f16>(), ty.vec2<u32>());
auto* src = R"(
%foo = func(%src:vec2<f16>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = convert %src
ret %result
}
@@ -387,13 +387,13 @@
)";
auto* expect = R"(
%foo = func(%src:vec2<f16>):vec2<u32> {
- %b1 = block {
+ $B1: {
%result:vec2<u32> = call %tint_v2f16_to_v2u32, %src
ret %result
}
}
%tint_v2f16_to_v2u32 = func(%value:vec2<f16>):vec2<u32> {
- %b2 = block {
+ $B2: {
%6:vec2<u32> = convert %value
%7:vec2<bool> = gte %value, vec2<f16>(0.0h)
%8:vec2<u32> = select vec2<u32>(0u), %6, %7
diff --git a/src/tint/lang/core/ir/transform/demote_to_helper_test.cc b/src/tint/lang/core/ir/transform/demote_to_helper_test.cc
index 7f68068..e26ff8d 100644
--- a/src/tint/lang/core/ir/transform/demote_to_helper_test.cc
+++ b/src/tint/lang/core/ir/transform/demote_to_helper_test.cc
@@ -56,12 +56,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
}
%ep = @fragment func():f32 [@location(0)] {
- %b2 = block {
+ $B2: {
store %buffer, 42i
ret 0.5f
}
@@ -98,14 +98,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -118,30 +118,30 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- if %5 [t: %b4] { # if_2
- %b4 = block { # true
+ if %5 [t: $B4] { # if_2
+ $B4: { # true
store %buffer, 42i
exit_if # if_2
}
}
%6:bool = load %continue_execution
%7:bool = eq %6, false
- if %7 [t: %b5] { # if_3
- %b5 = block { # true
+ if %7 [t: $B5] { # if_3
+ $B5: { # true
terminate_invocation
}
}
@@ -183,20 +183,20 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
store %buffer, 42i
ret
}
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b3 = block {
- if %front_facing [t: %b4] { # if_1
- %b4 = block { # true
+ $B3: {
+ if %front_facing [t: $B4] { # if_1
+ $B4: { # true
discard
exit_if # if_1
}
@@ -209,16 +209,16 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%4:bool = load %continue_execution
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %buffer, 42i
exit_if # if_1
}
@@ -227,9 +227,9 @@
}
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b4 = block {
- if %front_facing [t: %b5] { # if_2
- %b5 = block { # true
+ $B4: {
+ if %front_facing [t: $B5] { # if_2
+ $B5: { # true
store %continue_execution, false
exit_if # if_2
}
@@ -237,8 +237,8 @@
%7:void = call %foo
%8:bool = load %continue_execution
%9:bool = eq %8, false
- if %9 [t: %b6] { # if_3
- %b6 = block { # true
+ if %9 [t: $B6] { # if_3
+ $B6: { # true
terminate_invocation
}
}
@@ -282,14 +282,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
}
%foo = func(%cond:bool):void {
- %b2 = block {
- if %cond [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %cond [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -298,7 +298,7 @@
}
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b4 = block {
+ $B4: {
%6:void = call %foo, %front_facing
store %buffer, 42i
ret 0.5f
@@ -308,15 +308,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%foo = func(%cond:bool):void {
- %b2 = block {
- if %cond [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %cond [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
@@ -325,19 +325,19 @@
}
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b4 = block {
+ $B4: {
%7:void = call %foo, %front_facing
%8:bool = load %continue_execution
- if %8 [t: %b5] { # if_2
- %b5 = block { # true
+ if %8 [t: $B5] { # if_2
+ $B5: { # true
store %buffer, 42i
exit_if # if_2
}
}
%9:bool = load %continue_execution
%10:bool = eq %9, false
- if %10 [t: %b6] { # if_3
- %b6 = block { # true
+ if %10 [t: $B6] { # if_3
+ $B6: { # true
terminate_invocation
}
}
@@ -381,14 +381,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
}
%foo = func(%cond:bool):void {
- %b2 = block {
- if %cond [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %cond [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -398,7 +398,7 @@
}
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b4 = block {
+ $B4: {
%6:void = call %foo, %front_facing
ret 0.5f
}
@@ -407,22 +407,22 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, i32, read_write> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%foo = func(%cond:bool):void {
- %b2 = block {
- if %cond [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %cond [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- if %5 [t: %b4] { # if_2
- %b4 = block { # true
+ if %5 [t: $B4] { # if_2
+ $B4: { # true
store %buffer, 42i
exit_if # if_2
}
@@ -431,12 +431,12 @@
}
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b5 = block {
+ $B5: {
%8:void = call %foo, %front_facing
%9:bool = load %continue_execution
%10:bool = eq %9, false
- if %10 [t: %b6] { # if_3
- %b6 = block { # true
+ if %10 [t: $B6] { # if_3
+ $B6: { # true
terminate_invocation
}
}
@@ -471,15 +471,15 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%priv:ptr<private, i32, read_write> = var
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
+ $B2: {
%func:ptr<function, i32, read_write> = var
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -493,16 +493,16 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%priv:ptr<private, i32, read_write> = var
%continue_execution:ptr<private, bool, read_write> = var, true
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
+ $B2: {
%func:ptr<function, i32, read_write> = var
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
@@ -511,8 +511,8 @@
store %func, 42i
%6:bool = load %continue_execution
%7:bool = eq %6, false
- if %7 [t: %b4] { # if_2
- %b4 = block { # true
+ if %7 [t: $B4] { # if_2
+ $B4: { # true
terminate_invocation
}
}
@@ -555,14 +555,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<r32float, write>, read> = var @binding_point(0, 0)
}
%ep = @fragment func(%front_facing:bool [@front_facing], %coord:vec2<i32>):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -576,31 +576,31 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<r32float, write>, read> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%ep = @fragment func(%front_facing:bool [@front_facing], %coord:vec2<i32>):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
}
%6:texture_storage_2d<r32float, write> = load %texture
%7:bool = load %continue_execution
- if %7 [t: %b4] { # if_2
- %b4 = block { # true
+ if %7 [t: $B4] { # if_2
+ $B4: { # true
%8:void = textureStore %6, %coord, vec4<f32>(0.5f)
exit_if # if_2
}
}
%9:bool = load %continue_execution
%10:bool = eq %9, false
- if %10 [t: %b5] { # if_3
- %b5 = block { # true
+ if %10 [t: $B5] { # if_3
+ $B5: { # true
terminate_invocation
}
}
@@ -636,14 +636,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -656,30 +656,30 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- if %5 [t: %b4] { # if_2
- %b4 = block { # true
+ if %5 [t: $B4] { # if_2
+ $B4: { # true
%6:void = atomicStore %buffer, 42i
exit_if # if_2
}
}
%7:bool = load %continue_execution
%8:bool = eq %7, false
- if %8 [t: %b5] { # if_3
- %b5 = block { # true
+ if %8 [t: $B5] { # if_3
+ $B5: { # true
terminate_invocation
}
}
@@ -716,14 +716,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -737,22 +737,22 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- %6:i32 = if %5 [t: %b4] { # if_2
- %b4 = block { # true
+ %6:i32 = if %5 [t: $B4] { # if_2
+ $B4: { # true
%7:i32 = atomicAdd %buffer, 42i
exit_if %7 # if_2
}
@@ -761,8 +761,8 @@
%8:i32 = add %6, 1i
%9:bool = load %continue_execution
%10:bool = eq %9, false
- if %10 [t: %b5] { # if_3
- %b5 = block { # true
+ if %10 [t: $B5] { # if_3
+ $B5: { # true
terminate_invocation
}
}
@@ -806,14 +806,14 @@
exchanged:bool @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
discard
exit_if # if_1
}
@@ -833,22 +833,22 @@
exchanged:bool @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%ep = @fragment func(%front_facing:bool [@front_facing]):f32 [@location(0)] {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- %6:__atomic_compare_exchange_result_i32 = if %5 [t: %b4] { # if_2
- %b4 = block { # true
+ %6:__atomic_compare_exchange_result_i32 = if %5 [t: $B4] { # if_2
+ $B4: { # true
%7:__atomic_compare_exchange_result_i32 = atomicCompareExchangeWeak %buffer, 0i, 42i
exit_if %7 # if_2
}
@@ -858,8 +858,8 @@
%9:i32 = add %8, 1i
%10:bool = load %continue_execution
%11:bool = eq %10, false
- if %11 [t: %b5] { # if_3
- %b5 = block { # true
+ if %11 [t: $B5] { # if_3
+ $B5: { # true
terminate_invocation
}
}
@@ -883,7 +883,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
discard
ret
}
@@ -892,12 +892,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%continue_execution:ptr<private, bool, read_write> = var, true
}
%foo = func():void {
- %b2 = block {
+ $B2: {
store %continue_execution, false
ret
}
diff --git a/src/tint/lang/core/ir/transform/direct_variable_access_test.cc b/src/tint/lang/core/ir/transform/direct_variable_access_test.cc
index 8a8d7a8..cf464d3 100644
--- a/src/tint/lang/core/ir/transform/direct_variable_access_test.cc
+++ b/src/tint/lang/core/ir/transform/direct_variable_access_test.cc
@@ -75,12 +75,12 @@
b.Append(u->Block(), [&] { b.Return(u, b.Load(p)); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
%u = func(%pre:i32, %p:ptr<uniform, i32, read>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
@@ -90,7 +90,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
@@ -114,12 +114,12 @@
b.Append(s->Block(), [&] { b.Return(s, b.Load(p)); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
%s = func(%pre:i32, %p:ptr<storage, i32, read>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
@@ -129,7 +129,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
@@ -153,12 +153,12 @@
b.Append(w->Block(), [&] { b.Return(w, b.Load(p)); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
%w = func(%pre:i32, %p:ptr<workgroup, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
@@ -168,7 +168,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
@@ -192,12 +192,12 @@
b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
%f = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
@@ -226,12 +226,12 @@
b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
%f = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
@@ -241,7 +241,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
@@ -264,12 +264,12 @@
b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
%f = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
@@ -298,12 +298,12 @@
b.Append(f->Block(), [&] { b.Return(f, b.Load(p)); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
%f = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
@@ -312,7 +312,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%keep_me:ptr<private, i32, read_write> = var, 42i
}
@@ -384,18 +384,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p:ptr<uniform, vec4<i32>, read>, %post:i32):vec4<i32> {
- %b2 = block {
+ $B2: {
%6:vec4<i32> = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%p0:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %U
%p1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0, 1i
%p2:ptr<uniform, array<vec4<i32>, 8>, read> = access %p1, 2i
@@ -405,7 +405,7 @@
}
}
%c = func(%p_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>):void { # %p_1: 'p'
- %b4 = block {
+ $B4: {
%p0_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %p_1 # %p0_1: 'p0'
%p1_1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0_1, 1i # %p1_1: 'p1'
%p2_1:ptr<uniform, array<vec4<i32>, 8>, read> = access %p1_1, 2i # %p2_1: 'p2'
@@ -415,7 +415,7 @@
}
}
%d = func():void {
- %b5 = block {
+ $B5: {
%21:void = call %c, %U
ret
}
@@ -426,12 +426,12 @@
auto* expect =
R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p_indices:array<u32, 3>, %post:i32):vec4<i32> {
- %b2 = block {
+ $B2: {
%6:u32 = access %p_indices, 0u
%7:u32 = access %p_indices, 1u
%8:u32 = access %p_indices, 2u
@@ -441,7 +441,7 @@
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%12:u32 = convert 3i
%13:u32 = convert 2i
%14:u32 = convert 1i
@@ -451,7 +451,7 @@
}
}
%c = func():void {
- %b4 = block {
+ $B4: {
%18:u32 = convert 3i
%19:u32 = convert 2i
%20:u32 = convert 1i
@@ -461,7 +461,7 @@
}
}
%d = func():void {
- %b5 = block {
+ $B5: {
%24:void = call %c
ret
}
@@ -539,13 +539,13 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
%i:ptr<private, i32, read_write> = var
}
%first = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, 1i
store %i, %5
@@ -554,7 +554,7 @@
}
}
%second = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = load %i
%9:i32 = add %8, 1i
store %i, %9
@@ -563,7 +563,7 @@
}
}
%third = func():i32 {
- %b4 = block {
+ $B4: {
%12:i32 = load %i
%13:i32 = add %12, 1i
store %i, %13
@@ -572,13 +572,13 @@
}
}
%a = func(%pre:i32, %p:ptr<uniform, vec4<i32>, read>, %post:i32):vec4<i32> {
- %b5 = block {
+ $B5: {
%19:vec4<i32> = load %p
ret %19
}
}
%b = func():void {
- %b6 = block {
+ $B6: {
%p0:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %U
%22:i32 = call %first
%p1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0, %22
@@ -590,7 +590,7 @@
}
}
%c = func(%p_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read>):void { # %p_1: 'p'
- %b7 = block {
+ $B7: {
%p0_1:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = let %p_1 # %p0_1: 'p0'
%31:i32 = call %first
%p1_1:ptr<uniform, array<array<vec4<i32>, 8>, 8>, read> = access %p0_1, %31 # %p1_1: 'p1'
@@ -602,7 +602,7 @@
}
}
%d = func():void {
- %b8 = block {
+ $B8: {
%38:void = call %c, %U
ret
}
@@ -612,13 +612,13 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<array<array<vec4<i32>, 8>, 8>, 8>, read> = var @binding_point(0, 0)
%i:ptr<private, i32, read_write> = var
}
%first = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, 1i
store %i, %5
@@ -627,7 +627,7 @@
}
}
%second = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = load %i
%9:i32 = add %8, 1i
store %i, %9
@@ -636,7 +636,7 @@
}
}
%third = func():i32 {
- %b4 = block {
+ $B4: {
%12:i32 = load %i
%13:i32 = add %12, 1i
store %i, %13
@@ -645,7 +645,7 @@
}
}
%a = func(%pre:i32, %p_indices:array<u32, 3>, %post:i32):vec4<i32> {
- %b5 = block {
+ $B5: {
%19:u32 = access %p_indices, 0u
%20:u32 = access %p_indices, 1u
%21:u32 = access %p_indices, 2u
@@ -655,7 +655,7 @@
}
}
%b = func():void {
- %b6 = block {
+ $B6: {
%25:i32 = call %first
%26:i32 = call %second
%27:i32 = call %third
@@ -668,7 +668,7 @@
}
}
%c = func():void {
- %b7 = block {
+ $B7: {
%34:i32 = call %first
%35:i32 = call %second
%36:i32 = call %third
@@ -681,7 +681,7 @@
}
}
%d = func():void {
- %b8 = block {
+ $B8: {
%43:void = call %c
ret
}
@@ -726,18 +726,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, i32, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p:ptr<uniform, i32, read>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 10i, %U, 20i
ret
}
@@ -747,19 +747,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, i32, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%5:ptr<uniform, i32, read> = access %U
%6:i32 = load %5
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 10i, 20i
ret
}
@@ -797,18 +797,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p:ptr<uniform, vec4<i32>, read>, %post:i32):vec4<i32> {
- %b2 = block {
+ $B2: {
%6:vec4<i32> = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%I:i32 = let 3i
%9:ptr<uniform, vec4<i32>, read> = access %U, %I
%10:vec4<i32> = call %a, 10i, %9, 20i
@@ -820,12 +820,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):vec4<i32> {
- %b2 = block {
+ $B2: {
%6:u32 = access %p_indices, 0u
%7:ptr<uniform, vec4<i32>, read> = access %U, %6
%8:vec4<i32> = load %7
@@ -833,7 +833,7 @@
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%I:i32 = let 3i
%11:u32 = convert %I
%12:array<u32, 1> = construct %11
@@ -952,18 +952,18 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%f0 = func(%p:ptr<uniform, vec4<f32>, read>):f32 {
- %b2 = block {
+ $B2: {
%4:f32 = load_vector_element %p, 0u
ret %4
}
}
%f1 = func(%p_1:ptr<uniform, mat3x4<f32>, read>):f32 { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%res:ptr<function, f32, read_write> = var
%8:ptr<uniform, vec4<f32>, read> = access %p_1, 1i
%9:f32 = call %f0, %8
@@ -990,14 +990,14 @@
}
}
%f2 = func(%p_2:ptr<uniform, Inner, read>):f32 { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%p_mat:ptr<uniform, mat3x4<f32>, read> = access %p_2, 0u
%28:f32 = call %f1, %p_mat
ret %28
}
}
%f3 = func(%p0:ptr<uniform, array<Inner, 4>, read>, %p1:ptr<uniform, mat3x4<f32>, read>):f32 {
- %b5 = block {
+ $B5: {
%p0_inner:ptr<uniform, Inner, read> = access %p0, 3i
%33:f32 = call %f2, %p0_inner
%34:f32 = call %f1, %p1
@@ -1006,7 +1006,7 @@
}
}
%f4 = func(%p_3:ptr<uniform, Outer, read>):f32 { # %p_3: 'p'
- %b6 = block {
+ $B6: {
%38:ptr<uniform, array<Inner, 4>, read> = access %p_3, 0u
%39:ptr<uniform, mat3x4<f32>, read> = access %U, 1u
%40:f32 = call %f3, %38, %39
@@ -1014,7 +1014,7 @@
}
}
%b = func():void {
- %b7 = block {
+ $B7: {
%42:f32 = call %f4, %U
ret
}
@@ -1033,12 +1033,12 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%f0 = func(%p_indices:array<u32, 1>):f32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:ptr<uniform, vec4<f32>, read> = access %U, 1u, %4
%6:f32 = load_vector_element %5, 0u
@@ -1046,7 +1046,7 @@
}
}
%f0_1 = func(%p_indices_1:array<u32, 2>):f32 { # %f0_1: 'f0', %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%9:u32 = access %p_indices_1, 0u
%10:u32 = access %p_indices_1, 1u
%11:ptr<uniform, vec4<f32>, read> = access %U, 0u, %9, 0u, %10
@@ -1055,7 +1055,7 @@
}
}
%f1 = func():f32 {
- %b4 = block {
+ $B4: {
%res:ptr<function, f32, read_write> = var
%15:u32 = convert 1i
%16:array<u32, 1> = construct %15
@@ -1088,7 +1088,7 @@
}
}
%f1_1 = func(%p_indices_2:array<u32, 1>):f32 { # %f1_1: 'f1', %p_indices_2: 'p_indices'
- %b5 = block {
+ $B5: {
%40:u32 = access %p_indices_2, 0u
%res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
%42:u32 = convert 1i
@@ -1122,7 +1122,7 @@
}
}
%f2 = func(%p_indices_3:array<u32, 1>):f32 { # %p_indices_3: 'p_indices'
- %b6 = block {
+ $B6: {
%67:u32 = access %p_indices_3, 0u
%68:array<u32, 1> = construct %67
%69:f32 = call %f1_1, %68
@@ -1130,7 +1130,7 @@
}
}
%f3 = func():f32 {
- %b7 = block {
+ $B7: {
%71:u32 = convert 3i
%72:array<u32, 1> = construct %71
%73:f32 = call %f2, %72
@@ -1140,13 +1140,13 @@
}
}
%f4 = func():f32 {
- %b8 = block {
+ $B8: {
%77:f32 = call %f3
ret %77
}
}
%b = func():void {
- %b9 = block {
+ $B9: {
%79:f32 = call %f4
ret
}
@@ -1202,33 +1202,33 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<array<array<vec4<i32>, 5>, 5>, 5>, read> = var @binding_point(0, 0)
}
%f2 = func(%p:ptr<uniform, array<vec4<i32>, 5>, read>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:ptr<uniform, vec4<i32>, read> = access %p, 3u
%5:vec4<i32> = load %4
ret %5
}
}
%f1 = func(%p_1:ptr<uniform, array<array<vec4<i32>, 5>, 5>, read>):vec4<i32> { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%8:ptr<uniform, array<vec4<i32>, 5>, read> = access %p_1, 2u
%9:vec4<i32> = call %f2, %8
ret %9
}
}
%f0 = func(%p_2:ptr<uniform, array<array<array<vec4<i32>, 5>, 5>, 5>, read>):vec4<i32> { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%12:ptr<uniform, array<array<vec4<i32>, 5>, 5>, read> = access %p_2, 1u
%13:vec4<i32> = call %f1, %12
ret %13
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%15:vec4<i32> = call %f0, %U
ret
}
@@ -1238,12 +1238,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, array<array<array<vec4<i32>, 5>, 5>, 5>, read> = var @binding_point(0, 0)
}
%f2 = func(%p_indices:array<u32, 2>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:u32 = access %p_indices, 1u
%6:ptr<uniform, array<vec4<i32>, 5>, read> = access %U, %4, %5
@@ -1253,7 +1253,7 @@
}
}
%f1 = func(%p_indices_1:array<u32, 1>):vec4<i32> { # %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%11:u32 = access %p_indices_1, 0u
%12:array<u32, 2> = construct %11, 2u
%13:vec4<i32> = call %f2, %12
@@ -1261,14 +1261,14 @@
}
}
%f0 = func():vec4<i32> {
- %b4 = block {
+ $B4: {
%15:array<u32, 1> = construct 1u
%16:vec4<i32> = call %f1, %15
ret %16
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%18:vec4<i32> = call %f0
ret
}
@@ -1322,18 +1322,18 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, str, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p:ptr<storage, i32, read>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:ptr<storage, i32, read> = access %S, 0u
%9:i32 = call %a, 10i, %8, 20i
ret
@@ -1348,19 +1348,19 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, str, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%5:ptr<storage, i32, read> = access %S, 0u
%6:i32 = load %5
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 10i, 20i
ret
}
@@ -1409,18 +1409,18 @@
arr:array<i32, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, str, read_write> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p:ptr<storage, array<i32, 4>, read_write>, %post:i32):void {
- %b2 = block {
+ $B2: {
store %p, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:ptr<storage, array<i32, 4>, read_write> = access %S, 0u
%8:void = call %a, 10i, %7, 20i
ret
@@ -1435,19 +1435,19 @@
arr:array<i32, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, str, read_write> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %post:i32):void {
- %b2 = block {
+ $B2: {
%5:ptr<storage, array<i32, 4>, read_write> = access %S, 0u
store %5, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:void = call %a, 10i, 20i
ret
}
@@ -1488,18 +1488,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<vec4<i32>, 8>, read_write> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p:ptr<storage, vec4<i32>, read_write>, %post:i32):void {
- %b2 = block {
+ $B2: {
store %p, vec4<i32>(0i)
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%I:i32 = let 3i
%8:ptr<storage, vec4<i32>, read_write> = access %S, %I
%9:void = call %a, 10i, %8, 20i
@@ -1511,12 +1511,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<vec4<i32>, 8>, read_write> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):void {
- %b2 = block {
+ $B2: {
%6:u32 = access %p_indices, 0u
%7:ptr<storage, vec4<i32>, read_write> = access %S, %6
store %7, vec4<i32>(0i)
@@ -1524,7 +1524,7 @@
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%I:i32 = let 3i
%10:u32 = convert %I
%11:array<u32, 1> = construct %10
@@ -1643,18 +1643,18 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, Outer, read> = var @binding_point(0, 0)
}
%f0 = func(%p:ptr<storage, vec4<f32>, read>):f32 {
- %b2 = block {
+ $B2: {
%4:f32 = load_vector_element %p, 0u
ret %4
}
}
%f1 = func(%p_1:ptr<storage, mat3x4<f32>, read>):f32 { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%res:ptr<function, f32, read_write> = var
%8:ptr<storage, vec4<f32>, read> = access %p_1, 1i
%9:f32 = call %f0, %8
@@ -1681,14 +1681,14 @@
}
}
%f2 = func(%p_2:ptr<storage, Inner, read>):f32 { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%p_mat:ptr<storage, mat3x4<f32>, read> = access %p_2, 0u
%28:f32 = call %f1, %p_mat
ret %28
}
}
%f3 = func(%p0:ptr<storage, array<Inner, 4>, read>, %p1:ptr<storage, mat3x4<f32>, read>):f32 {
- %b5 = block {
+ $B5: {
%p0_inner:ptr<storage, Inner, read> = access %p0, 3i
%33:f32 = call %f2, %p0_inner
%34:f32 = call %f1, %p1
@@ -1697,7 +1697,7 @@
}
}
%f4 = func(%p_3:ptr<storage, Outer, read>):f32 { # %p_3: 'p'
- %b6 = block {
+ $B6: {
%38:ptr<storage, array<Inner, 4>, read> = access %p_3, 0u
%39:ptr<storage, mat3x4<f32>, read> = access %S, 1u
%40:f32 = call %f3, %38, %39
@@ -1705,7 +1705,7 @@
}
}
%b = func():void {
- %b7 = block {
+ $B7: {
%42:f32 = call %f4, %S
ret
}
@@ -1724,12 +1724,12 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, Outer, read> = var @binding_point(0, 0)
}
%f0 = func(%p_indices:array<u32, 1>):f32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:ptr<storage, vec4<f32>, read> = access %S, 1u, %4
%6:f32 = load_vector_element %5, 0u
@@ -1737,7 +1737,7 @@
}
}
%f0_1 = func(%p_indices_1:array<u32, 2>):f32 { # %f0_1: 'f0', %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%9:u32 = access %p_indices_1, 0u
%10:u32 = access %p_indices_1, 1u
%11:ptr<storage, vec4<f32>, read> = access %S, 0u, %9, 0u, %10
@@ -1746,7 +1746,7 @@
}
}
%f1 = func():f32 {
- %b4 = block {
+ $B4: {
%res:ptr<function, f32, read_write> = var
%15:u32 = convert 1i
%16:array<u32, 1> = construct %15
@@ -1779,7 +1779,7 @@
}
}
%f1_1 = func(%p_indices_2:array<u32, 1>):f32 { # %f1_1: 'f1', %p_indices_2: 'p_indices'
- %b5 = block {
+ $B5: {
%40:u32 = access %p_indices_2, 0u
%res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
%42:u32 = convert 1i
@@ -1813,7 +1813,7 @@
}
}
%f2 = func(%p_indices_3:array<u32, 1>):f32 { # %p_indices_3: 'p_indices'
- %b6 = block {
+ $B6: {
%67:u32 = access %p_indices_3, 0u
%68:array<u32, 1> = construct %67
%69:f32 = call %f1_1, %68
@@ -1821,7 +1821,7 @@
}
}
%f3 = func():f32 {
- %b7 = block {
+ $B7: {
%71:u32 = convert 3i
%72:array<u32, 1> = construct %71
%73:f32 = call %f2, %72
@@ -1831,13 +1831,13 @@
}
}
%f4 = func():f32 {
- %b8 = block {
+ $B8: {
%77:f32 = call %f3
ret %77
}
}
%b = func():void {
- %b9 = block {
+ $B9: {
%79:f32 = call %f4
ret
}
@@ -1893,33 +1893,33 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<storage, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var @binding_point(0, 0)
}
%f2 = func(%p:ptr<storage, array<vec4<i32>, 5>, read_write>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:ptr<storage, vec4<i32>, read_write> = access %p, 3u
%5:vec4<i32> = load %4
ret %5
}
}
%f1 = func(%p_1:ptr<storage, array<array<vec4<i32>, 5>, 5>, read_write>):vec4<i32> { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%8:ptr<storage, array<vec4<i32>, 5>, read_write> = access %p_1, 2u
%9:vec4<i32> = call %f2, %8
ret %9
}
}
%f0 = func(%p_2:ptr<storage, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>):vec4<i32> { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%12:ptr<storage, array<array<vec4<i32>, 5>, 5>, read_write> = access %p_2, 1u
%13:vec4<i32> = call %f1, %12
ret %13
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%15:vec4<i32> = call %f0, %U
ret
}
@@ -1929,12 +1929,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<storage, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var @binding_point(0, 0)
}
%f2 = func(%p_indices:array<u32, 2>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:u32 = access %p_indices, 1u
%6:ptr<storage, array<vec4<i32>, 5>, read_write> = access %U, %4, %5
@@ -1944,7 +1944,7 @@
}
}
%f1 = func(%p_indices_1:array<u32, 1>):vec4<i32> { # %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%11:u32 = access %p_indices_1, 0u
%12:array<u32, 2> = construct %11, 2u
%13:vec4<i32> = call %f2, %12
@@ -1952,14 +1952,14 @@
}
}
%f0 = func():vec4<i32> {
- %b4 = block {
+ $B4: {
%15:array<u32, 1> = construct 1u
%16:vec4<i32> = call %f1, %15
ret %16
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%18:vec4<i32> = call %f0
ret
}
@@ -2004,18 +2004,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
}
%a = func(%pre:i32, %p:ptr<workgroup, vec4<i32>, read_write>, %post:i32):vec4<i32> {
- %b2 = block {
+ $B2: {
%6:vec4<i32> = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:ptr<workgroup, vec4<i32>, read_write> = access %W, 3i
%9:vec4<i32> = call %a, 10i, %8, 20i
ret
@@ -2026,12 +2026,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
}
%a = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):vec4<i32> {
- %b2 = block {
+ $B2: {
%6:u32 = access %p_indices, 0u
%7:ptr<workgroup, vec4<i32>, read_write> = access %W, %6
%8:vec4<i32> = load %7
@@ -2039,7 +2039,7 @@
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%10:u32 = convert 3i
%11:array<u32, 1> = construct %10
%12:vec4<i32> = call %a, 10i, %11, 20i
@@ -2080,18 +2080,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
}
%a = func(%pre:i32, %p:ptr<workgroup, vec4<i32>, read_write>, %post:i32):void {
- %b2 = block {
+ $B2: {
store %p, vec4<i32>(0i)
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:ptr<workgroup, vec4<i32>, read_write> = access %W, 3i
%8:void = call %a, 10i, %7, 20i
ret
@@ -2102,12 +2102,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, array<vec4<i32>, 8>, read_write> = var
}
%a = func(%pre:i32, %p_indices:array<u32, 1>, %post:i32):void {
- %b2 = block {
+ $B2: {
%6:u32 = access %p_indices, 0u
%7:ptr<workgroup, vec4<i32>, read_write> = access %W, %6
store %7, vec4<i32>(0i)
@@ -2115,7 +2115,7 @@
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%9:u32 = convert 3i
%10:array<u32, 1> = construct %9
%11:void = call %a, 10i, %10, 20i
@@ -2232,18 +2232,18 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, Outer, read_write> = var
}
%f0 = func(%p:ptr<workgroup, vec4<f32>, read_write>):f32 {
- %b2 = block {
+ $B2: {
%4:f32 = load_vector_element %p, 0u
ret %4
}
}
%f1 = func(%p_1:ptr<workgroup, mat3x4<f32>, read_write>):f32 { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%res:ptr<function, f32, read_write> = var
%8:ptr<workgroup, vec4<f32>, read_write> = access %p_1, 1i
%9:f32 = call %f0, %8
@@ -2270,14 +2270,14 @@
}
}
%f2 = func(%p_2:ptr<workgroup, Inner, read_write>):f32 { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%p_mat:ptr<workgroup, mat3x4<f32>, read_write> = access %p_2, 0u
%28:f32 = call %f1, %p_mat
ret %28
}
}
%f3 = func(%p0:ptr<workgroup, array<Inner, 4>, read_write>, %p1:ptr<workgroup, mat3x4<f32>, read_write>):f32 {
- %b5 = block {
+ $B5: {
%p0_inner:ptr<workgroup, Inner, read_write> = access %p0, 3i
%33:f32 = call %f2, %p0_inner
%34:f32 = call %f1, %p1
@@ -2286,7 +2286,7 @@
}
}
%f4 = func(%p_3:ptr<workgroup, Outer, read_write>):f32 { # %p_3: 'p'
- %b6 = block {
+ $B6: {
%38:ptr<workgroup, array<Inner, 4>, read_write> = access %p_3, 0u
%39:ptr<workgroup, mat3x4<f32>, read_write> = access %W, 1u
%40:f32 = call %f3, %38, %39
@@ -2294,7 +2294,7 @@
}
}
%b = func():void {
- %b7 = block {
+ $B7: {
%42:f32 = call %f4, %W
ret
}
@@ -2313,12 +2313,12 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, Outer, read_write> = var
}
%f0 = func(%p_indices:array<u32, 1>):f32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:ptr<workgroup, vec4<f32>, read_write> = access %W, 1u, %4
%6:f32 = load_vector_element %5, 0u
@@ -2326,7 +2326,7 @@
}
}
%f0_1 = func(%p_indices_1:array<u32, 2>):f32 { # %f0_1: 'f0', %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%9:u32 = access %p_indices_1, 0u
%10:u32 = access %p_indices_1, 1u
%11:ptr<workgroup, vec4<f32>, read_write> = access %W, 0u, %9, 0u, %10
@@ -2335,7 +2335,7 @@
}
}
%f1 = func():f32 {
- %b4 = block {
+ $B4: {
%res:ptr<function, f32, read_write> = var
%15:u32 = convert 1i
%16:array<u32, 1> = construct %15
@@ -2368,7 +2368,7 @@
}
}
%f1_1 = func(%p_indices_2:array<u32, 1>):f32 { # %f1_1: 'f1', %p_indices_2: 'p_indices'
- %b5 = block {
+ $B5: {
%40:u32 = access %p_indices_2, 0u
%res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
%42:u32 = convert 1i
@@ -2402,7 +2402,7 @@
}
}
%f2 = func(%p_indices_3:array<u32, 1>):f32 { # %p_indices_3: 'p_indices'
- %b6 = block {
+ $B6: {
%67:u32 = access %p_indices_3, 0u
%68:array<u32, 1> = construct %67
%69:f32 = call %f1_1, %68
@@ -2410,7 +2410,7 @@
}
}
%f3 = func():f32 {
- %b7 = block {
+ $B7: {
%71:u32 = convert 3i
%72:array<u32, 1> = construct %71
%73:f32 = call %f2, %72
@@ -2420,13 +2420,13 @@
}
}
%f4 = func():f32 {
- %b8 = block {
+ $B8: {
%77:f32 = call %f3
ret %77
}
}
%b = func():void {
- %b9 = block {
+ $B9: {
%79:f32 = call %f4
ret
}
@@ -2482,33 +2482,33 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<workgroup, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var @binding_point(0, 0)
}
%f2 = func(%p:ptr<workgroup, array<vec4<i32>, 5>, read_write>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:ptr<workgroup, vec4<i32>, read_write> = access %p, 3u
%5:vec4<i32> = load %4
ret %5
}
}
%f1 = func(%p_1:ptr<workgroup, array<array<vec4<i32>, 5>, 5>, read_write>):vec4<i32> { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%8:ptr<workgroup, array<vec4<i32>, 5>, read_write> = access %p_1, 2u
%9:vec4<i32> = call %f2, %8
ret %9
}
}
%f0 = func(%p_2:ptr<workgroup, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>):vec4<i32> { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%12:ptr<workgroup, array<array<vec4<i32>, 5>, 5>, read_write> = access %p_2, 1u
%13:vec4<i32> = call %f1, %12
ret %13
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%15:vec4<i32> = call %f0, %U
ret
}
@@ -2518,12 +2518,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%U:ptr<workgroup, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var @binding_point(0, 0)
}
%f2 = func(%p_indices:array<u32, 2>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:u32 = access %p_indices, 1u
%6:ptr<workgroup, array<vec4<i32>, 5>, read_write> = access %U, %4, %5
@@ -2533,7 +2533,7 @@
}
}
%f1 = func(%p_indices_1:array<u32, 1>):vec4<i32> { # %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%11:u32 = access %p_indices_1, 0u
%12:array<u32, 2> = construct %11, 2u
%13:vec4<i32> = call %f2, %12
@@ -2541,14 +2541,14 @@
}
}
%f0 = func():vec4<i32> {
- %b4 = block {
+ $B4: {
%15:array<u32, 1> = construct 1u
%16:vec4<i32> = call %f1, %15
ret %16
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%18:vec4<i32> = call %f0
ret
}
@@ -2592,18 +2592,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, i32, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 10i, %P, 20i
ret
}
@@ -2613,19 +2613,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, i32, read_write> = var
}
%a = func(%pre:i32, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%5:ptr<private, i32, read_write> = access %P
%6:i32 = load %5
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 10i, 20i
ret
}
@@ -2663,18 +2663,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, i32, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):void {
- %b2 = block {
+ $B2: {
store %p, 42i
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:void = call %a, 10i, %P, 20i
ret
}
@@ -2684,19 +2684,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, i32, read_write> = var
}
%a = func(%pre:i32, %post:i32):void {
- %b2 = block {
+ $B2: {
%5:ptr<private, i32, read_write> = access %P
store %5, 42i
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:void = call %a, 10i, 20i
ret
}
@@ -2740,18 +2740,18 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, str, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:ptr<private, i32, read_write> = access %P, 0u
%9:i32 = call %a, 10i, %8, 20i
ret
@@ -2766,19 +2766,19 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, str, read_write> = var
}
%a = func(%pre:i32, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%5:ptr<private, i32, read_write> = access %P, 0u
%6:i32 = load %5
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 10i, 20i
ret
}
@@ -2822,18 +2822,18 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, str, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %p
ret %6
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%8:ptr<private, i32, read_write> = access %P, 0u
%9:i32 = call %a, 10i, %8, 20i
ret
@@ -2886,18 +2886,18 @@
arr:array<i32, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, str, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, array<i32, 4>, read_write>, %post:i32):void {
- %b2 = block {
+ $B2: {
store %p, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:ptr<private, array<i32, 4>, read_write> = access %P, 0u
%8:void = call %a, 10i, %7, 20i
ret
@@ -2912,19 +2912,19 @@
arr:array<i32, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, str, read_write> = var
}
%a = func(%pre:i32, %post:i32):void {
- %b2 = block {
+ $B2: {
%5:ptr<private, array<i32, 4>, read_write> = access %P, 0u
store %5, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:void = call %a, 10i, 20i
ret
}
@@ -2972,18 +2972,18 @@
arr:array<i32, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, str, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, array<i32, 4>, read_write>, %post:i32):void {
- %b2 = block {
+ $B2: {
store %p, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%7:ptr<private, array<i32, 4>, read_write> = access %P, 0u
%8:void = call %a, 10i, %7, 20i
ret
@@ -3045,20 +3045,20 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%Pi:ptr<private, i32, read_write> = var
%Ps:ptr<private, str, read_write> = var
%Pa:ptr<private, array<i32, 4>, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%8:i32 = load %p
ret %8
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%10:i32 = call %a, 10i, %Pi, 20i
%11:ptr<private, i32, read_write> = access %Ps, 0u
%12:i32 = call %a, 30i, %11, 40i
@@ -3076,28 +3076,28 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%Pi:ptr<private, i32, read_write> = var
%Ps:ptr<private, str, read_write> = var
%Pa:ptr<private, array<i32, 4>, read_write> = var
}
%a = func(%pre:i32, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%7:ptr<private, i32, read_write> = access %Pi
%8:i32 = load %7
ret %8
}
}
%a_1 = func(%pre_1:i32, %post_1:i32):i32 { # %a_1: 'a', %pre_1: 'pre', %post_1: 'post'
- %b3 = block {
+ $B3: {
%12:ptr<private, i32, read_write> = access %Ps, 0u
%13:i32 = load %12
ret %13
}
}
%a_2 = func(%pre_2:i32, %p_indices:array<u32, 1>, %post_2:i32):i32 { # %a_2: 'a', %pre_2: 'pre', %post_2: 'post'
- %b4 = block {
+ $B4: {
%18:u32 = access %p_indices, 0u
%19:ptr<private, i32, read_write> = access %Pa, %18
%20:i32 = load %19
@@ -3105,7 +3105,7 @@
}
}
%b = func():void {
- %b5 = block {
+ $B5: {
%22:i32 = call %a, 10i, 20i
%23:i32 = call %a_1, 30i, 40i
%24:u32 = convert 2i
@@ -3166,20 +3166,20 @@
i:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%Pi:ptr<private, i32, read_write> = var
%Ps:ptr<private, str, read_write> = var
%Pa:ptr<private, array<i32, 4>, read_write> = var
}
%a = func(%pre:i32, %p:ptr<private, i32, read_write>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%8:i32 = load %p
ret %8
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%10:i32 = call %a, 10i, %Pi, 20i
%11:ptr<private, i32, read_write> = access %Ps, 0u
%12:i32 = call %a, 30i, %11, 40i
@@ -3302,18 +3302,18 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, Outer, read_write> = var
}
%f0 = func(%p:ptr<private, vec4<f32>, read_write>):f32 {
- %b2 = block {
+ $B2: {
%4:f32 = load_vector_element %p, 0u
ret %4
}
}
%f1 = func(%p_1:ptr<private, mat3x4<f32>, read_write>):f32 { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%res:ptr<function, f32, read_write> = var
%8:ptr<private, vec4<f32>, read_write> = access %p_1, 1i
%9:f32 = call %f0, %8
@@ -3340,14 +3340,14 @@
}
}
%f2 = func(%p_2:ptr<private, Inner, read_write>):f32 { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%p_mat:ptr<private, mat3x4<f32>, read_write> = access %p_2, 0u
%28:f32 = call %f1, %p_mat
ret %28
}
}
%f3 = func(%p0:ptr<private, array<Inner, 4>, read_write>, %p1:ptr<private, mat3x4<f32>, read_write>):f32 {
- %b5 = block {
+ $B5: {
%p0_inner:ptr<private, Inner, read_write> = access %p0, 3i
%33:f32 = call %f2, %p0_inner
%34:f32 = call %f1, %p1
@@ -3356,7 +3356,7 @@
}
}
%f4 = func(%p_3:ptr<private, Outer, read_write>):f32 { # %p_3: 'p'
- %b6 = block {
+ $B6: {
%38:ptr<private, array<Inner, 4>, read_write> = access %p_3, 0u
%39:ptr<private, mat3x4<f32>, read_write> = access %P, 1u
%40:f32 = call %f3, %38, %39
@@ -3364,7 +3364,7 @@
}
}
%b = func():void {
- %b7 = block {
+ $B7: {
%42:f32 = call %f4, %P
ret
}
@@ -3383,12 +3383,12 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, Outer, read_write> = var
}
%f0 = func(%p_indices:array<u32, 1>):f32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:ptr<private, vec4<f32>, read_write> = access %P, 1u, %4
%6:f32 = load_vector_element %5, 0u
@@ -3396,7 +3396,7 @@
}
}
%f0_1 = func(%p_indices_1:array<u32, 2>):f32 { # %f0_1: 'f0', %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%9:u32 = access %p_indices_1, 0u
%10:u32 = access %p_indices_1, 1u
%11:ptr<private, vec4<f32>, read_write> = access %P, 0u, %9, 0u, %10
@@ -3405,7 +3405,7 @@
}
}
%f1 = func():f32 {
- %b4 = block {
+ $B4: {
%res:ptr<function, f32, read_write> = var
%15:u32 = convert 1i
%16:array<u32, 1> = construct %15
@@ -3438,7 +3438,7 @@
}
}
%f1_1 = func(%p_indices_2:array<u32, 1>):f32 { # %f1_1: 'f1', %p_indices_2: 'p_indices'
- %b5 = block {
+ $B5: {
%40:u32 = access %p_indices_2, 0u
%res_1:ptr<function, f32, read_write> = var # %res_1: 'res'
%42:u32 = convert 1i
@@ -3472,7 +3472,7 @@
}
}
%f2 = func(%p_indices_3:array<u32, 1>):f32 { # %p_indices_3: 'p_indices'
- %b6 = block {
+ $B6: {
%67:u32 = access %p_indices_3, 0u
%68:array<u32, 1> = construct %67
%69:f32 = call %f1_1, %68
@@ -3480,7 +3480,7 @@
}
}
%f3 = func():f32 {
- %b7 = block {
+ $B7: {
%71:u32 = convert 3i
%72:array<u32, 1> = construct %71
%73:f32 = call %f2, %72
@@ -3490,13 +3490,13 @@
}
}
%f4 = func():f32 {
- %b8 = block {
+ $B8: {
%77:f32 = call %f3
ret %77
}
}
%b = func():void {
- %b9 = block {
+ $B9: {
%79:f32 = call %f4
ret
}
@@ -3611,18 +3611,18 @@
mat:mat3x4<f32> @offset(192)
}
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, Outer, read_write> = var
}
%f0 = func(%p:ptr<private, vec4<f32>, read_write>):f32 {
- %b2 = block {
+ $B2: {
%4:f32 = load_vector_element %p, 0u
ret %4
}
}
%f1 = func(%p_1:ptr<private, mat3x4<f32>, read_write>):f32 { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%res:ptr<function, f32, read_write> = var
%8:ptr<private, vec4<f32>, read_write> = access %p_1, 1i
%9:f32 = call %f0, %8
@@ -3649,14 +3649,14 @@
}
}
%f2 = func(%p_2:ptr<private, Inner, read_write>):f32 { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%p_mat:ptr<private, mat3x4<f32>, read_write> = access %p_2, 0u
%28:f32 = call %f1, %p_mat
ret %28
}
}
%f3 = func(%p0:ptr<private, array<Inner, 4>, read_write>, %p1:ptr<private, mat3x4<f32>, read_write>):f32 {
- %b5 = block {
+ $B5: {
%p0_inner:ptr<private, Inner, read_write> = access %p0, 3i
%33:f32 = call %f2, %p0_inner
%34:f32 = call %f1, %p1
@@ -3665,7 +3665,7 @@
}
}
%f4 = func(%p_3:ptr<private, Outer, read_write>):f32 { # %p_3: 'p'
- %b6 = block {
+ $B6: {
%38:ptr<private, array<Inner, 4>, read_write> = access %p_3, 0u
%39:ptr<private, mat3x4<f32>, read_write> = access %P, 1u
%40:f32 = call %f3, %38, %39
@@ -3673,7 +3673,7 @@
}
}
%b = func():void {
- %b7 = block {
+ $B7: {
%42:f32 = call %f4, %P
ret
}
@@ -3733,33 +3733,33 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var
}
%f2 = func(%p:ptr<private, array<vec4<i32>, 5>, read_write>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:ptr<private, vec4<i32>, read_write> = access %p, 3u
%5:vec4<i32> = load %4
ret %5
}
}
%f1 = func(%p_1:ptr<private, array<array<vec4<i32>, 5>, 5>, read_write>):vec4<i32> { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%8:ptr<private, array<vec4<i32>, 5>, read_write> = access %p_1, 2u
%9:vec4<i32> = call %f2, %8
ret %9
}
}
%f0 = func(%p_2:ptr<private, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>):vec4<i32> { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%12:ptr<private, array<array<vec4<i32>, 5>, 5>, read_write> = access %p_2, 1u
%13:vec4<i32> = call %f1, %12
ret %13
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%15:vec4<i32> = call %f0, %P
ret
}
@@ -3769,12 +3769,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var
}
%f2 = func(%p_indices:array<u32, 2>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:u32 = access %p_indices, 0u
%5:u32 = access %p_indices, 1u
%6:ptr<private, array<vec4<i32>, 5>, read_write> = access %P, %4, %5
@@ -3784,7 +3784,7 @@
}
}
%f1 = func(%p_indices_1:array<u32, 1>):vec4<i32> { # %p_indices_1: 'p_indices'
- %b3 = block {
+ $B3: {
%11:u32 = access %p_indices_1, 0u
%12:array<u32, 2> = construct %11, 2u
%13:vec4<i32> = call %f2, %12
@@ -3792,14 +3792,14 @@
}
}
%f0 = func():vec4<i32> {
- %b4 = block {
+ $B4: {
%15:array<u32, 1> = construct 1u
%16:vec4<i32> = call %f1, %15
ret %16
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%18:vec4<i32> = call %f0
ret
}
@@ -3855,33 +3855,33 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%P:ptr<private, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var
}
%f2 = func(%p:ptr<private, array<vec4<i32>, 5>, read_write>):vec4<i32> {
- %b2 = block {
+ $B2: {
%4:ptr<private, vec4<i32>, read_write> = access %p, 3u
%5:vec4<i32> = load %4
ret %5
}
}
%f1 = func(%p_1:ptr<private, array<array<vec4<i32>, 5>, 5>, read_write>):vec4<i32> { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%8:ptr<private, array<vec4<i32>, 5>, read_write> = access %p_1, 2u
%9:vec4<i32> = call %f2, %8
ret %9
}
}
%f0 = func(%p_2:ptr<private, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>):vec4<i32> { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%12:ptr<private, array<array<vec4<i32>, 5>, 5>, read_write> = access %p_2, 1u
%13:vec4<i32> = call %f1, %12
ret %13
}
}
%main = func():void {
- %b5 = block {
+ $B5: {
%15:vec4<i32> = call %f0, %P
ret
}
@@ -3917,7 +3917,7 @@
auto* src = R"(
%f = func():void {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
%p:ptr<function, i32, read_write> = let %v
%4:i32 = load %p
@@ -3955,13 +3955,13 @@
auto* src = R"(
%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 {
- %b1 = block {
+ $B1: {
%5:i32 = load %p
ret %5
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, i32, read_write> = var
%8:i32 = call %a, 10i, %F, 20i
ret
@@ -3973,14 +3973,14 @@
auto* expect = R"(
%a = func(%pre:i32, %p_root:ptr<function, i32, read_write>, %post:i32):i32 {
- %b1 = block {
+ $B1: {
%5:ptr<function, i32, read_write> = access %p_root
%6:i32 = load %5
ret %6
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, i32, read_write> = var
%9:i32 = call %a, 10i, %F, 20i
ret
@@ -4015,13 +4015,13 @@
auto* src = R"(
%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):void {
- %b1 = block {
+ $B1: {
store %p, 42i
ret
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, i32, read_write> = var
%7:void = call %a, 10i, %F, 20i
ret
@@ -4033,14 +4033,14 @@
auto* expect = R"(
%a = func(%pre:i32, %p_root:ptr<function, i32, read_write>, %post:i32):void {
- %b1 = block {
+ $B1: {
%5:ptr<function, i32, read_write> = access %p_root
store %5, 42i
ret
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, i32, read_write> = var
%8:void = call %a, 10i, %F, 20i
ret
@@ -4081,13 +4081,13 @@
}
%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 {
- %b1 = block {
+ $B1: {
%5:i32 = load %p
ret %5
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, str, read_write> = var
%8:ptr<function, i32, read_write> = access %F, 0u
%9:i32 = call %a, 10i, %8, 20i
@@ -4104,14 +4104,14 @@
}
%a = func(%pre:i32, %p_root:ptr<function, str, read_write>, %post:i32):i32 {
- %b1 = block {
+ $B1: {
%5:ptr<function, i32, read_write> = access %p_root, 0u
%6:i32 = load %5
ret %6
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, str, read_write> = var
%9:i32 = call %a, 10i, %F, 20i
ret
@@ -4156,13 +4156,13 @@
}
%a = func(%pre:i32, %p:ptr<function, array<i32, 4>, read_write>, %post:i32):void {
- %b1 = block {
+ $B1: {
store %p, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, str, read_write> = var
%7:ptr<function, array<i32, 4>, read_write> = access %F, 0u
%8:void = call %a, 10i, %7, 20i
@@ -4179,14 +4179,14 @@
}
%a = func(%pre:i32, %p_root:ptr<function, str, read_write>, %post:i32):void {
- %b1 = block {
+ $B1: {
%5:ptr<function, array<i32, 4>, read_write> = access %p_root, 0u
store %5, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, str, read_write> = var
%8:void = call %a, 10i, %F, 20i
ret
@@ -4238,13 +4238,13 @@
}
%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 {
- %b1 = block {
+ $B1: {
%5:i32 = load %p
ret %5
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%Fi:ptr<function, i32, read_write> = var
%Fs:ptr<function, str, read_write> = var
%Fa:ptr<function, array<i32, 4>, read_write> = var
@@ -4266,21 +4266,21 @@
}
%a = func(%pre:i32, %p_root:ptr<function, i32, read_write>, %post:i32):i32 {
- %b1 = block {
+ $B1: {
%5:ptr<function, i32, read_write> = access %p_root
%6:i32 = load %5
ret %6
}
}
%a_1 = func(%pre_1:i32, %p_root_1:ptr<function, str, read_write>, %post_1:i32):i32 { # %a_1: 'a', %pre_1: 'pre', %p_root_1: 'p_root', %post_1: 'post'
- %b2 = block {
+ $B2: {
%11:ptr<function, i32, read_write> = access %p_root_1, 0u
%12:i32 = load %11
ret %12
}
}
%a_2 = func(%pre_2:i32, %p_root_2:ptr<function, array<i32, 4>, read_write>, %p_indices:array<u32, 1>, %post_2:i32):i32 { # %a_2: 'a', %pre_2: 'pre', %p_root_2: 'p_root', %post_2: 'post'
- %b3 = block {
+ $B3: {
%18:u32 = access %p_indices, 0u
%19:ptr<function, i32, read_write> = access %p_root_2, %18
%20:i32 = load %19
@@ -4288,7 +4288,7 @@
}
}
%b = func():void {
- %b4 = block {
+ $B4: {
%Fi:ptr<function, i32, read_write> = var
%Fs:ptr<function, str, read_write> = var
%Fa:ptr<function, array<i32, 4>, read_write> = var
@@ -4335,13 +4335,13 @@
}
%a = func(%pre:i32, %p:ptr<function, i32, read_write>, %post:i32):i32 {
- %b1 = block {
+ $B1: {
%5:i32 = load %p
ret %5
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, str, read_write> = var
%8:ptr<function, i32, read_write> = access %F, 0u
%9:i32 = call %a, 10i, %8, 20i
@@ -4391,13 +4391,13 @@
}
%a = func(%pre:i32, %p:ptr<function, array<i32, 4>, read_write>, %post:i32):void {
- %b1 = block {
+ $B1: {
store %p, array<i32, 4>(0i)
ret
}
}
%b = func():void {
- %b2 = block {
+ $B2: {
%F:ptr<function, str, read_write> = var
%7:ptr<function, array<i32, 4>, read_write> = access %F, 0u
%8:void = call %a, 10i, %7, 20i
@@ -4506,13 +4506,13 @@
}
%f0 = func(%p:ptr<function, vec4<f32>, read_write>):f32 {
- %b1 = block {
+ $B1: {
%3:f32 = load_vector_element %p, 0u
ret %3
}
}
%f1 = func(%p_1:ptr<function, mat3x4<f32>, read_write>):f32 { # %p_1: 'p'
- %b2 = block {
+ $B2: {
%res:ptr<function, f32, read_write> = var
%7:ptr<function, vec4<f32>, read_write> = access %p_1, 1i
%8:f32 = call %f0, %7
@@ -4529,28 +4529,28 @@
}
}
%f2 = func(%p_2:ptr<function, Inner, read_write>):f32 { # %p_2: 'p'
- %b3 = block {
+ $B3: {
%p_mat:ptr<function, mat3x4<f32>, read_write> = access %p_2, 0u
%19:f32 = call %f1, %p_mat
ret %19
}
}
%f3 = func(%p_3:ptr<function, array<Inner, 4>, read_write>):f32 { # %p_3: 'p'
- %b4 = block {
+ $B4: {
%p_inner:ptr<function, Inner, read_write> = access %p_3, 3i
%23:f32 = call %f2, %p_inner
ret %23
}
}
%f4 = func(%p_4:ptr<function, Outer, read_write>):f32 { # %p_4: 'p'
- %b5 = block {
+ $B5: {
%26:ptr<function, array<Inner, 4>, read_write> = access %p_4, 0u
%27:f32 = call %f3, %26
ret %27
}
}
%b = func():void {
- %b6 = block {
+ $B6: {
%F:ptr<function, Outer, read_write> = var
%30:f32 = call %f4, %F
ret
@@ -4571,7 +4571,7 @@
}
%f0 = func(%p_root:ptr<function, Outer, read_write>, %p_indices:array<u32, 2>):f32 {
- %b1 = block {
+ $B1: {
%4:u32 = access %p_indices, 0u
%5:u32 = access %p_indices, 1u
%6:ptr<function, vec4<f32>, read_write> = access %p_root, 0u, %4, 0u, %5
@@ -4580,7 +4580,7 @@
}
}
%f1 = func(%p_root_1:ptr<function, Outer, read_write>, %p_indices_1:array<u32, 1>):f32 { # %p_root_1: 'p_root', %p_indices_1: 'p_indices'
- %b2 = block {
+ $B2: {
%11:u32 = access %p_indices_1, 0u
%res:ptr<function, f32, read_write> = var
%13:u32 = convert 1i
@@ -4600,7 +4600,7 @@
}
}
%f2 = func(%p_root_2:ptr<function, Outer, read_write>, %p_indices_2:array<u32, 1>):f32 { # %p_root_2: 'p_root', %p_indices_2: 'p_indices'
- %b3 = block {
+ $B3: {
%27:u32 = access %p_indices_2, 0u
%28:array<u32, 1> = construct %27
%29:f32 = call %f1, %p_root_2, %28
@@ -4608,7 +4608,7 @@
}
}
%f3 = func(%p_root_3:ptr<function, Outer, read_write>):f32 { # %p_root_3: 'p_root'
- %b4 = block {
+ $B4: {
%32:u32 = convert 3i
%33:array<u32, 1> = construct %32
%34:f32 = call %f2, %p_root_3, %33
@@ -4616,13 +4616,13 @@
}
}
%f4 = func(%p_root_4:ptr<function, Outer, read_write>):f32 { # %p_root_4: 'p_root'
- %b5 = block {
+ $B5: {
%37:f32 = call %f3, %p_root_4
ret %37
}
}
%b = func():void {
- %b6 = block {
+ $B6: {
%F:ptr<function, Outer, read_write> = var
%40:f32 = call %f4, %F
ret
@@ -4726,13 +4726,13 @@
}
%f0 = func(%p:ptr<function, vec4<f32>, read_write>):f32 {
- %b1 = block {
+ $B1: {
%3:f32 = load_vector_element %p, 0u
ret %3
}
}
%f1 = func(%p_1:ptr<function, mat3x4<f32>, read_write>):f32 { # %p_1: 'p'
- %b2 = block {
+ $B2: {
%res:ptr<function, f32, read_write> = var
%7:ptr<function, vec4<f32>, read_write> = access %p_1, 1i
%8:f32 = call %f0, %7
@@ -4749,28 +4749,28 @@
}
}
%f2 = func(%p_2:ptr<function, Inner, read_write>):f32 { # %p_2: 'p'
- %b3 = block {
+ $B3: {
%p_mat:ptr<function, mat3x4<f32>, read_write> = access %p_2, 0u
%19:f32 = call %f1, %p_mat
ret %19
}
}
%f3 = func(%p_3:ptr<function, array<Inner, 4>, read_write>):f32 { # %p_3: 'p'
- %b4 = block {
+ $B4: {
%p_inner:ptr<function, Inner, read_write> = access %p_3, 3i
%23:f32 = call %f2, %p_inner
ret %23
}
}
%f4 = func(%p_4:ptr<function, Outer, read_write>):f32 { # %p_4: 'p'
- %b5 = block {
+ $B5: {
%26:ptr<function, array<Inner, 4>, read_write> = access %p_4, 0u
%27:f32 = call %f3, %26
ret %27
}
}
%b = func():void {
- %b6 = block {
+ $B6: {
%F:ptr<function, Outer, read_write> = var
%30:f32 = call %f4, %F
ret
@@ -4827,28 +4827,28 @@
auto* src = R"(
%f2 = func(%p:ptr<function, array<vec4<i32>, 5>, read_write>):vec4<i32> {
- %b1 = block {
+ $B1: {
%3:ptr<function, vec4<i32>, read_write> = access %p, 3u
%4:vec4<i32> = load %3
ret %4
}
}
%f1 = func(%p_1:ptr<function, array<array<vec4<i32>, 5>, 5>, read_write>):vec4<i32> { # %p_1: 'p'
- %b2 = block {
+ $B2: {
%7:ptr<function, array<vec4<i32>, 5>, read_write> = access %p_1, 2u
%8:vec4<i32> = call %f2, %7
ret %8
}
}
%f0 = func(%p_2:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>):vec4<i32> { # %p_2: 'p'
- %b3 = block {
+ $B3: {
%11:ptr<function, array<array<vec4<i32>, 5>, 5>, read_write> = access %p_2, 1u
%12:vec4<i32> = call %f1, %11
ret %12
}
}
%main = func():void {
- %b4 = block {
+ $B4: {
%F:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var
%15:vec4<i32> = call %f0, %F
ret
@@ -4860,7 +4860,7 @@
auto* expect = R"(
%f2 = func(%p_root:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>, %p_indices:array<u32, 2>):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:u32 = access %p_indices, 0u
%5:u32 = access %p_indices, 1u
%6:ptr<function, array<vec4<i32>, 5>, read_write> = access %p_root, %4, %5
@@ -4870,7 +4870,7 @@
}
}
%f1 = func(%p_root_1:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>, %p_indices_1:array<u32, 1>):vec4<i32> { # %p_root_1: 'p_root', %p_indices_1: 'p_indices'
- %b2 = block {
+ $B2: {
%12:u32 = access %p_indices_1, 0u
%13:array<u32, 2> = construct %12, 2u
%14:vec4<i32> = call %f2, %p_root_1, %13
@@ -4878,14 +4878,14 @@
}
}
%f0 = func(%p_root_2:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>):vec4<i32> { # %p_root_2: 'p_root'
- %b3 = block {
+ $B3: {
%17:array<u32, 1> = construct 1u
%18:vec4<i32> = call %f1, %p_root_2, %17
ret %18
}
}
%main = func():void {
- %b4 = block {
+ $B4: {
%F:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var
%21:vec4<i32> = call %f0, %F
ret
@@ -4938,28 +4938,28 @@
auto* src = R"(
%f2 = func(%p:ptr<function, array<vec4<i32>, 5>, read_write>):vec4<i32> {
- %b1 = block {
+ $B1: {
%3:ptr<function, vec4<i32>, read_write> = access %p, 3u
%4:vec4<i32> = load %3
ret %4
}
}
%f1 = func(%p_1:ptr<function, array<array<vec4<i32>, 5>, 5>, read_write>):vec4<i32> { # %p_1: 'p'
- %b2 = block {
+ $B2: {
%7:ptr<function, array<vec4<i32>, 5>, read_write> = access %p_1, 2u
%8:vec4<i32> = call %f2, %7
ret %8
}
}
%f0 = func(%p_2:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write>):vec4<i32> { # %p_2: 'p'
- %b3 = block {
+ $B3: {
%11:ptr<function, array<array<vec4<i32>, 5>, 5>, read_write> = access %p_2, 1u
%12:vec4<i32> = call %f1, %11
ret %12
}
}
%main = func():void {
- %b4 = block {
+ $B4: {
%F:ptr<function, array<array<array<vec4<i32>, 5>, 5>, 5>, read_write> = var
%15:vec4<i32> = call %f0, %F
ret
@@ -5008,18 +5008,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<f32>, read_write> = var @binding_point(0, 0)
}
%len = func(%p:ptr<storage, array<f32>, read_write>):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = arrayLength %p
ret %4
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%6:u32 = call %len, %S
ret
}
@@ -5029,19 +5029,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<f32>, read_write> = var @binding_point(0, 0)
}
%len = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, array<f32>, read_write> = access %S
%4:u32 = arrayLength %3
ret %4
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%6:u32 = call %len
ret
}
@@ -5075,18 +5075,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, atomic<i32>, read_write> = var
}
%load = func(%p:ptr<workgroup, atomic<i32>, read_write>):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicLoad %p
ret %4
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%6:i32 = call %load, %W
ret
}
@@ -5096,19 +5096,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, atomic<i32>, read_write> = var
}
%load = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<workgroup, atomic<i32>, read_write> = access %W
%4:i32 = atomicLoad %3
ret %4
}
}
%b = func():void {
- %b3 = block {
+ $B3: {
%6:i32 = call %load
ret
}
@@ -5265,7 +5265,7 @@
i:vec4<i32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, vec4<i32>, read> = var @binding_point(0, 0)
%U_str:ptr<uniform, str, read> = var @binding_point(0, 1)
%U_arr:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 2)
@@ -5281,25 +5281,25 @@
}
%fn_u = func(%p:ptr<uniform, vec4<i32>, read>):vec4<i32> {
- %b2 = block {
+ $B2: {
%15:vec4<i32> = load %p
ret %15
}
}
%fn_s = func(%p_1:ptr<storage, vec4<i32>, read>):vec4<i32> { # %p_1: 'p'
- %b3 = block {
+ $B3: {
%18:vec4<i32> = load %p_1
ret %18
}
}
%fn_w = func(%p_2:ptr<workgroup, vec4<i32>, read_write>):vec4<i32> { # %p_2: 'p'
- %b4 = block {
+ $B4: {
%21:vec4<i32> = load %p_2
ret %21
}
}
%b = func():void {
- %b5 = block {
+ $B5: {
%I:i32 = let 3i
%J:i32 = let 4i
%u:vec4<i32> = call %fn_u, %U
@@ -5365,7 +5365,7 @@
i:vec4<i32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%U:ptr<uniform, vec4<i32>, read> = var @binding_point(0, 0)
%U_str:ptr<uniform, str, read> = var @binding_point(0, 1)
%U_arr:ptr<uniform, array<vec4<i32>, 8>, read> = var @binding_point(0, 2)
@@ -5381,21 +5381,21 @@
}
%fn_u = func():vec4<i32> {
- %b2 = block {
+ $B2: {
%14:ptr<uniform, vec4<i32>, read> = access %U
%15:vec4<i32> = load %14
ret %15
}
}
%fn_u_1 = func():vec4<i32> { # %fn_u_1: 'fn_u'
- %b3 = block {
+ $B3: {
%17:ptr<uniform, vec4<i32>, read> = access %U_str, 0u
%18:vec4<i32> = load %17
ret %18
}
}
%fn_u_2 = func(%p_indices:array<u32, 1>):vec4<i32> { # %fn_u_2: 'fn_u'
- %b4 = block {
+ $B4: {
%21:u32 = access %p_indices, 0u
%22:ptr<uniform, vec4<i32>, read> = access %U_arr, %21
%23:vec4<i32> = load %22
@@ -5403,7 +5403,7 @@
}
}
%fn_u_3 = func(%p_indices_1:array<u32, 2>):vec4<i32> { # %fn_u_3: 'fn_u', %p_indices_1: 'p_indices'
- %b5 = block {
+ $B5: {
%26:u32 = access %p_indices_1, 0u
%27:u32 = access %p_indices_1, 1u
%28:ptr<uniform, vec4<i32>, read> = access %U_arr_arr, %26, %27
@@ -5412,21 +5412,21 @@
}
}
%fn_s = func():vec4<i32> {
- %b6 = block {
+ $B6: {
%31:ptr<storage, vec4<i32>, read> = access %S
%32:vec4<i32> = load %31
ret %32
}
}
%fn_s_1 = func():vec4<i32> { # %fn_s_1: 'fn_s'
- %b7 = block {
+ $B7: {
%34:ptr<storage, vec4<i32>, read> = access %S_str, 0u
%35:vec4<i32> = load %34
ret %35
}
}
%fn_s_2 = func(%p_indices_2:array<u32, 1>):vec4<i32> { # %fn_s_2: 'fn_s', %p_indices_2: 'p_indices'
- %b8 = block {
+ $B8: {
%38:u32 = access %p_indices_2, 0u
%39:ptr<storage, vec4<i32>, read> = access %S_arr, %38
%40:vec4<i32> = load %39
@@ -5434,7 +5434,7 @@
}
}
%fn_s_3 = func(%p_indices_3:array<u32, 2>):vec4<i32> { # %fn_s_3: 'fn_s', %p_indices_3: 'p_indices'
- %b9 = block {
+ $B9: {
%43:u32 = access %p_indices_3, 0u
%44:u32 = access %p_indices_3, 1u
%45:ptr<storage, vec4<i32>, read> = access %S_arr_arr, %43, %44
@@ -5443,21 +5443,21 @@
}
}
%fn_w = func():vec4<i32> {
- %b10 = block {
+ $B10: {
%48:ptr<workgroup, vec4<i32>, read_write> = access %W
%49:vec4<i32> = load %48
ret %49
}
}
%fn_w_1 = func():vec4<i32> { # %fn_w_1: 'fn_w'
- %b11 = block {
+ $B11: {
%51:ptr<workgroup, vec4<i32>, read_write> = access %W_str, 0u
%52:vec4<i32> = load %51
ret %52
}
}
%fn_w_2 = func(%p_indices_4:array<u32, 1>):vec4<i32> { # %fn_w_2: 'fn_w', %p_indices_4: 'p_indices'
- %b12 = block {
+ $B12: {
%55:u32 = access %p_indices_4, 0u
%56:ptr<workgroup, vec4<i32>, read_write> = access %W_arr, %55
%57:vec4<i32> = load %56
@@ -5465,7 +5465,7 @@
}
}
%fn_w_3 = func(%p_indices_5:array<u32, 2>):vec4<i32> { # %fn_w_3: 'fn_w', %p_indices_5: 'p_indices'
- %b13 = block {
+ $B13: {
%60:u32 = access %p_indices_5, 0u
%61:u32 = access %p_indices_5, 1u
%62:ptr<workgroup, vec4<i32>, read_write> = access %W_arr_arr, %60, %61
@@ -5474,7 +5474,7 @@
}
}
%b = func():void {
- %b14 = block {
+ $B14: {
%I:i32 = let 3i
%J:i32 = let 4i
%u:vec4<i32> = call %fn_u
@@ -5609,17 +5609,17 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
}
%a = func(%i:i32):i32 {
- %b2 = block {
+ $B2: {
ret %i
}
}
%b = func(%p:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>):i32 {
- %b3 = block {
+ $B3: {
%6:ptr<storage, i32, read> = access %p, 0i, 1i, 2i
%7:i32 = load %6
%8:i32 = call %a, %7
@@ -5637,7 +5637,7 @@
}
}
%c = func():void {
- %b4 = block {
+ $B4: {
%20:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read> = access %S, 42i
%v:i32 = call %b, %20
ret
@@ -5648,17 +5648,17 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
}
%a = func(%i:i32):i32 {
- %b2 = block {
+ $B2: {
ret %i
}
}
%b = func(%p_indices:array<u32, 1>):i32 {
- %b3 = block {
+ $B3: {
%6:u32 = access %p_indices, 0u
%7:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read> = access %S, %6
%8:ptr<storage, i32, read> = access %7, 0i, 1i, 2i
@@ -5678,7 +5678,7 @@
}
}
%c = func():void {
- %b4 = block {
+ $B4: {
%22:u32 = convert 42i
%23:array<u32, 1> = construct %22
%v:i32 = call %b, %23
@@ -5738,18 +5738,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %i:ptr<storage, i32, read>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = load %i
ret %6
}
}
%b = func(%p:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read>):i32 {
- %b3 = block {
+ $B3: {
%9:ptr<storage, i32, read> = access %p, 0i, 1i, 2i
%10:i32 = call %a, 20i, %9, 30i
%11:ptr<storage, i32, read> = access %p, 3i, 4i, 5i
@@ -5762,7 +5762,7 @@
}
}
%c = func():void {
- %b4 = block {
+ $B4: {
%18:ptr<storage, array<array<array<i32, 9>, 9>, 9>, read> = access %S, 42i
%v:i32 = call %b, %18
ret
@@ -5773,12 +5773,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<array<array<array<i32, 9>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
}
%a = func(%pre:i32, %i_indices:array<u32, 4>, %post:i32):i32 {
- %b2 = block {
+ $B2: {
%6:u32 = access %i_indices, 0u
%7:u32 = access %i_indices, 1u
%8:u32 = access %i_indices, 2u
@@ -5789,7 +5789,7 @@
}
}
%b = func(%p_indices:array<u32, 1>):i32 {
- %b3 = block {
+ $B3: {
%14:u32 = access %p_indices, 0u
%15:u32 = convert 0i
%16:u32 = convert 1i
@@ -5815,7 +5815,7 @@
}
}
%c = func():void {
- %b4 = block {
+ $B4: {
%36:u32 = convert 42i
%37:array<u32, 1> = construct %36
%v:i32 = call %b, %37
@@ -5872,18 +5872,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<array<array<i32, 9>, 9>, 50>, read> = var @binding_point(0, 0)
%U:ptr<uniform, array<array<array<vec4<i32>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
}
%a = func(%i:i32):i32 {
- %b2 = block {
+ $B2: {
ret %i
}
}
%b = func(%s:ptr<storage, array<array<i32, 9>, 9>, read>, %u:ptr<uniform, array<array<vec4<i32>, 9>, 9>, read>):i32 {
- %b3 = block {
+ $B3: {
%8:ptr<uniform, vec4<i32>, read> = access %u, 0i, 1i
%9:i32 = load_vector_element %8, 0u
%10:i32 = call %a, %9
@@ -5897,7 +5897,7 @@
}
}
%c = func():void {
- %b4 = block {
+ $B4: {
%18:ptr<storage, array<array<i32, 9>, 9>, read> = access %S, 42i
%19:ptr<uniform, array<array<vec4<i32>, 9>, 9>, read> = access %U, 24i
%v:i32 = call %b, %18, %19
@@ -5909,18 +5909,18 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%S:ptr<storage, array<array<array<i32, 9>, 9>, 50>, read> = var @binding_point(0, 0)
%U:ptr<uniform, array<array<array<vec4<i32>, 9>, 9>, 50>, read> = var @binding_point(0, 0)
}
%a = func(%i:i32):i32 {
- %b2 = block {
+ $B2: {
ret %i
}
}
%b = func(%s_indices:array<u32, 1>, %u_indices:array<u32, 1>):i32 {
- %b3 = block {
+ $B3: {
%8:u32 = access %s_indices, 0u
%9:ptr<storage, array<array<i32, 9>, 9>, read> = access %S, %8
%10:u32 = access %u_indices, 0u
@@ -5938,7 +5938,7 @@
}
}
%c = func():void {
- %b4 = block {
+ $B4: {
%22:u32 = convert 42i
%23:array<u32, 1> = construct %22
%24:u32 = convert 24i
diff --git a/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc b/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
index 64e0916..dadb543 100644
--- a/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
+++ b/src/tint/lang/core/ir/transform/multiplanar_external_texture_test.cc
@@ -46,7 +46,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -68,12 +68,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -100,14 +100,14 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -133,12 +133,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:texture_external = load %texture
ret
}
@@ -166,14 +166,14 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%5:texture_2d<f32> = load %texture_plane0
%6:texture_2d<f32> = load %texture_plane1
%7:tint_ExternalTextureParams = load %texture_params
@@ -204,12 +204,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func():vec2<u32> {
- %b2 = block {
+ $B2: {
%3:texture_external = load %texture
%result:vec2<u32> = textureDimensions %3
ret %result
@@ -238,14 +238,14 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func():vec2<u32> {
- %b2 = block {
+ $B2: {
%5:texture_2d<f32> = load %texture_plane0
%6:texture_2d<f32> = load %texture_plane1
%7:tint_ExternalTextureParams = load %texture_params
@@ -279,12 +279,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func(%coords:vec2<u32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_external = load %texture
%result:vec4<f32> = textureLoad %4, %coords
ret %result
@@ -313,14 +313,14 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func(%coords:vec2<u32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%6:texture_2d<f32> = load %texture_plane0
%7:texture_2d<f32> = load %texture_plane1
%8:tint_ExternalTextureParams = load %texture_params
@@ -329,19 +329,19 @@
}
}
%tint_TextureLoadExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %coords_1:vec2<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%15:u32 = access %params, 1u
%16:mat3x4<f32> = access %params, 2u
%17:u32 = access %params, 0u
%18:bool = eq %17, 1u
- %19:vec3<f32>, %20:f32 = if %18 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ %19:vec3<f32>, %20:f32 = if %18 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
%21:vec4<f32> = textureLoad %plane_0, %coords_1, 0u
%22:vec3<f32> = swizzle %21, xyz
%23:f32 = access %21, 3u
exit_if %22, %23 # if_1
}
- %b5 = block { # false
+ $B5: { # false
%24:vec4<f32> = textureLoad %plane_0, %coords_1, 0u
%25:f32 = access %24, 0u
%26:vec2<u32> = shr %coords_1, vec2<u32>(1u)
@@ -353,8 +353,8 @@
}
}
%31:bool = eq %15, 0u
- %32:vec3<f32> = if %31 [t: %b6, f: %b7] { # if_2
- %b6 = block { # true
+ %32:vec3<f32> = if %31 [t: $B6, f: $B7] { # if_2
+ $B6: { # true
%33:tint_GammaTransferParams = access %params, 3u
%34:tint_GammaTransferParams = access %params, 4u
%35:mat3x3<f32> = access %params, 5u
@@ -363,7 +363,7 @@
%39:vec3<f32> = call %tint_GammaCorrection, %38, %34
exit_if %39 # if_2
}
- %b7 = block { # false
+ $B7: { # false
exit_if %19 # if_2
}
}
@@ -372,7 +372,7 @@
}
}
%tint_GammaCorrection = func(%v:vec3<f32>, %params_1:tint_GammaTransferParams):vec3<f32> { # %params_1: 'params'
- %b8 = block {
+ $B8: {
%43:f32 = access %params_1, 0u
%44:f32 = access %params_1, 1u
%45:f32 = access %params_1, 2u
@@ -423,12 +423,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func(%coords:vec2<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_external = load %texture
%result:vec4<f32> = textureLoad %4, %coords
ret %result
@@ -457,14 +457,14 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func(%coords:vec2<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%6:texture_2d<f32> = load %texture_plane0
%7:texture_2d<f32> = load %texture_plane1
%8:tint_ExternalTextureParams = load %texture_params
@@ -474,19 +474,19 @@
}
}
%tint_TextureLoadExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %coords_1:vec2<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%16:u32 = access %params, 1u
%17:mat3x4<f32> = access %params, 2u
%18:u32 = access %params, 0u
%19:bool = eq %18, 1u
- %20:vec3<f32>, %21:f32 = if %19 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ %20:vec3<f32>, %21:f32 = if %19 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
%22:vec4<f32> = textureLoad %plane_0, %coords_1, 0u
%23:vec3<f32> = swizzle %22, xyz
%24:f32 = access %22, 3u
exit_if %23, %24 # if_1
}
- %b5 = block { # false
+ $B5: { # false
%25:vec4<f32> = textureLoad %plane_0, %coords_1, 0u
%26:f32 = access %25, 0u
%27:vec2<u32> = shr %coords_1, vec2<u32>(1u)
@@ -498,8 +498,8 @@
}
}
%32:bool = eq %16, 0u
- %33:vec3<f32> = if %32 [t: %b6, f: %b7] { # if_2
- %b6 = block { # true
+ %33:vec3<f32> = if %32 [t: $B6, f: $B7] { # if_2
+ $B6: { # true
%34:tint_GammaTransferParams = access %params, 3u
%35:tint_GammaTransferParams = access %params, 4u
%36:mat3x3<f32> = access %params, 5u
@@ -508,7 +508,7 @@
%40:vec3<f32> = call %tint_GammaCorrection, %39, %35
exit_if %40 # if_2
}
- %b7 = block { # false
+ $B7: { # false
exit_if %20 # if_2
}
}
@@ -517,7 +517,7 @@
}
}
%tint_GammaCorrection = func(%v:vec3<f32>, %params_1:tint_GammaTransferParams):vec3<f32> { # %params_1: 'params'
- %b8 = block {
+ $B8: {
%44:f32 = access %params_1, 0u
%45:f32 = access %params_1, 1u
%46:f32 = access %params_1, 2u
@@ -570,12 +570,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func(%sampler:sampler, %coords:vec2<f32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_external = load %texture
%result:vec4<f32> = textureSampleBaseClampToEdge %5, %sampler, %coords
ret %result
@@ -604,14 +604,14 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func(%sampler:sampler, %coords:vec2<f32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%7:texture_2d<f32> = load %texture_plane0
%8:texture_2d<f32> = load %texture_plane1
%9:tint_ExternalTextureParams = load %texture_params
@@ -620,7 +620,7 @@
}
}
%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %sampler_1:sampler, %coords_1:vec2<f32>):vec4<f32> { # %sampler_1: 'sampler', %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%17:u32 = access %params, 1u
%18:mat3x4<f32> = access %params, 2u
%19:mat3x2<f32> = access %params, 6u
@@ -638,14 +638,14 @@
%31:vec2<f32> = clamp %21, %29, %30
%32:u32 = access %params, 0u
%33:bool = eq %32, 1u
- %34:vec3<f32>, %35:f32 = if %33 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ %34:vec3<f32>, %35:f32 = if %33 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
%36:vec4<f32> = textureSampleLevel %plane_0, %sampler_1, %26, 0.0f
%37:vec3<f32> = swizzle %36, xyz
%38:f32 = access %36, 3u
exit_if %37, %38 # if_1
}
- %b5 = block { # false
+ $B5: { # false
%39:vec4<f32> = textureSampleLevel %plane_0, %sampler_1, %26, 0.0f
%40:f32 = access %39, 0u
%41:vec4<f32> = textureSampleLevel %plane_1, %sampler_1, %31, 0.0f
@@ -656,8 +656,8 @@
}
}
%45:bool = eq %17, 0u
- %46:vec3<f32> = if %45 [t: %b6, f: %b7] { # if_2
- %b6 = block { # true
+ %46:vec3<f32> = if %45 [t: $B6, f: $B7] { # if_2
+ $B6: { # true
%47:tint_GammaTransferParams = access %params, 3u
%48:tint_GammaTransferParams = access %params, 4u
%49:mat3x3<f32> = access %params, 5u
@@ -666,7 +666,7 @@
%53:vec3<f32> = call %tint_GammaCorrection, %52, %48
exit_if %53 # if_2
}
- %b7 = block { # false
+ $B7: { # false
exit_if %34 # if_2
}
}
@@ -675,7 +675,7 @@
}
}
%tint_GammaCorrection = func(%v:vec3<f32>, %params_1:tint_GammaTransferParams):vec3<f32> { # %params_1: 'params'
- %b8 = block {
+ $B8: {
%57:f32 = access %params_1, 0u
%58:f32 = access %params_1, 1u
%59:f32 = access %params_1, 2u
@@ -743,18 +743,18 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func(%texture_1:texture_external, %sampler:sampler, %coords:vec2<f32>):vec4<f32> { # %texture_1: 'texture'
- %b2 = block {
+ $B2: {
%result:vec4<f32> = textureSampleBaseClampToEdge %texture_1, %sampler, %coords
ret %result
}
}
%bar = func(%sampler_1:sampler, %coords_1:vec2<f32>):vec4<f32> { # %sampler_1: 'sampler', %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%10:texture_external = load %texture
%result_1:vec4<f32> = call %foo, %10, %sampler_1, %coords_1 # %result_1: 'result'
ret %result_1
@@ -783,20 +783,20 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func(%texture_plane0_1:texture_2d<f32>, %texture_plane1_1:texture_2d<f32>, %texture_params_1:tint_ExternalTextureParams, %sampler:sampler, %coords:vec2<f32>):vec4<f32> { # %texture_plane0_1: 'texture_plane0', %texture_plane1_1: 'texture_plane1', %texture_params_1: 'texture_params'
- %b2 = block {
+ $B2: {
%10:vec4<f32> = call %tint_TextureSampleExternal, %texture_plane0_1, %texture_plane1_1, %texture_params_1, %sampler, %coords
ret %10
}
}
%bar = func(%sampler_1:sampler, %coords_1:vec2<f32>):vec4<f32> { # %sampler_1: 'sampler', %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%15:texture_2d<f32> = load %texture_plane0
%16:texture_2d<f32> = load %texture_plane1
%17:tint_ExternalTextureParams = load %texture_params
@@ -805,7 +805,7 @@
}
}
%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %sampler_2:sampler, %coords_2:vec2<f32>):vec4<f32> { # %sampler_2: 'sampler', %coords_2: 'coords'
- %b4 = block {
+ $B4: {
%24:u32 = access %params, 1u
%25:mat3x4<f32> = access %params, 2u
%26:mat3x2<f32> = access %params, 6u
@@ -823,14 +823,14 @@
%38:vec2<f32> = clamp %28, %36, %37
%39:u32 = access %params, 0u
%40:bool = eq %39, 1u
- %41:vec3<f32>, %42:f32 = if %40 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ %41:vec3<f32>, %42:f32 = if %40 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
%43:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %33, 0.0f
%44:vec3<f32> = swizzle %43, xyz
%45:f32 = access %43, 3u
exit_if %44, %45 # if_1
}
- %b6 = block { # false
+ $B6: { # false
%46:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %33, 0.0f
%47:f32 = access %46, 0u
%48:vec4<f32> = textureSampleLevel %plane_1, %sampler_2, %38, 0.0f
@@ -841,8 +841,8 @@
}
}
%52:bool = eq %24, 0u
- %53:vec3<f32> = if %52 [t: %b7, f: %b8] { # if_2
- %b7 = block { # true
+ %53:vec3<f32> = if %52 [t: $B7, f: $B8] { # if_2
+ $B7: { # true
%54:tint_GammaTransferParams = access %params, 3u
%55:tint_GammaTransferParams = access %params, 4u
%56:mat3x3<f32> = access %params, 5u
@@ -851,7 +851,7 @@
%60:vec3<f32> = call %tint_GammaCorrection, %59, %55
exit_if %60 # if_2
}
- %b8 = block { # false
+ $B8: { # false
exit_if %41 # if_2
}
}
@@ -860,7 +860,7 @@
}
}
%tint_GammaCorrection = func(%v:vec3<f32>, %params_1:tint_GammaTransferParams):vec3<f32> { # %params_1: 'params'
- %b9 = block {
+ $B9: {
%64:f32 = access %params_1, 0u
%65:f32 = access %params_1, 1u
%66:f32 = access %params_1, 2u
@@ -938,18 +938,18 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(1, 2)
}
%foo = func(%texture_1:texture_external, %sampler:sampler, %coords:vec2<f32>):vec4<f32> { # %texture_1: 'texture'
- %b2 = block {
+ $B2: {
%result:vec4<f32> = textureSampleBaseClampToEdge %texture_1, %sampler, %coords
ret %result
}
}
%bar = func(%sampler_1:sampler, %coords_1:vec2<f32>):vec4<f32> { # %sampler_1: 'sampler', %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%10:texture_external = load %texture
%11:vec2<u32> = textureDimensions %10
%12:texture_external = load %texture
@@ -986,20 +986,20 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
}
%foo = func(%texture_plane0_1:texture_2d<f32>, %texture_plane1_1:texture_2d<f32>, %texture_params_1:tint_ExternalTextureParams, %sampler:sampler, %coords:vec2<f32>):vec4<f32> { # %texture_plane0_1: 'texture_plane0', %texture_plane1_1: 'texture_plane1', %texture_params_1: 'texture_params'
- %b2 = block {
+ $B2: {
%10:vec4<f32> = call %tint_TextureSampleExternal, %texture_plane0_1, %texture_plane1_1, %texture_params_1, %sampler, %coords
ret %10
}
}
%bar = func(%sampler_1:sampler, %coords_1:vec2<f32>):vec4<f32> { # %sampler_1: 'sampler', %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%15:texture_2d<f32> = load %texture_plane0
%16:texture_2d<f32> = load %texture_plane1
%17:tint_ExternalTextureParams = load %texture_params
@@ -1022,7 +1022,7 @@
}
}
%tint_TextureSampleExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %sampler_2:sampler, %coords_2:vec2<f32>):vec4<f32> { # %sampler_2: 'sampler', %coords_2: 'coords'
- %b4 = block {
+ $B4: {
%38:u32 = access %params, 1u
%39:mat3x4<f32> = access %params, 2u
%40:mat3x2<f32> = access %params, 6u
@@ -1040,14 +1040,14 @@
%52:vec2<f32> = clamp %42, %50, %51
%53:u32 = access %params, 0u
%54:bool = eq %53, 1u
- %55:vec3<f32>, %56:f32 = if %54 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ %55:vec3<f32>, %56:f32 = if %54 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
%57:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %47, 0.0f
%58:vec3<f32> = swizzle %57, xyz
%59:f32 = access %57, 3u
exit_if %58, %59 # if_1
}
- %b6 = block { # false
+ $B6: { # false
%60:vec4<f32> = textureSampleLevel %plane_0, %sampler_2, %47, 0.0f
%61:f32 = access %60, 0u
%62:vec4<f32> = textureSampleLevel %plane_1, %sampler_2, %52, 0.0f
@@ -1058,8 +1058,8 @@
}
}
%66:bool = eq %38, 0u
- %67:vec3<f32> = if %66 [t: %b7, f: %b8] { # if_2
- %b7 = block { # true
+ %67:vec3<f32> = if %66 [t: $B7, f: $B8] { # if_2
+ $B7: { # true
%68:tint_GammaTransferParams = access %params, 3u
%69:tint_GammaTransferParams = access %params, 4u
%70:mat3x3<f32> = access %params, 5u
@@ -1068,7 +1068,7 @@
%74:vec3<f32> = call %tint_GammaCorrection, %73, %69
exit_if %74 # if_2
}
- %b8 = block { # false
+ $B8: { # false
exit_if %55 # if_2
}
}
@@ -1077,7 +1077,7 @@
}
}
%tint_GammaCorrection = func(%v:vec3<f32>, %params_1:tint_GammaTransferParams):vec3<f32> { # %params_1: 'params'
- %b9 = block {
+ $B9: {
%78:f32 = access %params_1, 0u
%79:f32 = access %params_1, 1u
%80:f32 = access %params_1, 2u
@@ -1139,14 +1139,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture_a:ptr<handle, texture_external, read> = var @binding_point(1, 2)
%texture_b:ptr<handle, texture_external, read> = var @binding_point(2, 2)
%texture_c:ptr<handle, texture_external, read> = var @binding_point(3, 2)
}
%foo = func(%coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%6:texture_external = load %texture_a
%7:vec4<f32> = textureLoad %6, %coords
%8:texture_external = load %texture_b
@@ -1179,7 +1179,7 @@
coordTransformationMatrix:mat3x2<f32> @offset(176)
}
-%b1 = block { # root
+$B1: { # root
%texture_a_plane0:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 2)
%texture_a_plane1:ptr<handle, texture_2d<f32>, read> = var @binding_point(1, 3)
%texture_a_params:ptr<uniform, tint_ExternalTextureParams, read> = var @binding_point(1, 4)
@@ -1192,7 +1192,7 @@
}
%foo = func(%coords:vec2<u32>):void {
- %b2 = block {
+ $B2: {
%12:texture_2d<f32> = load %texture_a_plane0
%13:texture_2d<f32> = load %texture_a_plane1
%14:tint_ExternalTextureParams = load %texture_a_params
@@ -1209,19 +1209,19 @@
}
}
%tint_TextureLoadExternal = func(%plane_0:texture_2d<f32>, %plane_1:texture_2d<f32>, %params:tint_ExternalTextureParams, %coords_1:vec2<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%29:u32 = access %params, 1u
%30:mat3x4<f32> = access %params, 2u
%31:u32 = access %params, 0u
%32:bool = eq %31, 1u
- %33:vec3<f32>, %34:f32 = if %32 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ %33:vec3<f32>, %34:f32 = if %32 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
%35:vec4<f32> = textureLoad %plane_0, %coords_1, 0u
%36:vec3<f32> = swizzle %35, xyz
%37:f32 = access %35, 3u
exit_if %36, %37 # if_1
}
- %b5 = block { # false
+ $B5: { # false
%38:vec4<f32> = textureLoad %plane_0, %coords_1, 0u
%39:f32 = access %38, 0u
%40:vec2<u32> = shr %coords_1, vec2<u32>(1u)
@@ -1233,8 +1233,8 @@
}
}
%45:bool = eq %29, 0u
- %46:vec3<f32> = if %45 [t: %b6, f: %b7] { # if_2
- %b6 = block { # true
+ %46:vec3<f32> = if %45 [t: $B6, f: $B7] { # if_2
+ $B6: { # true
%47:tint_GammaTransferParams = access %params, 3u
%48:tint_GammaTransferParams = access %params, 4u
%49:mat3x3<f32> = access %params, 5u
@@ -1243,7 +1243,7 @@
%53:vec3<f32> = call %tint_GammaCorrection, %52, %48
exit_if %53 # if_2
}
- %b7 = block { # false
+ $B7: { # false
exit_if %33 # if_2
}
}
@@ -1252,7 +1252,7 @@
}
}
%tint_GammaCorrection = func(%v:vec3<f32>, %params_1:tint_GammaTransferParams):vec3<f32> { # %params_1: 'params'
- %b8 = block {
+ $B8: {
%57:f32 = access %params_1, 0u
%58:f32 = access %params_1, 1u
%59:f32 = access %params_1, 2u
diff --git a/src/tint/lang/core/ir/transform/preserve_padding_test.cc b/src/tint/lang/core/ir/transform/preserve_padding_test.cc
index ff0a8d9..784f93d 100644
--- a/src/tint/lang/core/ir/transform/preserve_padding_test.cc
+++ b/src/tint/lang/core/ir/transform/preserve_padding_test.cc
@@ -92,12 +92,12 @@
b:u32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<workgroup, MyStruct, read_write> = var
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -131,12 +131,12 @@
b:u32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<private, MyStruct, read_write> = var
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -170,7 +170,7 @@
}
%foo = func(%value:MyStruct):void {
- %b1 = block {
+ $B1: {
%buffer:ptr<function, MyStruct, read_write> = var
store %buffer, %value
ret
@@ -207,12 +207,12 @@
c:vec4<u32> @offset(32)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -242,12 +242,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, mat4x4<f32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:mat4x4<f32>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -277,12 +277,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<vec4<f32>>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<vec4<f32>>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -311,12 +311,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, vec3<f32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:vec3<f32>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -350,12 +350,12 @@
b:u32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func():MyStruct {
- %b2 = block {
+ $B2: {
%3:MyStruct = load %buffer
ret %3
}
@@ -391,12 +391,12 @@
b:u32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -410,18 +410,18 @@
b:u32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, MyStruct, read_write>, %value_param:MyStruct):void {
- %b3 = block {
+ $B3: {
%8:ptr<storage, vec4<u32>, read_write> = access %target, 0u
%9:vec4<u32> = access %value_param, 0u
store %8, %9
@@ -460,12 +460,12 @@
c:vec4<u32> @offset(32)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -480,18 +480,18 @@
c:vec4<u32> @offset(32)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, MyStruct, read_write>, %value_param:MyStruct):void {
- %b3 = block {
+ $B3: {
%8:ptr<storage, vec4<u32>, read_write> = access %target, 0u
%9:vec4<u32> = access %value_param, 0u
store %8, %9
@@ -540,12 +540,12 @@
inner:MyStruct @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, Outer, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:Outer):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -564,18 +564,18 @@
inner:MyStruct @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, Outer, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:Outer):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, Outer, read_write>, %value_param:Outer):void {
- %b3 = block {
+ $B3: {
%8:ptr<storage, MyStruct, read_write> = access %target, 0u
%9:MyStruct = access %value_param, 0u
%10:void = call %tint_store_and_preserve_padding_1, %8, %9
@@ -583,7 +583,7 @@
}
}
%tint_store_and_preserve_padding_1 = func(%target_1:ptr<storage, MyStruct, read_write>, %value_param_1:MyStruct):void { # %tint_store_and_preserve_padding_1: 'tint_store_and_preserve_padding', %target_1: 'target', %value_param_1: 'value_param'
- %b4 = block {
+ $B4: {
%14:ptr<storage, vec4<u32>, read_write> = access %target_1, 0u
%15:vec4<u32> = access %value_param_1, 0u
store %14, %15
@@ -625,12 +625,12 @@
b:u32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<MyStruct, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<MyStruct, 4>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -644,44 +644,44 @@
b:u32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<MyStruct, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<MyStruct, 4>):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, array<MyStruct, 4>, read_write>, %value_param:array<MyStruct, 4>):void {
- %b3 = block {
- loop [i: %b4, b: %b5, c: %b6] { # loop_1
- %b4 = block { # initializer
- next_iteration %b5 0u
+ $B3: {
+ loop [i: $B4, b: $B5, c: $B6] { # loop_1
+ $B4: { # initializer
+ next_iteration $B5 0u
}
- %b5 = block (%idx:u32) { # body
+ $B5 (%idx:u32): { # body
%9:bool = gte %idx:u32, 4u
- if %9 [t: %b7] { # if_1
- %b7 = block { # true
+ if %9 [t: $B7] { # if_1
+ $B7: { # true
exit_loop # loop_1
}
}
%10:ptr<storage, MyStruct, read_write> = access %target, %idx:u32
%11:MyStruct = access %value_param, %idx:u32
%12:void = call %tint_store_and_preserve_padding_1, %10, %11
- continue %b6
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%14:u32 = add %idx:u32, 1u
- next_iteration %b5 %14
+ next_iteration $B5 %14
}
}
ret
}
}
%tint_store_and_preserve_padding_1 = func(%target_1:ptr<storage, MyStruct, read_write>, %value_param_1:MyStruct):void { # %tint_store_and_preserve_padding_1: 'tint_store_and_preserve_padding', %target_1: 'target', %value_param_1: 'value_param'
- %b8 = block {
+ $B8: {
%17:ptr<storage, vec4<u32>, read_write> = access %target_1, 0u
%18:vec4<u32> = access %value_param_1, 0u
store %17, %18
@@ -714,12 +714,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, mat3x3<f32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:mat3x3<f32>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -728,18 +728,18 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, mat3x3<f32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:mat3x3<f32>):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, mat3x3<f32>, read_write>, %value_param:mat3x3<f32>):void {
- %b3 = block {
+ $B3: {
%8:ptr<storage, vec3<f32>, read_write> = access %target, 0u
%9:vec3<f32> = access %value_param, 0u
store %8, %9
@@ -784,12 +784,12 @@
b:mat3x3<f32> @offset(48)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -803,18 +803,18 @@
b:mat3x3<f32> @offset(48)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:MyStruct):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, MyStruct, read_write>, %value_param:MyStruct):void {
- %b3 = block {
+ $B3: {
%8:ptr<storage, mat3x3<f32>, read_write> = access %target, 0u
%9:mat3x3<f32> = access %value_param, 0u
%10:void = call %tint_store_and_preserve_padding_1, %8, %9
@@ -825,7 +825,7 @@
}
}
%tint_store_and_preserve_padding_1 = func(%target_1:ptr<storage, mat3x3<f32>, read_write>, %value_param_1:mat3x3<f32>):void { # %tint_store_and_preserve_padding_1: 'tint_store_and_preserve_padding', %target_1: 'target', %value_param_1: 'value_param'
- %b4 = block {
+ $B4: {
%17:ptr<storage, vec3<f32>, read_write> = access %target_1, 0u
%18:vec3<f32> = access %value_param_1, 0u
store %17, %18
@@ -862,12 +862,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<mat3x3<f32>, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<mat3x3<f32>, 4>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -876,44 +876,44 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<mat3x3<f32>, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<mat3x3<f32>, 4>):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, array<mat3x3<f32>, 4>, read_write>, %value_param:array<mat3x3<f32>, 4>):void {
- %b3 = block {
- loop [i: %b4, b: %b5, c: %b6] { # loop_1
- %b4 = block { # initializer
- next_iteration %b5 0u
+ $B3: {
+ loop [i: $B4, b: $B5, c: $B6] { # loop_1
+ $B4: { # initializer
+ next_iteration $B5 0u
}
- %b5 = block (%idx:u32) { # body
+ $B5 (%idx:u32): { # body
%9:bool = gte %idx:u32, 4u
- if %9 [t: %b7] { # if_1
- %b7 = block { # true
+ if %9 [t: $B7] { # if_1
+ $B7: { # true
exit_loop # loop_1
}
}
%10:ptr<storage, mat3x3<f32>, read_write> = access %target, %idx:u32
%11:mat3x3<f32> = access %value_param, %idx:u32
%12:void = call %tint_store_and_preserve_padding_1, %10, %11
- continue %b6
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%14:u32 = add %idx:u32, 1u
- next_iteration %b5 %14
+ next_iteration $B5 %14
}
}
ret
}
}
%tint_store_and_preserve_padding_1 = func(%target_1:ptr<storage, mat3x3<f32>, read_write>, %value_param_1:mat3x3<f32>):void { # %tint_store_and_preserve_padding_1: 'tint_store_and_preserve_padding', %target_1: 'target', %value_param_1: 'value_param'
- %b8 = block {
+ $B8: {
%17:ptr<storage, vec3<f32>, read_write> = access %target_1, 0u
%18:vec3<f32> = access %value_param_1, 0u
store %17, %18
@@ -949,12 +949,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<vec3<f32>, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<vec3<f32>, 4>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -963,37 +963,37 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<vec3<f32>, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<vec3<f32>, 4>):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, array<vec3<f32>, 4>, read_write>, %value_param:array<vec3<f32>, 4>):void {
- %b3 = block {
- loop [i: %b4, b: %b5, c: %b6] { # loop_1
- %b4 = block { # initializer
- next_iteration %b5 0u
+ $B3: {
+ loop [i: $B4, b: $B5, c: $B6] { # loop_1
+ $B4: { # initializer
+ next_iteration $B5 0u
}
- %b5 = block (%idx:u32) { # body
+ $B5 (%idx:u32): { # body
%9:bool = gte %idx:u32, 4u
- if %9 [t: %b7] { # if_1
- %b7 = block { # true
+ if %9 [t: $B7] { # if_1
+ $B7: { # true
exit_loop # loop_1
}
}
%10:ptr<storage, vec3<f32>, read_write> = access %target, %idx:u32
%11:vec3<f32> = access %value_param, %idx:u32
store %10, %11
- continue %b6
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%12:u32 = add %idx:u32, 1u
- next_iteration %b5 %12
+ next_iteration $B5 %12
}
}
ret
@@ -1050,12 +1050,12 @@
b_1:u32 @offset(736)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<Outer, 3>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<Outer, 3>):void {
- %b2 = block {
+ $B2: {
store %buffer, %value
ret
}
@@ -1078,44 +1078,44 @@
b_1:u32 @offset(736)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<Outer, 3>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:array<Outer, 3>):void {
- %b2 = block {
+ $B2: {
%4:void = call %tint_store_and_preserve_padding, %buffer, %value
ret
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, array<Outer, 3>, read_write>, %value_param:array<Outer, 3>):void {
- %b3 = block {
- loop [i: %b4, b: %b5, c: %b6] { # loop_1
- %b4 = block { # initializer
- next_iteration %b5 0u
+ $B3: {
+ loop [i: $B4, b: $B5, c: $B6] { # loop_1
+ $B4: { # initializer
+ next_iteration $B5 0u
}
- %b5 = block (%idx:u32) { # body
+ $B5 (%idx:u32): { # body
%9:bool = gte %idx:u32, 3u
- if %9 [t: %b7] { # if_1
- %b7 = block { # true
+ if %9 [t: $B7] { # if_1
+ $B7: { # true
exit_loop # loop_1
}
}
%10:ptr<storage, Outer, read_write> = access %target, %idx:u32
%11:Outer = access %value_param, %idx:u32
%12:void = call %tint_store_and_preserve_padding_1, %10, %11
- continue %b6
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%14:u32 = add %idx:u32, 1u
- next_iteration %b5 %14
+ next_iteration $B5 %14
}
}
ret
}
}
%tint_store_and_preserve_padding_1 = func(%target_1:ptr<storage, Outer, read_write>, %value_param_1:Outer):void { # %tint_store_and_preserve_padding_1: 'tint_store_and_preserve_padding', %target_1: 'target', %value_param_1: 'value_param'
- %b8 = block {
+ $B8: {
%17:ptr<storage, u32, read_write> = access %target_1, 0u
%18:u32 = access %value_param_1, 0u
store %17, %18
@@ -1132,7 +1132,7 @@
}
}
%tint_store_and_preserve_padding_2 = func(%target_2:ptr<storage, Inner, read_write>, %value_param_2:Inner):void { # %tint_store_and_preserve_padding_2: 'tint_store_and_preserve_padding', %target_2: 'target', %value_param_2: 'value_param'
- %b9 = block {
+ $B9: {
%31:ptr<storage, u32, read_write> = access %target_2, 0u
%32:u32 = access %value_param_2, 0u
store %31, %32
@@ -1149,33 +1149,33 @@
}
}
%tint_store_and_preserve_padding_4 = func(%target_3:ptr<storage, array<vec3<f32>, 4>, read_write>, %value_param_3:array<vec3<f32>, 4>):void { # %tint_store_and_preserve_padding_4: 'tint_store_and_preserve_padding', %target_3: 'target', %value_param_3: 'value_param'
- %b10 = block {
- loop [i: %b11, b: %b12, c: %b13] { # loop_2
- %b11 = block { # initializer
- next_iteration %b12 0u
+ $B10: {
+ loop [i: $B11, b: $B12, c: $B13] { # loop_2
+ $B11: { # initializer
+ next_iteration $B12 0u
}
- %b12 = block (%idx_1:u32) { # body
+ $B12 (%idx_1:u32): { # body
%46:bool = gte %idx_1:u32, 4u
- if %46 [t: %b14] { # if_2
- %b14 = block { # true
+ if %46 [t: $B14] { # if_2
+ $B14: { # true
exit_loop # loop_2
}
}
%47:ptr<storage, vec3<f32>, read_write> = access %target_3, %idx_1:u32
%48:vec3<f32> = access %value_param_3, %idx_1:u32
store %47, %48
- continue %b13
+ continue $B13
}
- %b13 = block { # continuing
+ $B13: { # continuing
%49:u32 = add %idx_1:u32, 1u
- next_iteration %b12 %49
+ next_iteration $B12 %49
}
}
ret
}
}
%tint_store_and_preserve_padding_5 = func(%target_4:ptr<storage, mat3x3<f32>, read_write>, %value_param_4:mat3x3<f32>):void { # %tint_store_and_preserve_padding_5: 'tint_store_and_preserve_padding', %target_4: 'target', %value_param_4: 'value_param'
- %b15 = block {
+ $B15: {
%52:ptr<storage, vec3<f32>, read_write> = access %target_4, 0u
%53:vec3<f32> = access %value_param_4, 0u
store %52, %53
@@ -1189,26 +1189,26 @@
}
}
%tint_store_and_preserve_padding_3 = func(%target_5:ptr<storage, array<Inner, 4>, read_write>, %value_param_5:array<Inner, 4>):void { # %tint_store_and_preserve_padding_3: 'tint_store_and_preserve_padding', %target_5: 'target', %value_param_5: 'value_param'
- %b16 = block {
- loop [i: %b17, b: %b18, c: %b19] { # loop_3
- %b17 = block { # initializer
- next_iteration %b18 0u
+ $B16: {
+ loop [i: $B17, b: $B18, c: $B19] { # loop_3
+ $B17: { # initializer
+ next_iteration $B18 0u
}
- %b18 = block (%idx_2:u32) { # body
+ $B18 (%idx_2:u32): { # body
%61:bool = gte %idx_2:u32, 4u
- if %61 [t: %b20] { # if_3
- %b20 = block { # true
+ if %61 [t: $B20] { # if_3
+ $B20: { # true
exit_loop # loop_3
}
}
%62:ptr<storage, Inner, read_write> = access %target_5, %idx_2:u32
%63:Inner = access %value_param_5, %idx_2:u32
%64:void = call %tint_store_and_preserve_padding_2, %62, %63
- continue %b19
+ continue $B19
}
- %b19 = block { # continuing
+ $B19: { # continuing
%65:u32 = add %idx_2:u32, 1u
- next_iteration %b18 %65
+ next_iteration $B18 %65
}
}
ret
@@ -1241,12 +1241,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<mat3x3<f32>, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:mat3x3<f32>):void {
- %b2 = block {
+ $B2: {
%4:ptr<storage, mat3x3<f32>, read_write> = access %buffer, 0u
store %4, %value
%5:ptr<storage, mat3x3<f32>, read_write> = access %buffer, 1u
@@ -1262,12 +1262,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, array<mat3x3<f32>, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%value:mat3x3<f32>):void {
- %b2 = block {
+ $B2: {
%4:ptr<storage, mat3x3<f32>, read_write> = access %buffer, 0u
%5:void = call %tint_store_and_preserve_padding, %4, %value
%7:ptr<storage, mat3x3<f32>, read_write> = access %buffer, 1u
@@ -1280,7 +1280,7 @@
}
}
%tint_store_and_preserve_padding = func(%target:ptr<storage, mat3x3<f32>, read_write>, %value_param:mat3x3<f32>):void {
- %b3 = block {
+ $B3: {
%15:ptr<storage, vec3<f32>, read_write> = access %target, 0u
%16:vec3<f32> = access %value_param, 0u
store %15, %16
diff --git a/src/tint/lang/core/ir/transform/robustness_test.cc b/src/tint/lang/core/ir/transform/robustness_test.cc
index c649a55..1829c79 100644
--- a/src/tint/lang/core/ir/transform/robustness_test.cc
+++ b/src/tint/lang/core/ir/transform/robustness_test.cc
@@ -67,7 +67,7 @@
auto* src = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:u32 = load_vector_element %vec, 5u
ret %3
@@ -78,7 +78,7 @@
auto* expect = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:u32 = load_vector_element %vec, 3u
ret %3
@@ -104,7 +104,7 @@
auto* src = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%idx:u32 = let 5u
%4:u32 = load_vector_element %vec, %idx
@@ -116,7 +116,7 @@
auto* expect = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%idx:u32 = let 5u
%4:u32 = min %idx, 3u
@@ -145,7 +145,7 @@
auto* src = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%4:u32 = load_vector_element %vec, %idx
ret %4
@@ -156,7 +156,7 @@
auto* expect = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%4:u32 = min %idx, 3u
%5:u32 = load_vector_element %vec, %4
@@ -184,7 +184,7 @@
auto* src = R"(
%foo = func(%idx:i32):u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%4:u32 = load_vector_element %vec, %idx
ret %4
@@ -195,7 +195,7 @@
auto* expect = R"(
%foo = func(%idx:i32):u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%4:u32 = convert %idx
%5:u32 = min %4, 3u
@@ -222,7 +222,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
store_vector_element %vec, 5u, 0u
ret
@@ -233,7 +233,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
store_vector_element %vec, 3u, 0u
ret
@@ -259,7 +259,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%idx:u32 = let 5u
store_vector_element %vec, %idx, 0u
@@ -271,7 +271,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%idx:u32 = let 5u
%4:u32 = min %idx, 3u
@@ -300,7 +300,7 @@
auto* src = R"(
%foo = func(%idx:u32):void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
store_vector_element %vec, %idx, 0u
ret
@@ -311,7 +311,7 @@
auto* expect = R"(
%foo = func(%idx:u32):void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%4:u32 = min %idx, 3u
store_vector_element %vec, %4, 0u
@@ -339,7 +339,7 @@
auto* src = R"(
%foo = func(%idx:i32):void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
store_vector_element %vec, %idx, 0u
ret
@@ -350,7 +350,7 @@
auto* expect = R"(
%foo = func(%idx:i32):void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%4:u32 = convert %idx
%5:u32 = min %4, 3u
@@ -378,7 +378,7 @@
auto* src = R"(
%foo = func():vec4<f32> {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %mat, 2u
%4:vec4<f32> = load %3
@@ -409,7 +409,7 @@
auto* src = R"(
%foo = func():vec4<f32> {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%idx:u32 = let 2u
%4:ptr<function, vec4<f32>, read_write> = access %mat, %idx
@@ -422,7 +422,7 @@
auto* expect = R"(
%foo = func():vec4<f32> {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%idx:u32 = let 2u
%4:u32 = min %idx, 3u
@@ -453,7 +453,7 @@
auto* src = R"(
%foo = func(%idx:u32):vec4<f32> {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%4:ptr<function, vec4<f32>, read_write> = access %mat, %idx
%5:vec4<f32> = load %4
@@ -465,7 +465,7 @@
auto* expect = R"(
%foo = func(%idx:u32):vec4<f32> {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%4:u32 = min %idx, 3u
%5:ptr<function, vec4<f32>, read_write> = access %mat, %4
@@ -495,7 +495,7 @@
auto* src = R"(
%foo = func(%idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%4:ptr<function, vec4<f32>, read_write> = access %mat, %idx
%5:vec4<f32> = load %4
@@ -507,7 +507,7 @@
auto* expect = R"(
%foo = func(%idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%4:u32 = convert %idx
%5:u32 = min %4, 3u
@@ -536,7 +536,7 @@
auto* src = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<u32, 4>, read_write> = var
%3:ptr<function, u32, read_write> = access %arr, 2u
%4:u32 = load %3
@@ -567,7 +567,7 @@
auto* src = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<u32, 4>, read_write> = var
%idx:u32 = let 2u
%4:ptr<function, u32, read_write> = access %arr, %idx
@@ -580,7 +580,7 @@
auto* expect = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<u32, 4>, read_write> = var
%idx:u32 = let 2u
%4:u32 = min %idx, 3u
@@ -611,7 +611,7 @@
auto* src = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<u32, 4>, read_write> = var
%4:ptr<function, u32, read_write> = access %arr, %idx
%5:u32 = load %4
@@ -623,7 +623,7 @@
auto* expect = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<u32, 4>, read_write> = var
%4:u32 = min %idx, 3u
%5:ptr<function, u32, read_write> = access %arr, %4
@@ -653,7 +653,7 @@
auto* src = R"(
%foo = func(%idx:i32):u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<u32, 4>, read_write> = var
%4:ptr<function, u32, read_write> = access %arr, %idx
%5:u32 = load %4
@@ -665,7 +665,7 @@
auto* expect = R"(
%foo = func(%idx:i32):u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<u32, 4>, read_write> = var
%4:u32 = convert %idx
%5:u32 = min %4, 3u
@@ -700,7 +700,7 @@
auto* src = R"(
%foo = func(%idx1:u32, %idx2:u32, %idx3:u32, %idx4:u32):u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<array<array<array<u32, 4>, 5>, 6>, 7>, read_write> = var
%7:ptr<function, u32, read_write> = access %arr, %idx1, %idx2, %idx3, %idx4
%8:u32 = load %7
@@ -712,7 +712,7 @@
auto* expect = R"(
%foo = func(%idx1:u32, %idx2:u32, %idx3:u32, %idx4:u32):u32 {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<array<array<array<u32, 4>, 5>, 6>, 7>, read_write> = var
%7:u32 = min %idx1, 6u
%8:u32 = min %idx2, 5u
@@ -756,7 +756,7 @@
}
%foo = func(%idx1:u32, %idx2:u32, %idx3:u32):vec4<f32> {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<structure, 8>, read_write> = var
%6:ptr<function, vec4<f32>, read_write> = access %arr, %idx1, 0u, %idx2, %idx3
%7:vec4<f32> = load %6
@@ -772,7 +772,7 @@
}
%foo = func(%idx1:u32, %idx2:u32, %idx3:u32):vec4<f32> {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<structure, 8>, read_write> = var
%6:u32 = min %idx1, 7u
%7:u32 = min %idx2, 3u
@@ -808,12 +808,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<private, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = load_vector_element %vec, %idx
ret %4
}
@@ -822,12 +822,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<private, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:u32 = load_vector_element %vec, %4
ret %5
@@ -855,12 +855,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<private, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
store_vector_element %vec, %idx, 0u
ret
}
@@ -869,12 +869,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<private, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
store_vector_element %vec, %4, 0u
ret
@@ -903,12 +903,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<private, array<u32, 4>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<private, u32, read_write> = access %arr, %idx
%5:u32 = load %4
ret %5
@@ -918,12 +918,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<private, array<u32, 4>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:ptr<private, u32, read_write> = access %arr, %4
%6:u32 = load %5
@@ -952,12 +952,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<push_constant, vec4<u32>, read> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = load_vector_element %vec, %idx
ret %4
}
@@ -966,12 +966,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<push_constant, vec4<u32>, read> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:u32 = load_vector_element %vec, %4
ret %5
@@ -999,12 +999,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<push_constant, vec4<u32>, read> = var
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
store_vector_element %vec, %idx, 0u
ret
}
@@ -1013,12 +1013,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<push_constant, vec4<u32>, read> = var
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
store_vector_element %vec, %4, 0u
ret
@@ -1047,12 +1047,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<push_constant, array<u32, 4>, read> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<push_constant, u32, read> = access %arr, %idx
%5:u32 = load %4
ret %5
@@ -1062,12 +1062,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<push_constant, array<u32, 4>, read> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:ptr<push_constant, u32, read> = access %arr, %4
%6:u32 = load %5
@@ -1097,12 +1097,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<storage, vec4<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = load_vector_element %vec, %idx
ret %4
}
@@ -1111,12 +1111,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<storage, vec4<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:u32 = load_vector_element %vec, %4
ret %5
@@ -1145,12 +1145,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<storage, vec4<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
store_vector_element %vec, %idx, 0u
ret
}
@@ -1159,12 +1159,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<storage, vec4<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
store_vector_element %vec, %4, 0u
ret
@@ -1194,12 +1194,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<storage, u32, read_write> = access %arr, %idx
%5:u32 = load %4
ret %5
@@ -1209,12 +1209,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32, 4>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:ptr<storage, u32, read_write> = access %arr, %4
%6:u32 = load %5
@@ -1244,12 +1244,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<uniform, vec4<u32>, read> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = load_vector_element %vec, %idx
ret %4
}
@@ -1258,12 +1258,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<uniform, vec4<u32>, read> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:u32 = load_vector_element %vec, %4
ret %5
@@ -1292,12 +1292,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<uniform, vec4<u32>, read> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
store_vector_element %vec, %idx, 0u
ret
}
@@ -1306,12 +1306,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<uniform, vec4<u32>, read> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
store_vector_element %vec, %4, 0u
ret
@@ -1341,12 +1341,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<uniform, array<u32, 4>, read> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<uniform, u32, read> = access %arr, %idx
%5:u32 = load %4
ret %5
@@ -1356,12 +1356,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<uniform, array<u32, 4>, read> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:ptr<uniform, u32, read> = access %arr, %4
%6:u32 = load %5
@@ -1390,12 +1390,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<workgroup, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = load_vector_element %vec, %idx
ret %4
}
@@ -1404,12 +1404,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<workgroup, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:u32 = load_vector_element %vec, %4
ret %5
@@ -1437,12 +1437,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<workgroup, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
store_vector_element %vec, %idx, 0u
ret
}
@@ -1451,12 +1451,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%vec:ptr<workgroup, vec4<u32>, read_write> = var
}
%foo = func(%idx:u32):void {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
store_vector_element %vec, %4, 0u
ret
@@ -1485,12 +1485,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<workgroup, array<u32, 4>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<workgroup, u32, read_write> = access %arr, %idx
%5:u32 = load %4
ret %5
@@ -1500,12 +1500,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<workgroup, array<u32, 4>, read_write> = var
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = min %idx, 3u
%5:ptr<workgroup, u32, read_write> = access %arr, %4
%6:u32 = load %5
@@ -1542,7 +1542,7 @@
auto* src = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = access vec4<u32>(1u, 2u, 3u, 4u), %idx
ret %3
}
@@ -1552,7 +1552,7 @@
auto* expect = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = min %idx, 3u
%4:u32 = access vec4<u32>(1u, 2u, 3u, 4u), %3
ret %4
@@ -1585,7 +1585,7 @@
auto* src = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = access array<u32, 4>(1u, 2u, 3u, 4u), %idx
ret %3
}
@@ -1595,7 +1595,7 @@
auto* expect = R"(
%foo = func(%idx:u32):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = min %idx, 3u
%4:u32 = access array<u32, 4>(1u, 2u, 3u, 4u), %3
ret %4
@@ -1622,7 +1622,7 @@
auto* src = R"(
%foo = func(%arr:array<u32, 4>, %idx:u32):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = access %arr, %idx
ret %4
}
@@ -1632,7 +1632,7 @@
auto* expect = R"(
%foo = func(%arr:array<u32, 4>, %idx:u32):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = min %idx, 3u
%5:u32 = access %arr, %4
ret %5
@@ -1666,12 +1666,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, u32, read_write> = access %arr, 42u
%4:u32 = load %3
ret %4
@@ -1681,12 +1681,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:u32 = arrayLength %arr
%4:u32 = sub %3, 1u
%5:u32 = min 42u, %4
@@ -1719,12 +1719,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<storage, u32, read_write> = access %arr, %idx
%5:u32 = load %4
ret %5
@@ -1734,12 +1734,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = arrayLength %arr
%5:u32 = sub %4, 1u
%6:u32 = min %idx, %5
@@ -1779,12 +1779,12 @@
arr:array<u32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, structure, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, u32, read_write> = access %buffer, 0u, 42u
%4:u32 = load %3
ret %4
@@ -1798,12 +1798,12 @@
arr:array<u32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, structure, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, array<u32>, read_write> = access %buffer, 0u
%4:u32 = arrayLength %3
%5:u32 = sub %4, 1u
@@ -1846,12 +1846,12 @@
arr:array<u32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, structure, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<storage, u32, read_write> = access %buffer, 0u, %idx
%5:u32 = load %4
ret %5
@@ -1865,12 +1865,12 @@
arr:array<u32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, structure, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<storage, array<u32>, read_write> = access %buffer, 0u
%5:u32 = arrayLength %4
%6:u32 = sub %5, 1u
@@ -1904,12 +1904,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:ptr<storage, u32, read_write> = access %arr, %idx
%5:u32 = load %4
ret %5
@@ -1919,12 +1919,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%arr:ptr<storage, array<u32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%idx:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = arrayLength %arr
%5:u32 = sub %4, 1u
%6:u32 = min %idx, %5
@@ -1962,12 +1962,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_2d<f32>, read> = var @binding_point(0, 0)
}
%foo = func():vec2<u32> {
- %b2 = block {
+ $B2: {
%3:texture_2d<f32> = load %texture
%4:vec2<u32> = textureDimensions %3
ret %4
@@ -2002,12 +2002,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_2d<f32>, read> = var @binding_point(0, 0)
}
%foo = func(%level:u32):vec2<u32> {
- %b2 = block {
+ $B2: {
%4:texture_2d<f32> = load %texture
%5:vec2<u32> = textureDimensions %4, %level
ret %5
@@ -2017,12 +2017,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_2d<f32>, read> = var @binding_point(0, 0)
}
%foo = func(%level:u32):vec2<u32> {
- %b2 = block {
+ $B2: {
%4:texture_2d<f32> = load %texture
%5:u32 = textureNumLevels %4
%6:u32 = sub %5, 1u
@@ -2074,19 +2074,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_1d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:i32, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_1d<f32> = load %texture
%6:vec4<f32> = textureLoad %5, %coords, %level
ret %6
}
}
%load_unsigned = func(%coords_1:u32, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%10:texture_1d<f32> = load %texture
%11:vec4<f32> = textureLoad %10, %coords_1, %level_1
ret %11
@@ -2096,12 +2096,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_1d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:i32, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_1d<f32> = load %texture
%6:u32 = textureDimensions %5
%7:u32 = sub %6, 1u
@@ -2116,7 +2116,7 @@
}
}
%load_unsigned = func(%coords_1:u32, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%18:texture_1d<f32> = load %texture
%19:u32 = textureDimensions %18
%20:u32 = sub %19, 1u
@@ -2171,19 +2171,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_2d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_2d<f32> = load %texture
%6:vec4<f32> = textureLoad %5, %coords, %level
ret %6
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%10:texture_2d<f32> = load %texture
%11:vec4<f32> = textureLoad %10, %coords_1, %level_1
ret %11
@@ -2193,12 +2193,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_2d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_2d<f32> = load %texture
%6:vec2<u32> = textureDimensions %5
%7:vec2<u32> = sub %6, vec2<u32>(1u)
@@ -2213,7 +2213,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%18:texture_2d<f32> = load %texture
%19:vec2<u32> = textureDimensions %18
%20:vec2<u32> = sub %19, vec2<u32>(1u)
@@ -2271,19 +2271,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%6:texture_2d_array<f32> = load %texture
%7:vec4<f32> = textureLoad %6, %coords, %layer, %level
ret %7
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %layer_1: 'layer', %level_1: 'level'
- %b3 = block {
+ $B3: {
%12:texture_2d_array<f32> = load %texture
%13:vec4<f32> = textureLoad %12, %coords_1, %layer_1, %level_1
ret %13
@@ -2293,12 +2293,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_2d_array<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%6:texture_2d_array<f32> = load %texture
%7:vec2<u32> = textureDimensions %6
%8:vec2<u32> = sub %7, vec2<u32>(1u)
@@ -2317,7 +2317,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %layer_1: 'layer', %level_1: 'level'
- %b3 = block {
+ $B3: {
%24:texture_2d_array<f32> = load %texture
%25:vec2<u32> = textureDimensions %24
%26:vec2<u32> = sub %25, vec2<u32>(1u)
@@ -2375,19 +2375,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_3d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec3<i32>, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_3d<f32> = load %texture
%6:vec4<f32> = textureLoad %5, %coords, %level
ret %6
}
}
%load_unsigned = func(%coords_1:vec3<u32>, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%10:texture_3d<f32> = load %texture
%11:vec4<f32> = textureLoad %10, %coords_1, %level_1
ret %11
@@ -2397,12 +2397,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_3d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec3<i32>, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_3d<f32> = load %texture
%6:vec3<u32> = textureDimensions %5
%7:vec3<u32> = sub %6, vec3<u32>(1u)
@@ -2417,7 +2417,7 @@
}
}
%load_unsigned = func(%coords_1:vec3<u32>, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%18:texture_3d<f32> = load %texture
%19:vec3<u32> = textureDimensions %18
%20:vec3<u32> = sub %19, vec3<u32>(1u)
@@ -2473,19 +2473,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_multisampled_2d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_multisampled_2d<f32> = load %texture
%6:vec4<f32> = textureLoad %5, %coords, %level
ret %6
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%10:texture_multisampled_2d<f32> = load %texture
%11:vec4<f32> = textureLoad %10, %coords_1, %level_1
ret %11
@@ -2495,12 +2495,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_multisampled_2d<f32>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %level:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_multisampled_2d<f32> = load %texture
%6:vec2<u32> = textureDimensions %5
%7:vec2<u32> = sub %6, vec2<u32>(1u)
@@ -2511,7 +2511,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %level_1:u32):vec4<f32> { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%14:texture_multisampled_2d<f32> = load %texture
%15:vec2<u32> = textureDimensions %14
%16:vec2<u32> = sub %15, vec2<u32>(1u)
@@ -2560,19 +2560,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_depth_2d, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %level:i32):f32 {
- %b2 = block {
+ $B2: {
%5:texture_depth_2d = load %texture
%6:f32 = textureLoad %5, %coords, %level
ret %6
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %level_1:u32):f32 { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%10:texture_depth_2d = load %texture
%11:f32 = textureLoad %10, %coords_1, %level_1
ret %11
@@ -2582,12 +2582,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_depth_2d, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %level:i32):f32 {
- %b2 = block {
+ $B2: {
%5:texture_depth_2d = load %texture
%6:vec2<u32> = textureDimensions %5
%7:vec2<u32> = sub %6, vec2<u32>(1u)
@@ -2602,7 +2602,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %level_1:u32):f32 { # %coords_1: 'coords', %level_1: 'level'
- %b3 = block {
+ $B3: {
%18:texture_depth_2d = load %texture
%19:vec2<u32> = textureDimensions %18
%20:vec2<u32> = sub %19, vec2<u32>(1u)
@@ -2659,19 +2659,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_depth_2d_array, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32, %level:i32):f32 {
- %b2 = block {
+ $B2: {
%6:texture_depth_2d_array = load %texture
%7:f32 = textureLoad %6, %coords, %layer, %level
ret %7
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32, %level_1:u32):f32 { # %coords_1: 'coords', %layer_1: 'layer', %level_1: 'level'
- %b3 = block {
+ $B3: {
%12:texture_depth_2d_array = load %texture
%13:f32 = textureLoad %12, %coords_1, %layer_1, %level_1
ret %13
@@ -2681,12 +2681,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_depth_2d_array, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32, %level:i32):f32 {
- %b2 = block {
+ $B2: {
%6:texture_depth_2d_array = load %texture
%7:vec2<u32> = textureDimensions %6
%8:vec2<u32> = sub %7, vec2<u32>(1u)
@@ -2705,7 +2705,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32, %level_1:u32):f32 { # %coords_1: 'coords', %layer_1: 'layer', %level_1: 'level'
- %b3 = block {
+ $B3: {
%24:texture_depth_2d_array = load %texture
%25:vec2<u32> = textureDimensions %24
%26:vec2<u32> = sub %25, vec2<u32>(1u)
@@ -2761,19 +2761,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_depth_multisampled_2d, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %index:i32):f32 {
- %b2 = block {
+ $B2: {
%5:texture_depth_multisampled_2d = load %texture
%6:f32 = textureLoad %5, %coords, %index
ret %6
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %index_1:u32):f32 { # %coords_1: 'coords', %index_1: 'index'
- %b3 = block {
+ $B3: {
%10:texture_depth_multisampled_2d = load %texture
%11:f32 = textureLoad %10, %coords_1, %index_1
ret %11
@@ -2783,12 +2783,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_depth_multisampled_2d, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %index:i32):f32 {
- %b2 = block {
+ $B2: {
%5:texture_depth_multisampled_2d = load %texture
%6:vec2<u32> = textureDimensions %5
%7:vec2<u32> = sub %6, vec2<u32>(1u)
@@ -2799,7 +2799,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %index_1:u32):f32 { # %coords_1: 'coords', %index_1: 'index'
- %b3 = block {
+ $B3: {
%14:texture_depth_multisampled_2d = load %texture
%15:vec2<u32> = textureDimensions %14
%16:vec2<u32> = sub %15, vec2<u32>(1u)
@@ -2845,19 +2845,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_external = load %texture
%5:vec4<f32> = textureLoad %4, %coords
ret %5
}
}
%load_unsigned = func(%coords_1:vec2<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%8:texture_external = load %texture
%9:vec4<f32> = textureLoad %8, %coords_1
ret %9
@@ -2867,12 +2867,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_external, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_external = load %texture
%5:vec2<u32> = textureDimensions %4
%6:vec2<u32> = sub %5, vec2<u32>(1u)
@@ -2883,7 +2883,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%12:texture_external = load %texture
%13:vec2<u32> = textureDimensions %12
%14:vec2<u32> = sub %13, vec2<u32>(1u)
@@ -2935,19 +2935,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_1d<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_1d<rgba8unorm, read_write> = load %texture
%5:vec4<f32> = textureLoad %4, %coords
ret %5
}
}
%load_unsigned = func(%coords_1:u32):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%8:texture_storage_1d<rgba8unorm, read_write> = load %texture
%9:vec4<f32> = textureLoad %8, %coords_1
ret %9
@@ -2957,12 +2957,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_1d<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_1d<rgba8unorm, read_write> = load %texture
%5:u32 = textureDimensions %4
%6:u32 = sub %5, 1u
@@ -2973,7 +2973,7 @@
}
}
%load_unsigned = func(%coords_1:u32):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%12:texture_storage_1d<rgba8unorm, read_write> = load %texture
%13:u32 = textureDimensions %12
%14:u32 = sub %13, 1u
@@ -3025,19 +3025,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_2d<rgba8unorm, read_write> = load %texture
%5:vec4<f32> = textureLoad %4, %coords
ret %5
}
}
%load_unsigned = func(%coords_1:vec2<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%8:texture_storage_2d<rgba8unorm, read_write> = load %texture
%9:vec4<f32> = textureLoad %8, %coords_1
ret %9
@@ -3047,12 +3047,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_2d<rgba8unorm, read_write> = load %texture
%5:vec2<u32> = textureDimensions %4
%6:vec2<u32> = sub %5, vec2<u32>(1u)
@@ -3063,7 +3063,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%12:texture_storage_2d<rgba8unorm, read_write> = load %texture
%13:vec2<u32> = textureDimensions %12
%14:vec2<u32> = sub %13, vec2<u32>(1u)
@@ -3119,19 +3119,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d_array<rgba8unorm, read_write> = load %texture
%6:vec4<f32> = textureLoad %5, %coords, %layer
ret %6
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32):vec4<f32> { # %coords_1: 'coords', %layer_1: 'layer'
- %b3 = block {
+ $B3: {
%10:texture_storage_2d_array<rgba8unorm, read_write> = load %texture
%11:vec4<f32> = textureLoad %10, %coords_1, %layer_1
ret %11
@@ -3141,12 +3141,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d_array<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d_array<rgba8unorm, read_write> = load %texture
%6:vec2<u32> = textureDimensions %5
%7:vec2<u32> = sub %6, vec2<u32>(1u)
@@ -3161,7 +3161,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32):vec4<f32> { # %coords_1: 'coords', %layer_1: 'layer'
- %b3 = block {
+ $B3: {
%18:texture_storage_2d_array<rgba8unorm, read_write> = load %texture
%19:vec2<u32> = textureDimensions %18
%20:vec2<u32> = sub %19, vec2<u32>(1u)
@@ -3216,19 +3216,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_3d<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec3<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_3d<rgba8unorm, read_write> = load %texture
%5:vec4<f32> = textureLoad %4, %coords
ret %5
}
}
%load_unsigned = func(%coords_1:vec3<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%8:texture_storage_3d<rgba8unorm, read_write> = load %texture
%9:vec4<f32> = textureLoad %8, %coords_1
ret %9
@@ -3238,12 +3238,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_3d<rgba8unorm, read_write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec3<i32>):vec4<f32> {
- %b2 = block {
+ $B2: {
%4:texture_storage_3d<rgba8unorm, read_write> = load %texture
%5:vec3<u32> = textureDimensions %4
%6:vec3<u32> = sub %5, vec3<u32>(1u)
@@ -3254,7 +3254,7 @@
}
}
%load_unsigned = func(%coords_1:vec3<u32>):vec4<f32> { # %coords_1: 'coords'
- %b3 = block {
+ $B3: {
%12:texture_storage_3d<rgba8unorm, read_write> = load %texture
%13:vec3<u32> = textureDimensions %12
%14:vec3<u32> = sub %13, vec3<u32>(1u)
@@ -3308,19 +3308,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_1d<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:i32, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_1d<rgba8unorm, write> = load %texture
%6:void = textureStore %5, %coords, %value
ret
}
}
%load_unsigned = func(%coords_1:u32, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%10:texture_storage_1d<rgba8unorm, write> = load %texture
%11:void = textureStore %10, %coords_1, %value_1
ret
@@ -3330,12 +3330,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_1d<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:i32, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_1d<rgba8unorm, write> = load %texture
%6:u32 = textureDimensions %5
%7:u32 = sub %6, 1u
@@ -3346,7 +3346,7 @@
}
}
%load_unsigned = func(%coords_1:u32, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%14:texture_storage_1d<rgba8unorm, write> = load %texture
%15:u32 = textureDimensions %14
%16:u32 = sub %15, 1u
@@ -3400,19 +3400,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d<rgba8unorm, write> = load %texture
%6:void = textureStore %5, %coords, %value
ret
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%10:texture_storage_2d<rgba8unorm, write> = load %texture
%11:void = textureStore %10, %coords_1, %value_1
ret
@@ -3422,12 +3422,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_2d<rgba8unorm, write> = load %texture
%6:vec2<u32> = textureDimensions %5
%7:vec2<u32> = sub %6, vec2<u32>(1u)
@@ -3438,7 +3438,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%14:texture_storage_2d<rgba8unorm, write> = load %texture
%15:vec2<u32> = textureDimensions %14
%16:vec2<u32> = sub %15, vec2<u32>(1u)
@@ -3494,19 +3494,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d_array<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%6:texture_storage_2d_array<rgba8unorm, write> = load %texture
%7:void = textureStore %6, %coords, %layer, %value
ret
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32, %value_1:vec4<f32>):void { # %coords_1: 'coords', %layer_1: 'layer', %value_1: 'value'
- %b3 = block {
+ $B3: {
%12:texture_storage_2d_array<rgba8unorm, write> = load %texture
%13:void = textureStore %12, %coords_1, %layer_1, %value_1
ret
@@ -3516,12 +3516,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_2d_array<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec2<i32>, %layer:i32, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%6:texture_storage_2d_array<rgba8unorm, write> = load %texture
%7:vec2<u32> = textureDimensions %6
%8:vec2<u32> = sub %7, vec2<u32>(1u)
@@ -3536,7 +3536,7 @@
}
}
%load_unsigned = func(%coords_1:vec2<u32>, %layer_1:u32, %value_1:vec4<f32>):void { # %coords_1: 'coords', %layer_1: 'layer', %value_1: 'value'
- %b3 = block {
+ $B3: {
%20:texture_storage_2d_array<rgba8unorm, write> = load %texture
%21:vec2<u32> = textureDimensions %20
%22:vec2<u32> = sub %21, vec2<u32>(1u)
@@ -3593,19 +3593,19 @@
}
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_3d<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec3<i32>, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_3d<rgba8unorm, write> = load %texture
%6:void = textureStore %5, %coords, %value
ret
}
}
%load_unsigned = func(%coords_1:vec3<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%10:texture_storage_3d<rgba8unorm, write> = load %texture
%11:void = textureStore %10, %coords_1, %value_1
ret
@@ -3615,12 +3615,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%texture:ptr<handle, texture_storage_3d<rgba8unorm, write>, read> = var @binding_point(0, 0)
}
%load_signed = func(%coords:vec3<i32>, %value:vec4<f32>):void {
- %b2 = block {
+ $B2: {
%5:texture_storage_3d<rgba8unorm, write> = load %texture
%6:vec3<u32> = textureDimensions %5
%7:vec3<u32> = sub %6, vec3<u32>(1u)
@@ -3631,7 +3631,7 @@
}
}
%load_unsigned = func(%coords_1:vec3<u32>, %value_1:vec4<f32>):void { # %coords_1: 'coords', %value_1: 'value'
- %b3 = block {
+ $B3: {
%14:texture_storage_3d<rgba8unorm, write> = load %texture
%15:vec3<u32> = textureDimensions %14
%16:vec3<u32> = sub %15, vec3<u32>(1u)
diff --git a/src/tint/lang/core/ir/transform/std140_test.cc b/src/tint/lang/core/ir/transform/std140_test.cc
index fffb4fb..bc65ffd 100644
--- a/src/tint/lang/core/ir/transform/std140_test.cc
+++ b/src/tint/lang/core/ir/transform/std140_test.cc
@@ -49,7 +49,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -83,12 +83,12 @@
a:mat2x4<f32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():mat2x4<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, mat2x4<f32>, read> = access %buffer, 0u
%4:mat2x4<f32> = load %3
ret %4
@@ -127,12 +127,12 @@
a:mat2x4<f32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<storage, MyStruct, read_write> = var @binding_point(0, 0)
}
%foo = func():mat2x4<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<storage, mat2x4<f32>, read_write> = access %buffer, 0u
%4:mat2x4<f32> = load %3
ret %4
@@ -172,12 +172,12 @@
arr:array<mat2x2<f32>, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():mat2x2<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, mat2x2<f32>, read> = access %buffer, 0u, 2u
%4:mat2x2<f32> = load %3
ret %4
@@ -216,12 +216,12 @@
a:mat3x2<f32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():mat3x2<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, mat3x2<f32>, read> = access %buffer, 0u
%4:mat3x2<f32> = load %3
ret %4
@@ -241,12 +241,12 @@
a_col2:vec2<f32> @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%foo = func():mat3x2<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec2<f32>, read> = access %buffer, 0u
%4:vec2<f32> = load %3
%5:ptr<uniform, vec2<f32>, read> = access %buffer, 1u
@@ -287,12 +287,12 @@
a:mat3x2<f32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():vec2<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec2<f32>, read> = access %buffer, 0u, 1u
%4:vec2<f32> = load %3
ret %4
@@ -312,12 +312,12 @@
a_col2:vec2<f32> @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%foo = func():vec2<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec2<f32>, read> = access %buffer, 0u
%4:vec2<f32> = load %3
%5:ptr<uniform, vec2<f32>, read> = access %buffer, 1u
@@ -359,12 +359,12 @@
a:mat3x2<f32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():f32 {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec2<f32>, read> = access %buffer, 0u, 1u
%4:f32 = load_vector_element %3, 1u
ret %4
@@ -384,12 +384,12 @@
a_col2:vec2<f32> @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%foo = func():f32 {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec2<f32>, read> = access %buffer, 0u
%4:vec2<f32> = load %3
%5:ptr<uniform, vec2<f32>, read> = access %buffer, 1u
@@ -431,12 +431,12 @@
a:mat3x2<f32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():MyStruct {
- %b2 = block {
+ $B2: {
%3:MyStruct = load %buffer
ret %3
}
@@ -455,19 +455,19 @@
a_col2:vec2<f32> @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%foo = func():MyStruct {
- %b2 = block {
+ $B2: {
%3:MyStruct_std140 = load %buffer
%4:MyStruct = call %convert_MyStruct, %3
ret %4
}
}
%convert_MyStruct = func(%input:MyStruct_std140):MyStruct {
- %b3 = block {
+ $B3: {
%7:vec2<f32> = access %input, 0u
%8:vec2<f32> = access %input, 1u
%9:vec2<f32> = access %input, 2u
@@ -513,12 +513,12 @@
arr:array<Inner, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%foo = func():Outer {
- %b2 = block {
+ $B2: {
%3:Outer = load %buffer
ret %3
}
@@ -545,29 +545,29 @@
arr:array<Inner_std140, 4> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer_std140, read> = var @binding_point(0, 0)
}
%foo = func():Outer {
- %b2 = block {
+ $B2: {
%3:Outer_std140 = load %buffer
%4:Outer = call %convert_Outer, %3
ret %4
}
}
%convert_Outer = func(%input:Outer_std140):Outer {
- %b3 = block {
+ $B3: {
%7:array<Inner_std140, 4> = access %input, 0u
%8:ptr<function, array<Inner, 4>, read_write> = var
- loop [i: %b4, b: %b5, c: %b6] { # loop_1
- %b4 = block { # initializer
- next_iteration %b5 0u
+ loop [i: $B4, b: $B5, c: $B6] { # loop_1
+ $B4: { # initializer
+ next_iteration $B5 0u
}
- %b5 = block (%idx:u32) { # body
+ $B5 (%idx:u32): { # body
%10:bool = gte %idx:u32, 4u
- if %10 [t: %b7] { # if_1
- %b7 = block { # true
+ if %10 [t: $B7] { # if_1
+ $B7: { # true
exit_loop # loop_1
}
}
@@ -575,11 +575,11 @@
%12:Inner_std140 = access %7, %idx:u32
%13:Inner = call %convert_Inner, %12
store %11, %13
- continue %b6
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%15:u32 = add %idx:u32, 1u
- next_iteration %b5 %15
+ next_iteration $B5 %15
}
}
%16:array<Inner, 4> = load %8
@@ -588,7 +588,7 @@
}
}
%convert_Inner = func(%input_1:Inner_std140):Inner { # %input_1: 'input'
- %b8 = block {
+ $B8: {
%19:vec2<f32> = access %input_1, 0u
%20:vec2<f32> = access %input_1, 1u
%21:vec2<f32> = access %input_1, 2u
@@ -633,12 +633,12 @@
inner:Inner @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%foo = func():Inner {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, Inner, read> = access %buffer, 0u
%4:Inner = load %3
ret %4
@@ -666,12 +666,12 @@
inner:Inner_std140 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer_std140, read> = var @binding_point(0, 0)
}
%foo = func():Inner {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, Inner_std140, read> = access %buffer, 0u
%4:Inner_std140 = load %3
%5:Inner = call %convert_Inner, %4
@@ -679,7 +679,7 @@
}
}
%convert_Inner = func(%input:Inner_std140):Inner {
- %b3 = block {
+ $B3: {
%8:vec2<f32> = access %input, 0u
%9:vec2<f32> = access %input, 1u
%10:vec2<f32> = access %input, 2u
@@ -725,12 +725,12 @@
inner:Inner @offset(32)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%foo = func():Outer {
- %b2 = block {
+ $B2: {
%3:Outer = load %buffer
ret %3
}
@@ -755,19 +755,19 @@
inner:Inner @offset(32)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer_std140, read> = var @binding_point(0, 0)
}
%foo = func():Outer {
- %b2 = block {
+ $B2: {
%3:Outer_std140 = load %buffer
%4:Outer = call %convert_Outer, %3
ret %4
}
}
%convert_Outer = func(%input:Outer_std140):Outer {
- %b3 = block {
+ $B3: {
%7:vec2<f32> = access %input, 0u
%8:vec2<f32> = access %input, 1u
%9:vec2<f32> = access %input, 2u
@@ -830,12 +830,12 @@
d:i32 @offset(168)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<Inner, 4>, read> = access %buffer, 1u
%4:ptr<uniform, Inner, read> = access %3, 2u
%5:ptr<uniform, mat3x2<f32>, read> = access %4, 1u
@@ -883,12 +883,12 @@
d:i32 @offset(168)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer_std140, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<Inner_std140, 4>, read> = access %buffer, 1u
%4:ptr<uniform, Inner_std140, read> = access %3, 2u
%5:ptr<uniform, vec2<f32>, read> = access %4, 1u
@@ -901,14 +901,14 @@
%12:vec2<f32> = access %11, 2u
%13:array<Inner_std140, 4> = load %3
%14:ptr<function, array<Inner, 4>, read_write> = var
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 0u
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 0u
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%16:bool = gte %idx:u32, 4u
- if %16 [t: %b6] { # if_1
- %b6 = block { # true
+ if %16 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -916,11 +916,11 @@
%18:Inner_std140 = access %13, %idx:u32
%19:Inner = call %convert_Inner, %18
store %17, %19
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%21:u32 = add %idx:u32, 1u
- next_iteration %b4 %21
+ next_iteration $B4 %21
}
}
%22:array<Inner, 4> = load %14
@@ -936,7 +936,7 @@
}
}
%convert_Inner = func(%input:Inner_std140):Inner {
- %b7 = block {
+ $B7: {
%32:i32 = access %input, 0u
%33:vec2<f32> = access %input, 1u
%34:vec2<f32> = access %input, 2u
@@ -1001,12 +1001,12 @@
d:i32 @offset(168)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<Inner, 4>, read> = access %buffer, 1u
%arr_ptr:ptr<uniform, array<Inner, 4>, read> = let %3
%5:ptr<uniform, Inner, read> = access %arr_ptr, 2u
@@ -1058,12 +1058,12 @@
d:i32 @offset(168)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer_std140, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, array<Inner_std140, 4>, read> = access %buffer, 1u
%4:ptr<uniform, Inner_std140, read> = access %3, 2u
%5:ptr<uniform, vec2<f32>, read> = access %4, 1u
@@ -1076,14 +1076,14 @@
%12:vec2<f32> = access %11, 2u
%13:array<Inner_std140, 4> = load %3
%14:ptr<function, array<Inner, 4>, read_write> = var
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 0u
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 0u
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%16:bool = gte %idx:u32, 4u
- if %16 [t: %b6] { # if_1
- %b6 = block { # true
+ if %16 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -1091,11 +1091,11 @@
%18:Inner_std140 = access %13, %idx:u32
%19:Inner = call %convert_Inner, %18
store %17, %19
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%21:u32 = add %idx:u32, 1u
- next_iteration %b4 %21
+ next_iteration $B4 %21
}
}
%22:array<Inner, 4> = load %14
@@ -1111,7 +1111,7 @@
}
}
%convert_Inner = func(%input:Inner_std140):Inner {
- %b7 = block {
+ $B7: {
%32:i32 = access %input, 0u
%33:vec2<f32> = access %input, 1u
%34:vec2<f32> = access %input, 2u
@@ -1179,12 +1179,12 @@
d:i32 @offset(168)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer, read> = var @binding_point(0, 0)
}
%foo = func(%arr_idx:i32, %col_idx:i32, %el_idx:i32):void {
- %b2 = block {
+ $B2: {
%6:ptr<uniform, array<Inner, 4>, read> = access %buffer, 1u
%7:ptr<uniform, Inner, read> = access %6, %arr_idx
%8:ptr<uniform, mat3x2<f32>, read> = access %7, 1u
@@ -1232,12 +1232,12 @@
d:i32 @offset(168)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, Outer_std140, read> = var @binding_point(0, 0)
}
%foo = func(%arr_idx:i32, %col_idx:i32, %el_idx:i32):void {
- %b2 = block {
+ $B2: {
%6:ptr<uniform, array<Inner_std140, 4>, read> = access %buffer, 1u
%7:ptr<uniform, Inner_std140, read> = access %6, %arr_idx
%8:ptr<uniform, vec2<f32>, read> = access %7, 1u
@@ -1250,14 +1250,14 @@
%15:vec2<f32> = access %14, %col_idx
%16:array<Inner_std140, 4> = load %6
%17:ptr<function, array<Inner, 4>, read_write> = var
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 0u
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 0u
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%19:bool = gte %idx:u32, 4u
- if %19 [t: %b6] { # if_1
- %b6 = block { # true
+ if %19 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -1265,11 +1265,11 @@
%21:Inner_std140 = access %16, %idx:u32
%22:Inner = call %convert_Inner, %21
store %20, %22
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%24:u32 = add %idx:u32, 1u
- next_iteration %b4 %24
+ next_iteration $B4 %24
}
}
%25:array<Inner, 4> = load %17
@@ -1285,7 +1285,7 @@
}
}
%convert_Inner = func(%input:Inner_std140):Inner {
- %b7 = block {
+ $B7: {
%35:i32 = access %input, 0u
%36:vec2<f32> = access %input, 1u
%37:vec2<f32> = access %input, 2u
@@ -1340,12 +1340,12 @@
b:i32 @offset(128)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, i32, read> = access %buffer, 0u
%4:i32 = load %3
%a:i32 = let %4
@@ -1377,12 +1377,12 @@
b:i32 @offset(128)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, i32, read> = access %buffer, 0u
%4:i32 = load %3
%a:i32 = let %4
@@ -1432,12 +1432,12 @@
a:mat4x3<f32> @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():mat4x3<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, mat4x3<f32>, read> = access %buffer, 0u
%4:mat4x3<f32> = load %3
ret %4
@@ -1458,12 +1458,12 @@
a_col3:vec3<f32> @offset(48)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%foo = func():mat4x3<f32> {
- %b2 = block {
+ $B2: {
%3:ptr<uniform, vec3<f32>, read> = access %buffer, 0u
%4:vec3<f32> = load %3
%5:ptr<uniform, vec3<f32>, read> = access %buffer, 1u
@@ -1578,26 +1578,26 @@
b:mat3x2<f32> @offset(64)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%load_struct_a = func():mat4x4<f32> {
- %b2 = block {
+ $B2: {
%3:MyStruct = load %buffer
%4:mat4x4<f32> = access %3, 0u
ret %4
}
}
%load_struct_b = func():mat3x2<f32> {
- %b3 = block {
+ $B3: {
%6:MyStruct = load %buffer
%7:mat3x2<f32> = access %6, 1u
ret %7
}
}
%load_mat_a = func():vec4<f32> {
- %b4 = block {
+ $B4: {
%9:ptr<uniform, mat4x4<f32>, read> = access %buffer, 0u
%10:mat4x4<f32> = load %9
%11:vec4<f32> = access %10, 0u
@@ -1605,7 +1605,7 @@
}
}
%load_mat_b = func():vec2<f32> {
- %b5 = block {
+ $B5: {
%13:ptr<uniform, mat3x2<f32>, read> = access %buffer, 1u
%14:mat3x2<f32> = load %13
%15:vec2<f32> = access %14, 0u
@@ -1613,7 +1613,7 @@
}
}
%load_vec_a = func():f32 {
- %b6 = block {
+ $B6: {
%17:ptr<uniform, vec4<f32>, read> = access %buffer, 0u, 1u
%18:vec4<f32> = load %17
%19:f32 = access %18, 1u
@@ -1621,7 +1621,7 @@
}
}
%load_vec_b = func():f32 {
- %b7 = block {
+ $B7: {
%21:ptr<uniform, vec2<f32>, read> = access %buffer, 1u, 1u
%22:vec2<f32> = load %21
%23:f32 = access %22, 1u
@@ -1629,14 +1629,14 @@
}
}
%lve_a = func():f32 {
- %b8 = block {
+ $B8: {
%25:ptr<uniform, vec4<f32>, read> = access %buffer, 0u, 1u
%26:f32 = load_vector_element %25, 1u
ret %26
}
}
%lve_b = func():f32 {
- %b9 = block {
+ $B9: {
%28:ptr<uniform, vec2<f32>, read> = access %buffer, 1u, 1u
%29:f32 = load_vector_element %28, 1u
ret %29
@@ -1658,12 +1658,12 @@
b_col2:vec2<f32> @offset(80)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%load_struct_a = func():mat4x4<f32> {
- %b2 = block {
+ $B2: {
%3:MyStruct_std140 = load %buffer
%4:MyStruct = call %convert_MyStruct, %3
%6:mat4x4<f32> = access %4, 0u
@@ -1671,7 +1671,7 @@
}
}
%load_struct_b = func():mat3x2<f32> {
- %b3 = block {
+ $B3: {
%8:MyStruct_std140 = load %buffer
%9:MyStruct = call %convert_MyStruct, %8
%10:mat3x2<f32> = access %9, 1u
@@ -1679,7 +1679,7 @@
}
}
%load_mat_a = func():vec4<f32> {
- %b4 = block {
+ $B4: {
%12:ptr<uniform, mat4x4<f32>, read> = access %buffer, 0u
%13:mat4x4<f32> = load %12
%14:vec4<f32> = access %13, 0u
@@ -1687,7 +1687,7 @@
}
}
%load_mat_b = func():vec2<f32> {
- %b5 = block {
+ $B5: {
%16:ptr<uniform, vec2<f32>, read> = access %buffer, 1u
%17:vec2<f32> = load %16
%18:ptr<uniform, vec2<f32>, read> = access %buffer, 2u
@@ -1700,7 +1700,7 @@
}
}
%load_vec_a = func():f32 {
- %b6 = block {
+ $B6: {
%25:ptr<uniform, vec4<f32>, read> = access %buffer, 0u, 1u
%26:vec4<f32> = load %25
%27:f32 = access %26, 1u
@@ -1708,7 +1708,7 @@
}
}
%load_vec_b = func():f32 {
- %b7 = block {
+ $B7: {
%29:ptr<uniform, vec2<f32>, read> = access %buffer, 1u
%30:vec2<f32> = load %29
%31:ptr<uniform, vec2<f32>, read> = access %buffer, 2u
@@ -1722,14 +1722,14 @@
}
}
%lve_a = func():f32 {
- %b8 = block {
+ $B8: {
%39:ptr<uniform, vec4<f32>, read> = access %buffer, 0u, 1u
%40:f32 = load_vector_element %39, 1u
ret %40
}
}
%lve_b = func():f32 {
- %b9 = block {
+ $B9: {
%42:ptr<uniform, vec2<f32>, read> = access %buffer, 1u
%43:vec2<f32> = load %42
%44:ptr<uniform, vec2<f32>, read> = access %buffer, 2u
@@ -1743,7 +1743,7 @@
}
}
%convert_MyStruct = func(%input:MyStruct_std140):MyStruct {
- %b10 = block {
+ $B10: {
%52:mat4x4<f32> = access %input, 0u
%53:vec2<f32> = access %input, 1u
%54:vec2<f32> = access %input, 2u
@@ -1792,12 +1792,12 @@
d:mat4x4<f16> @offset(56)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:MyStruct = load %buffer
%struct:MyStruct = let %3
%5:ptr<uniform, mat4x4<f16>, read> = access %buffer, 3u
@@ -1838,12 +1838,12 @@
d_col3:vec4<f16> @offset(80)
}
-%b1 = block { # root
+$B1: { # root
%buffer:ptr<uniform, MyStruct_std140, read> = var @binding_point(0, 0)
}
%foo = func():void {
- %b2 = block {
+ $B2: {
%3:MyStruct_std140 = load %buffer
%4:MyStruct = call %convert_MyStruct, %3
%struct:MyStruct = let %4
@@ -1880,7 +1880,7 @@
}
}
%convert_MyStruct = func(%input:MyStruct_std140):MyStruct {
- %b3 = block {
+ $B3: {
%37:vec2<f16> = access %input, 0u
%38:vec2<f16> = access %input, 1u
%39:mat2x2<f16> = construct %37, %38
diff --git a/src/tint/lang/core/ir/transform/value_to_let_test.cc b/src/tint/lang/core/ir/transform/value_to_let_test.cc
index 6208a24..46e1c12 100644
--- a/src/tint/lang/core/ir/transform/value_to_let_test.cc
+++ b/src/tint/lang/core/ir/transform/value_to_let_test.cc
@@ -54,7 +54,7 @@
auto* src = R"(
%F = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -79,7 +79,7 @@
auto* src = R"(
%F = func():i32 {
- %b1 = block {
+ $B1: {
%x:i32 = let 1i
%y:i32 = let 2i
%4:i32 = add %x, %y
@@ -118,12 +118,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%i:ptr<private, i32, read_write> = var
}
%rmw = func(%p:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, %p
%v:i32 = let %5
@@ -132,7 +132,7 @@
}
}
%F = func():i32 {
- %b3 = block {
+ $B3: {
%x:i32 = call %rmw, 1i
%y:i32 = select 2i, %x, false
ret %y
@@ -170,12 +170,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%i:ptr<private, i32, read_write> = var
}
%rmw = func(%p:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, %p
%v:i32 = let %5
@@ -184,7 +184,7 @@
}
}
%F = func():i32 {
- %b3 = block {
+ $B3: {
%x:i32 = call %rmw, 1i
%y:i32 = call %rmw, %x
%z:i32 = call %rmw, %y
@@ -223,12 +223,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%i:ptr<private, i32, read_write> = var
}
%rmw = func(%p:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, %p
%v:i32 = let %5
@@ -237,7 +237,7 @@
}
}
%F = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %rmw, 1i
%x:i32 = let %8
%y:i32 = add %x, %x
@@ -270,13 +270,13 @@
auto* src = R"(
%g = func(%p:ptr<function, i32, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = load %p
ret %3
}
}
%F = func():i32 {
- %b2 = block {
+ $B2: {
%v:ptr<function, i32, read_write> = var
%6:i32 = call %g, %v
%x:i32 = let %6
@@ -306,7 +306,7 @@
auto* src = R"(
%F = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
%l:i32 = load %v
%4:i32 = add %l, %l
@@ -318,7 +318,7 @@
auto* expect = R"(
%F = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
%3:i32 = load %v
%l:i32 = let %3
@@ -344,7 +344,7 @@
auto* src = R"(
%F = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
%l:i32 = load %v
store %v, 1i
@@ -356,7 +356,7 @@
auto* expect = R"(
%F = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
%3:i32 = load %v
%l:i32 = let %3
@@ -393,12 +393,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%i:ptr<private, i32, read_write> = var
}
%rmw = func(%p:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, %p
%v:i32 = let %5
@@ -407,7 +407,7 @@
}
}
%F = func():i32 {
- %b3 = block {
+ $B3: {
%x:i32 = call %rmw, 1i
%y:i32 = call %rmw, 2i
%z:i32 = add %x, %y
@@ -418,12 +418,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%i:ptr<private, i32, read_write> = var
}
%rmw = func(%p:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, %p
%v:i32 = let %5
@@ -432,7 +432,7 @@
}
}
%F = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %rmw, 1i
%x:i32 = let %8
%y:i32 = call %rmw, 2i
@@ -475,12 +475,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%i:ptr<private, i32, read_write> = var
}
%rmw = func(%p:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, %p
%v:i32 = let %5
@@ -489,10 +489,10 @@
}
}
%F = func():i32 {
- %b3 = block {
+ $B3: {
%x:i32 = call %rmw, 1i
- if true [t: %b4] { # if_1
- %b4 = block { # true
+ if true [t: $B4] { # if_1
+ $B4: { # true
ret %x
}
}
@@ -503,12 +503,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%i:ptr<private, i32, read_write> = var
}
%rmw = func(%p:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = load %i
%5:i32 = add %4, %p
%v:i32 = let %5
@@ -517,11 +517,11 @@
}
}
%F = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %rmw, 1i
%x:i32 = let %8
- if true [t: %b4] { # if_1
- %b4 = block { # true
+ if true [t: $B4] { # if_1
+ $B4: { # true
ret %x
}
}
@@ -551,7 +551,7 @@
auto* src = R"(
%F = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
%3:i32 = load %v
%4:i32 = add %3, 1i
@@ -564,7 +564,7 @@
auto* expect = R"(
%F = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
%3:i32 = load %v
%4:i32 = add %3, 1i
@@ -598,7 +598,7 @@
auto* src = R"(
%F = func():void {
- %b1 = block {
+ $B1: {
%i:i32 = max 1i, 2i
%v:ptr<function, i32, read_write> = var, %i
%x:i32 = max 3i, 4i
@@ -613,7 +613,7 @@
auto* expect = R"(
%F = func():void {
- %b1 = block {
+ $B1: {
%i:i32 = max 1i, 2i
%v:ptr<function, i32, read_write> = var, %i
%x:i32 = max 3i, 4i
diff --git a/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors_test.cc b/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors_test.cc
index da8e7fc..7bca08f 100644
--- a/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors_test.cc
+++ b/src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors_test.cc
@@ -50,7 +50,7 @@
auto* src = R"(
%foo = func():mat3x3<f32> {
- %b1 = block {
+ $B1: {
%2:mat3x3<f32> = construct
ret %2
}
@@ -77,7 +77,7 @@
auto* src = R"(
%foo = func(%value:mat3x3<f32>):mat3x3<f32> {
- %b1 = block {
+ $B1: {
%3:mat3x3<f32> = construct %value
ret %3
}
@@ -106,7 +106,7 @@
auto* src = R"(
%foo = func(%v1:vec3<f32>, %v2:vec3<f32>, %v3:vec3<f32>):mat3x3<f32> {
- %b1 = block {
+ $B1: {
%5:mat3x3<f32> = construct %v1, %v2, %v3
ret %5
}
@@ -136,7 +136,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32):mat2x2<f32> {
- %b1 = block {
+ $B1: {
%6:mat2x2<f32> = construct %v1, %v2, %v3, %v4
ret %6
}
@@ -146,7 +146,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32):mat2x2<f32> {
- %b1 = block {
+ $B1: {
%6:vec2<f32> = construct %v1, %v2
%7:vec2<f32> = construct %v3, %v4
%8:mat2x2<f32> = construct %6, %7
@@ -177,7 +177,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32):mat2x3<f32> {
- %b1 = block {
+ $B1: {
%8:mat2x3<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6
ret %8
}
@@ -187,7 +187,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32):mat2x3<f32> {
- %b1 = block {
+ $B1: {
%8:vec3<f32> = construct %v1, %v2, %v3
%9:vec3<f32> = construct %v4, %v5, %v6
%10:mat2x3<f32> = construct %8, %9
@@ -220,7 +220,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32):mat2x4<f32> {
- %b1 = block {
+ $B1: {
%10:mat2x4<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6, %v7, %v8
ret %10
}
@@ -230,7 +230,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32):mat2x4<f32> {
- %b1 = block {
+ $B1: {
%10:vec4<f32> = construct %v1, %v2, %v3, %v4
%11:vec4<f32> = construct %v5, %v6, %v7, %v8
%12:mat2x4<f32> = construct %10, %11
@@ -261,7 +261,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32):mat3x2<f32> {
- %b1 = block {
+ $B1: {
%8:mat3x2<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6
ret %8
}
@@ -271,7 +271,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32):mat3x2<f32> {
- %b1 = block {
+ $B1: {
%8:vec2<f32> = construct %v1, %v2
%9:vec2<f32> = construct %v3, %v4
%10:vec2<f32> = construct %v5, %v6
@@ -306,7 +306,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32):mat3x3<f32> {
- %b1 = block {
+ $B1: {
%11:mat3x3<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6, %v7, %v8, %v9
ret %11
}
@@ -316,7 +316,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32):mat3x3<f32> {
- %b1 = block {
+ $B1: {
%11:vec3<f32> = construct %v1, %v2, %v3
%12:vec3<f32> = construct %v4, %v5, %v6
%13:vec3<f32> = construct %v7, %v8, %v9
@@ -354,7 +354,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32, %v10:f32, %v11:f32, %v12:f32):mat3x4<f32> {
- %b1 = block {
+ $B1: {
%14:mat3x4<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6, %v7, %v8, %v9, %v10, %v11, %v12
ret %14
}
@@ -364,7 +364,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32, %v10:f32, %v11:f32, %v12:f32):mat3x4<f32> {
- %b1 = block {
+ $B1: {
%14:vec4<f32> = construct %v1, %v2, %v3, %v4
%15:vec4<f32> = construct %v5, %v6, %v7, %v8
%16:vec4<f32> = construct %v9, %v10, %v11, %v12
@@ -398,7 +398,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32):mat4x2<f32> {
- %b1 = block {
+ $B1: {
%10:mat4x2<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6, %v7, %v8
ret %10
}
@@ -408,7 +408,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32):mat4x2<f32> {
- %b1 = block {
+ $B1: {
%10:vec2<f32> = construct %v1, %v2
%11:vec2<f32> = construct %v3, %v4
%12:vec2<f32> = construct %v5, %v6
@@ -447,7 +447,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32, %v10:f32, %v11:f32, %v12:f32):mat4x3<f32> {
- %b1 = block {
+ $B1: {
%14:mat4x3<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6, %v7, %v8, %v9, %v10, %v11, %v12
ret %14
}
@@ -457,7 +457,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32, %v10:f32, %v11:f32, %v12:f32):mat4x3<f32> {
- %b1 = block {
+ $B1: {
%14:vec3<f32> = construct %v1, %v2, %v3
%15:vec3<f32> = construct %v4, %v5, %v6
%16:vec3<f32> = construct %v7, %v8, %v9
@@ -501,7 +501,7 @@
auto* src = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32, %v10:f32, %v11:f32, %v12:f32, %v13:f32, %v14:f32, %v15:f32, %v16:f32):mat4x4<f32> {
- %b1 = block {
+ $B1: {
%18:mat4x4<f32> = construct %v1, %v2, %v3, %v4, %v5, %v6, %v7, %v8, %v9, %v10, %v11, %v12, %v13, %v14, %v15, %v16
ret %18
}
@@ -511,7 +511,7 @@
auto* expect = R"(
%foo = func(%v1:f32, %v2:f32, %v3:f32, %v4:f32, %v5:f32, %v6:f32, %v7:f32, %v8:f32, %v9:f32, %v10:f32, %v11:f32, %v12:f32, %v13:f32, %v14:f32, %v15:f32, %v16:f32):mat4x4<f32> {
- %b1 = block {
+ $B1: {
%18:vec4<f32> = construct %v1, %v2, %v3, %v4
%19:vec4<f32> = construct %v5, %v6, %v7, %v8
%20:vec4<f32> = construct %v9, %v10, %v11, %v12
@@ -547,7 +547,7 @@
auto* src = R"(
%foo = func(%v1:f16, %v2:f16, %v3:f16, %v4:f16, %v5:f16, %v6:f16, %v7:f16, %v8:f16, %v9:f16):mat3x3<f16> {
- %b1 = block {
+ $B1: {
%11:mat3x3<f16> = construct %v1, %v2, %v3, %v4, %v5, %v6, %v7, %v8, %v9
ret %11
}
@@ -557,7 +557,7 @@
auto* expect = R"(
%foo = func(%v1:f16, %v2:f16, %v3:f16, %v4:f16, %v5:f16, %v6:f16, %v7:f16, %v8:f16, %v9:f16):mat3x3<f16> {
- %b1 = block {
+ $B1: {
%11:vec3<f16> = construct %v1, %v2, %v3
%12:vec3<f16> = construct %v4, %v5, %v6
%13:vec3<f16> = construct %v7, %v8, %v9
diff --git a/src/tint/lang/core/ir/transform/zero_init_workgroup_memory_test.cc b/src/tint/lang/core/ir/transform/zero_init_workgroup_memory_test.cc
index 0f7292f..60174f1 100644
--- a/src/tint/lang/core/ir/transform/zero_init_workgroup_memory_test.cc
+++ b/src/tint/lang/core/ir/transform/zero_init_workgroup_memory_test.cc
@@ -63,7 +63,7 @@
auto* expect = R"(
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -83,12 +83,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, i32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -112,12 +112,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:bool = load %wgvar
ret
}
@@ -126,15 +126,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, false
exit_if # if_1
}
@@ -161,12 +161,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, i32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:i32 = load %wgvar
ret
}
@@ -175,15 +175,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, i32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, 0i
exit_if # if_1
}
@@ -210,12 +210,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, u32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %wgvar
ret
}
@@ -224,15 +224,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, u32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, 0u
exit_if # if_1
}
@@ -259,12 +259,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, f32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:f32 = load %wgvar
ret
}
@@ -273,15 +273,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, f32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, 0.0f
exit_if # if_1
}
@@ -308,12 +308,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, f16, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:f16 = load %wgvar
ret
}
@@ -322,15 +322,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, f16, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, 0.0h
exit_if # if_1
}
@@ -357,12 +357,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, atomic<i32>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:i32 = atomicLoad %wgvar
ret
}
@@ -371,15 +371,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, atomic<i32>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
%5:void = atomicStore %wgvar, 0i
exit_if # if_1
}
@@ -406,12 +406,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, atomic<u32>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = atomicLoad %wgvar
ret
}
@@ -420,15 +420,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, atomic<u32>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
%5:void = atomicStore %wgvar, 0u
exit_if # if_1
}
@@ -455,12 +455,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<i32, 4>, read_write> = var
}
%main = @compute @workgroup_size(11, 2, 3) func():void {
- %b2 = block {
+ $B2: {
%3:array<i32, 4> = load %wgvar
ret
}
@@ -469,30 +469,30 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<i32, 4>, read_write> = var
}
%main = @compute @workgroup_size(11, 2, 3) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 %tint_local_index
+ $B2: {
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 %tint_local_index
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%5:bool = gte %idx:u32, 4u
- if %5 [t: %b6] { # if_1
- %b6 = block { # true
+ if %5 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
%6:ptr<workgroup, i32, read_write> = access %wgvar, %idx:u32
store %6, 0i
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%7:u32 = add %idx:u32, 66u
- next_iteration %b4 %7
+ next_iteration $B4 %7
}
}
%8:void = workgroupBarrier
@@ -517,12 +517,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<u32, 5>, 7>, read_write> = var
}
%main = @compute @workgroup_size(11, 2, 3) func():void {
- %b2 = block {
+ $B2: {
%3:array<array<u32, 5>, 7> = load %wgvar
ret
}
@@ -531,20 +531,20 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<u32, 5>, 7>, read_write> = var
}
%main = @compute @workgroup_size(11, 2, 3) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 %tint_local_index
+ $B2: {
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 %tint_local_index
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%5:bool = gte %idx:u32, 35u
- if %5 [t: %b6] { # if_1
- %b6 = block { # true
+ if %5 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -552,11 +552,11 @@
%7:u32 = div %idx:u32, 5u
%8:ptr<workgroup, u32, read_write> = access %wgvar, %7, %6
store %8, 0u
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%9:u32 = add %idx:u32, 66u
- next_iteration %b4 %9
+ next_iteration $B4 %9
}
}
%10:void = workgroupBarrier
@@ -581,12 +581,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 7>, 5>, 3>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:array<array<array<i32, 7>, 5>, 3> = load %wgvar
ret
}
@@ -595,20 +595,20 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 7>, 5>, 3>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 %tint_local_index
+ $B2: {
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 %tint_local_index
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%5:bool = gte %idx:u32, 105u
- if %5 [t: %b6] { # if_1
- %b6 = block { # true
+ if %5 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -618,11 +618,11 @@
%9:u32 = div %idx:u32, 35u
%10:ptr<workgroup, i32, read_write> = access %wgvar, %9, %8, %6
store %10, 0i
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%11:u32 = add %idx:u32, 1u
- next_iteration %b4 %11
+ next_iteration $B4 %11
}
}
%12:void = workgroupBarrier
@@ -647,12 +647,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 1>, 5>, 3>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:array<array<array<i32, 1>, 5>, 3> = load %wgvar
ret
}
@@ -661,20 +661,20 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 1>, 5>, 3>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 %tint_local_index
+ $B2: {
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 %tint_local_index
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%5:bool = gte %idx:u32, 15u
- if %5 [t: %b6] { # if_1
- %b6 = block { # true
+ if %5 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -682,11 +682,11 @@
%7:u32 = div %idx:u32, 5u
%8:ptr<workgroup, i32, read_write> = access %wgvar, %7, %6, 0u
store %8, 0i
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%9:u32 = add %idx:u32, 1u
- next_iteration %b4 %9
+ next_iteration $B4 %9
}
}
%10:void = workgroupBarrier
@@ -711,12 +711,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 3>, 1>, 5>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:array<array<array<i32, 3>, 1>, 5> = load %wgvar
ret
}
@@ -725,20 +725,20 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 3>, 1>, 5>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 %tint_local_index
+ $B2: {
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 %tint_local_index
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%5:bool = gte %idx:u32, 15u
- if %5 [t: %b6] { # if_1
- %b6 = block { # true
+ if %5 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -746,11 +746,11 @@
%7:u32 = div %idx:u32, 3u
%8:ptr<workgroup, i32, read_write> = access %wgvar, %7, 0u, %6
store %8, 0i
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%9:u32 = add %idx:u32, 1u
- next_iteration %b4 %9
+ next_iteration $B4 %9
}
}
%10:void = workgroupBarrier
@@ -775,12 +775,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 3>, 5>, 1>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:array<array<array<i32, 3>, 5>, 1> = load %wgvar
ret
}
@@ -789,20 +789,20 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<array<i32, 3>, 5>, 1>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 %tint_local_index
+ $B2: {
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 %tint_local_index
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%5:bool = gte %idx:u32, 15u
- if %5 [t: %b6] { # if_1
- %b6 = block { # true
+ if %5 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -810,11 +810,11 @@
%7:u32 = div %idx:u32, 3u
%8:ptr<workgroup, i32, read_write> = access %wgvar, 0u, %7, %6
store %8, 0i
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%9:u32 = add %idx:u32, 1u
- next_iteration %b4 %9
+ next_iteration $B4 %9
}
}
%10:void = workgroupBarrier
@@ -839,12 +839,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<i32, 1>, 1>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:array<array<i32, 1>, 1> = load %wgvar
ret
}
@@ -853,15 +853,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<array<i32, 1>, 1>, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
%5:ptr<workgroup, i32, read_write> = access %wgvar, 0u, 0u
store %5, 0i
exit_if # if_1
@@ -900,12 +900,12 @@
c:f32 @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, MyStruct, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:MyStruct = load %wgvar
ret
}
@@ -920,15 +920,15 @@
c:f32 @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, MyStruct, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, MyStruct(0i, 0u, 0.0f)
exit_if # if_1
}
@@ -975,12 +975,12 @@
d:bool @offset(12)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, Outer, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:Outer = load %wgvar
ret
}
@@ -1000,15 +1000,15 @@
d:bool @offset(12)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, Outer, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, Outer(0.0f, Inner(0i, 0u), false)
exit_if # if_1
}
@@ -1055,12 +1055,12 @@
d:bool @offset(12)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, Outer, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:Outer = load %wgvar
ret
}
@@ -1080,15 +1080,15 @@
d:bool @offset(12)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, Outer, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
%5:ptr<workgroup, f32, read_write> = access %wgvar, 0u
store %5, 0.0f
%6:ptr<workgroup, i32, read_write> = access %wgvar, 1u, 0u
@@ -1143,12 +1143,12 @@
d:bool @offset(108)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<Outer, 7>, read_write> = var
}
%main = @compute @workgroup_size(7, 3, 2) func():void {
- %b2 = block {
+ $B2: {
%3:array<Outer, 7> = load %wgvar
ret
}
@@ -1168,20 +1168,20 @@
d:bool @offset(108)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, array<Outer, 7>, read_write> = var
}
%main = @compute @workgroup_size(7, 3, 2) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
- loop [i: %b3, b: %b4, c: %b5] { # loop_1
- %b3 = block { # initializer
- next_iteration %b4 %tint_local_index
+ $B2: {
+ loop [i: $B3, b: $B4, c: $B5] { # loop_1
+ $B3: { # initializer
+ next_iteration $B4 %tint_local_index
}
- %b4 = block (%idx:u32) { # body
+ $B4 (%idx:u32): { # body
%5:bool = gte %idx:u32, 7u
- if %5 [t: %b6] { # if_1
- %b6 = block { # true
+ if %5 [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_1
}
}
@@ -1189,21 +1189,21 @@
store %6, 0.0f
%7:ptr<workgroup, bool, read_write> = access %wgvar, %idx:u32, 2u
store %7, false
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
+ $B5: { # continuing
%8:u32 = add %idx:u32, 42u
- next_iteration %b4 %8
+ next_iteration $B4 %8
}
}
- loop [i: %b7, b: %b8, c: %b9] { # loop_2
- %b7 = block { # initializer
- next_iteration %b8 %tint_local_index
+ loop [i: $B7, b: $B8, c: $B9] { # loop_2
+ $B7: { # initializer
+ next_iteration $B8 %tint_local_index
}
- %b8 = block (%idx_1:u32) { # body
+ $B8 (%idx_1:u32): { # body
%10:bool = gte %idx_1:u32, 91u
- if %10 [t: %b10] { # if_2
- %b10 = block { # true
+ if %10 [t: $B10] { # if_2
+ $B10: { # true
exit_loop # loop_2
}
}
@@ -1215,11 +1215,11 @@
%15:u32 = div %idx_1:u32, 13u
%16:ptr<workgroup, atomic<u32>, read_write> = access %wgvar, %15, 1u, %14, 1u
%17:void = atomicStore %16, 0u
- continue %b9
+ continue $B9
}
- %b9 = block { # continuing
+ $B9: { # continuing
%18:u32 = add %idx_1:u32, 42u
- next_iteration %b8 %18
+ next_iteration $B8 %18
}
}
%19:void = workgroupBarrier
@@ -1248,14 +1248,14 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var_a:ptr<workgroup, bool, read_write> = var
%var_b:ptr<workgroup, array<i32, 4>, read_write> = var
%var_c:ptr<workgroup, array<array<u32, 5>, 7>, read_write> = var
}
%main = @compute @workgroup_size(11, 2, 3) func():void {
- %b2 = block {
+ $B2: {
%5:bool = load %var_a
%6:array<i32, 4> = load %var_b
%7:array<array<u32, 5>, 7> = load %var_c
@@ -1266,49 +1266,49 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%var_a:ptr<workgroup, bool, read_write> = var
%var_b:ptr<workgroup, array<i32, 4>, read_write> = var
%var_c:ptr<workgroup, array<array<u32, 5>, 7>, read_write> = var
}
%main = @compute @workgroup_size(11, 2, 3) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%6:bool = eq %tint_local_index, 0u
- if %6 [t: %b3] { # if_1
- %b3 = block { # true
+ if %6 [t: $B3] { # if_1
+ $B3: { # true
store %var_a, false
exit_if # if_1
}
}
- loop [i: %b4, b: %b5, c: %b6] { # loop_1
- %b4 = block { # initializer
- next_iteration %b5 %tint_local_index
+ loop [i: $B4, b: $B5, c: $B6] { # loop_1
+ $B4: { # initializer
+ next_iteration $B5 %tint_local_index
}
- %b5 = block (%idx:u32) { # body
+ $B5 (%idx:u32): { # body
%8:bool = gte %idx:u32, 4u
- if %8 [t: %b7] { # if_2
- %b7 = block { # true
+ if %8 [t: $B7] { # if_2
+ $B7: { # true
exit_loop # loop_1
}
}
%9:ptr<workgroup, i32, read_write> = access %var_b, %idx:u32
store %9, 0i
- continue %b6
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%10:u32 = add %idx:u32, 66u
- next_iteration %b5 %10
+ next_iteration $B5 %10
}
}
- loop [i: %b8, b: %b9, c: %b10] { # loop_2
- %b8 = block { # initializer
- next_iteration %b9 %tint_local_index
+ loop [i: $B8, b: $B9, c: $B10] { # loop_2
+ $B8: { # initializer
+ next_iteration $B9 %tint_local_index
}
- %b9 = block (%idx_1:u32) { # body
+ $B9 (%idx_1:u32): { # body
%12:bool = gte %idx_1:u32, 35u
- if %12 [t: %b11] { # if_3
- %b11 = block { # true
+ if %12 [t: $B11] { # if_3
+ $B11: { # true
exit_loop # loop_2
}
}
@@ -1316,11 +1316,11 @@
%14:u32 = div %idx_1:u32, 5u
%15:ptr<workgroup, u32, read_write> = access %var_c, %14, %13
store %15, 0u
- continue %b10
+ continue $B10
}
- %b10 = block { # continuing
+ $B10: { # continuing
%16:u32 = add %idx_1:u32, 66u
- next_iteration %b9 %16
+ next_iteration $B9 %16
}
}
%17:void = workgroupBarrier
@@ -1353,7 +1353,7 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var_a:ptr<workgroup, bool, read_write> = var
%var_b:ptr<workgroup, i32, read_write> = var
%var_c:ptr<workgroup, array<i32, 42>, read_write> = var
@@ -1361,7 +1361,7 @@
}
%main = @compute @workgroup_size(11, 2, 3) func():void {
- %b2 = block {
+ $B2: {
%6:bool = load %var_a
%7:i32 = load %var_b
%8:array<i32, 42> = load %var_c
@@ -1373,7 +1373,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%var_a:ptr<workgroup, bool, read_write> = var
%var_b:ptr<workgroup, i32, read_write> = var
%var_c:ptr<workgroup, array<i32, 42>, read_write> = var
@@ -1381,23 +1381,23 @@
}
%main = @compute @workgroup_size(11, 2, 3) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%7:bool = eq %tint_local_index, 0u
- if %7 [t: %b3] { # if_1
- %b3 = block { # true
+ if %7 [t: $B3] { # if_1
+ $B3: { # true
store %var_a, false
store %var_b, 0i
exit_if # if_1
}
}
- loop [i: %b4, b: %b5, c: %b6] { # loop_1
- %b4 = block { # initializer
- next_iteration %b5 %tint_local_index
+ loop [i: $B4, b: $B5, c: $B6] { # loop_1
+ $B4: { # initializer
+ next_iteration $B5 %tint_local_index
}
- %b5 = block (%idx:u32) { # body
+ $B5 (%idx:u32): { # body
%9:bool = gte %idx:u32, 42u
- if %9 [t: %b7] { # if_2
- %b7 = block { # true
+ if %9 [t: $B7] { # if_2
+ $B7: { # true
exit_loop # loop_1
}
}
@@ -1407,11 +1407,11 @@
%12:u32 = div %idx:u32, 6u
%13:ptr<workgroup, u32, read_write> = access %var_d, %12, %11
store %13, 0u
- continue %b6
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%14:u32 = add %idx:u32, 66u
- next_iteration %b5 %14
+ next_iteration $B5 %14
}
}
%15:void = workgroupBarrier
@@ -1444,12 +1444,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%global_id:vec4<u32> [@global_invocation_id], %index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%5:bool = load %wgvar
ret
}
@@ -1458,15 +1458,15 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%global_id:vec4<u32> [@global_invocation_id], %index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%5:bool = eq %index, 0u
- if %5 [t: %b3] { # if_1
- %b3 = block { # true
+ if %5 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, false
exit_if # if_1
}
@@ -1526,12 +1526,12 @@
index:u32 @offset(12), @builtin(local_invocation_index)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%params:MyStruct):void {
- %b2 = block {
+ $B2: {
%4:bool = load %wgvar
ret
}
@@ -1545,16 +1545,16 @@
index:u32 @offset(12), @builtin(local_invocation_index)
}
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%params:MyStruct):void {
- %b2 = block {
+ $B2: {
%4:u32 = access %params, 1u
%5:bool = eq %4, 0u
- if %5 [t: %b3] { # if_1
- %b3 = block { # true
+ if %5 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, false
exit_if # if_1
}
@@ -1597,23 +1597,23 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
- if true [t: %b3] { # if_1
- %b3 = block { # true
- switch 42i [c: (default, %b4)] { # switch_1
- %b4 = block { # case
- loop [b: %b5, c: %b6] { # loop_1
- %b5 = block { # body
- continue %b6
+ $B2: {
+ if true [t: $B3] { # if_1
+ $B3: { # true
+ switch 42i [c: (default, $B4)] { # switch_1
+ $B4: { # case
+ loop [b: $B5, c: $B6] { # loop_1
+ $B5: { # body
+ continue $B6
}
- %b6 = block { # continuing
+ $B6: { # continuing
%3:bool = load %wgvar
- break_if %3 %b5
+ break_if %3 $B5
}
}
exit_switch # switch_1
@@ -1629,31 +1629,31 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b2 = block {
+ $B2: {
%4:bool = eq %tint_local_index, 0u
- if %4 [t: %b3] { # if_1
- %b3 = block { # true
+ if %4 [t: $B3] { # if_1
+ $B3: { # true
store %wgvar, false
exit_if # if_1
}
}
%5:void = workgroupBarrier
- if true [t: %b4] { # if_2
- %b4 = block { # true
- switch 42i [c: (default, %b5)] { # switch_1
- %b5 = block { # case
- loop [b: %b6, c: %b7] { # loop_1
- %b6 = block { # body
- continue %b7
+ if true [t: $B4] { # if_2
+ $B4: { # true
+ switch 42i [c: (default, $B5)] { # switch_1
+ $B5: { # case
+ loop [b: $B6, c: $B7] { # loop_1
+ $B6: { # body
+ continue $B7
}
- %b7 = block { # continuing
+ $B7: { # continuing
%6:bool = load %wgvar
- break_if %6 %b6
+ break_if %6 $B6
}
}
exit_switch # switch_1
@@ -1721,28 +1721,28 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%foo = func():void {
- %b2 = block {
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- continue %b4
+ $B2: {
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%3:bool = load %wgvar
- break_if %3 %b3
+ break_if %3 $B3
}
}
ret
}
}
%foo_1 = func():void { # %foo_1: 'foo'
- %b5 = block {
- if true [t: %b6] { # if_1
- %b6 = block { # true
+ $B5: {
+ if true [t: $B6] { # if_1
+ $B6: { # true
%5:void = call %foo
exit_if # if_1
}
@@ -1751,18 +1751,18 @@
}
}
%func = @compute @workgroup_size(1, 1, 1) func():void {
- %b7 = block {
- if true [t: %b8] { # if_2
- %b8 = block { # true
- switch 42i [c: (default, %b9)] { # switch_1
- %b9 = block { # case
- loop [b: %b10, c: %b11] { # loop_2
- %b10 = block { # body
- continue %b11
+ $B7: {
+ if true [t: $B8] { # if_2
+ $B8: { # true
+ switch 42i [c: (default, $B9)] { # switch_1
+ $B9: { # case
+ loop [b: $B10, c: $B11] { # loop_2
+ $B10: { # body
+ continue $B11
}
- %b11 = block { # continuing
+ $B11: { # continuing
%7:void = call %foo_1
- break_if true %b10
+ break_if true $B10
}
}
exit_switch # switch_1
@@ -1778,28 +1778,28 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%foo = func():void {
- %b2 = block {
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- continue %b4
+ $B2: {
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%3:bool = load %wgvar
- break_if %3 %b3
+ break_if %3 $B3
}
}
ret
}
}
%foo_1 = func():void { # %foo_1: 'foo'
- %b5 = block {
- if true [t: %b6] { # if_1
- %b6 = block { # true
+ $B5: {
+ if true [t: $B6] { # if_1
+ $B6: { # true
%5:void = call %foo
exit_if # if_1
}
@@ -1808,26 +1808,26 @@
}
}
%func = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b7 = block {
+ $B7: {
%8:bool = eq %tint_local_index, 0u
- if %8 [t: %b8] { # if_2
- %b8 = block { # true
+ if %8 [t: $B8] { # if_2
+ $B8: { # true
store %wgvar, false
exit_if # if_2
}
}
%9:void = workgroupBarrier
- if true [t: %b9] { # if_3
- %b9 = block { # true
- switch 42i [c: (default, %b10)] { # switch_1
- %b10 = block { # case
- loop [b: %b11, c: %b12] { # loop_2
- %b11 = block { # body
- continue %b12
+ if true [t: $B9] { # if_3
+ $B9: { # true
+ switch 42i [c: (default, $B10)] { # switch_1
+ $B10: { # case
+ loop [b: $B11, c: $B12] { # loop_2
+ $B11: { # body
+ continue $B12
}
- %b12 = block { # continuing
+ $B12: { # continuing
%10:void = call %foo_1
- break_if true %b11
+ break_if true $B11
}
}
exit_switch # switch_1
@@ -1875,32 +1875,32 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%foo = func():void {
- %b2 = block {
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- continue %b4
+ $B2: {
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%3:bool = load %wgvar
- break_if %3 %b3
+ break_if %3 $B3
}
}
ret
}
}
%ep1 = @compute @workgroup_size(1, 1, 1) func():void {
- %b5 = block {
+ $B5: {
%5:void = call %foo
ret
}
}
%ep2 = @compute @workgroup_size(1, 1, 1) func():void {
- %b6 = block {
+ $B6: {
%7:void = call %foo
ret
}
@@ -1909,29 +1909,29 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, bool, read_write> = var
}
%foo = func():void {
- %b2 = block {
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- continue %b4
+ $B2: {
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%3:bool = load %wgvar
- break_if %3 %b3
+ break_if %3 $B3
}
}
ret
}
}
%ep1 = @compute @workgroup_size(1, 1, 1) func(%tint_local_index:u32 [@local_invocation_index]):void {
- %b5 = block {
+ $B5: {
%6:bool = eq %tint_local_index, 0u
- if %6 [t: %b6] { # if_1
- %b6 = block { # true
+ if %6 [t: $B6] { # if_1
+ $B6: { # true
store %wgvar, false
exit_if # if_1
}
@@ -1942,10 +1942,10 @@
}
}
%ep2 = @compute @workgroup_size(1, 1, 1) func(%tint_local_index_1:u32 [@local_invocation_index]):void { # %tint_local_index_1: 'tint_local_index'
- %b7 = block {
+ $B7: {
%11:bool = eq %tint_local_index_1, 0u
- if %11 [t: %b8] { # if_2
- %b8 = block { # true
+ if %11 [t: $B8] { # if_2
+ $B8: { # true
store %wgvar, false
exit_if # if_2
}
diff --git a/src/tint/lang/core/ir/validator_test.cc b/src/tint/lang/core/ir/validator_test.cc
index f8bf536..1252de0 100644
--- a/src/tint/lang/core/ir/validator_test.cc
+++ b/src/tint/lang/core/ir/validator_test.cc
@@ -68,18 +68,18 @@
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(),
R"(:2:3 error: loop: root block: invalid instruction: tint::core::ir::Loop
- loop [b: %b2] { # loop_1
+ loop [b: $B2] { # loop_1
^^^^^^^^^^^^^
:1:1 note: In block
-%b1 = block { # root
-^^^^^^^^^^^
+$B1: { # root
+^^^
note: # Disassembly
-%b1 = block { # root
- loop [b: %b2] { # loop_1
- %b2 = block { # body
- continue %b3
+$B1: { # root
+ loop [b: $B2] { # loop_1
+ $B2: { # body
+ continue $B3
}
}
}
@@ -103,16 +103,16 @@
^^^
:1:1 note: In block
-%b1 = block { # root
-^^^^^^^^^^^
+$B1: { # root
+^^^
note: # Disassembly
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%f = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -145,12 +145,12 @@
note: # Disassembly
%my_func = func(%2:i32, %3:f32):void {
- %b1 = block {
+ $B1: {
ret
}
}
%my_func = func(%2:i32, %3:f32):void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -174,7 +174,7 @@
note: # Disassembly
%my_func = func(%my_param:f32):void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -198,7 +198,7 @@
note: # Disassembly
%my_func = func(%my_param:f32):void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -227,12 +227,12 @@
note: # Disassembly
%my_func1 = func(%my_param:f32):void {
- %b1 = block {
+ $B1: {
ret
}
}
%my_func2 = func(%my_param:f32):void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -258,12 +258,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%f = func():void {
- %b1 = block {
+ $B1: {
%2:void = call %g
ret
}
@@ -289,18 +289,18 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%f = func():void {
- %b1 = block {
+ $B1: {
%2:void = call %g
ret
}
}
%g = @compute func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -326,17 +326,17 @@
^^
:7:3 note: In block
- %b2 = block {
- ^^^^^^^^^^^
+ $B2: {
+ ^^^
note: # Disassembly
%g = func(%2:i32, %3:i32):void {
- %b1 = block {
+ $B1: {
ret
}
}
%f = func():void {
- %b2 = block {
+ $B2: {
%5:void = call %g, 42i
ret
}
@@ -363,17 +363,17 @@
^^
:7:3 note: In block
- %b2 = block {
- ^^^^^^^^^^^
+ $B2: {
+ ^^^
note: # Disassembly
%g = func(%2:i32, %3:i32):void {
- %b1 = block {
+ $B1: {
ret
}
}
%f = func():void {
- %b2 = block {
+ $B2: {
%5:void = call %g, 1i, 2i, 3i
ret
}
@@ -400,17 +400,17 @@
^^^^
:7:3 note: In block
- %b2 = block {
- ^^^^^^^^^^^
+ $B2: {
+ ^^^
note: # Disassembly
%g = func(%2:i32, %3:i32, %4:i32):void {
- %b1 = block {
+ $B1: {
ret
}
}
%f = func():void {
- %b2 = block {
+ $B2: {
%6:void = call %g, 1i, 2.0f, 3i
ret
}
@@ -425,12 +425,12 @@
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(),
R"(:2:3 error: block: does not end in a terminator instruction
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
}
}
)");
@@ -456,22 +456,22 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%f = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
ret
}
}
%g = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -494,15 +494,15 @@
auto res = ir::Validate(mod);
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(),
- R"(:4:20 error: destroyed parameter found in block parameter list
- %b2 = block (%my_param:f32) { # body
- ^^^^^^^^^^^^^
+ R"(:4:12 error: destroyed parameter found in block parameter list
+ $B2 (%my_param:f32): { # body
+ ^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block (%my_param:f32) { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2 (%my_param:f32): { # body
exit_loop # loop_1
}
}
@@ -528,15 +528,15 @@
auto res = ir::Validate(mod);
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(),
- R"(:4:20 error: block parameter has nullptr parent block
- %b2 = block (%my_param:f32) { # body
- ^^^^^^^^^^^^^
+ R"(:4:12 error: block parameter has nullptr parent block
+ $B2 (%my_param:f32): { # body
+ ^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block (%my_param:f32) { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2 (%my_param:f32): { # body
exit_loop # loop_1
}
}
@@ -562,23 +562,23 @@
auto res = ir::Validate(mod);
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(),
- R"(:4:20 error: block parameter has incorrect parent block
- %b2 = block (%my_param:f32) { # body
- ^^^^^^^^^^^^^
+ R"(:4:12 error: block parameter has incorrect parent block
+ $B2 (%my_param:f32): { # body
+ ^^^^^^^^^^^^^
:7:7 note: parent block declared here
- %b3 = block (%my_param:f32) { # continuing
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ $B3 (%my_param:f32): { # continuing
+ ^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block (%my_param:f32) { # body
- continue %b3 %my_param:f32
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2 (%my_param:f32): { # body
+ continue $B3 %my_param:f32
}
- %b3 = block (%my_param:f32) { # continuing
- next_iteration %b2 %my_param:f32
+ $B3 (%my_param:f32): { # continuing
+ next_iteration $B2 %my_param:f32
}
}
ret
@@ -605,12 +605,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:vec3<f32>):void {
- %b1 = block {
+ $B1: {
%3:f32 = access %2, -1i
ret
}
@@ -636,8 +636,8 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
:3:29 note: acceptable range: [0..1]
%3:f32 = access %2, 1u, 3u
@@ -645,7 +645,7 @@
note: # Disassembly
%my_func = func(%2:mat3x2<f32>):void {
- %b1 = block {
+ $B1: {
%3:f32 = access %2, 1u, 3u
ret
}
@@ -672,8 +672,8 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
:3:55 note: acceptable range: [0..1]
%3:ptr<private, f32, read_write> = access %2, 1u, 3u
@@ -681,7 +681,7 @@
note: # Disassembly
%my_func = func(%2:ptr<private, array<array<f32, 2>, 3>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ptr<private, f32, read_write> = access %2, 1u, 3u
ret
}
@@ -706,12 +706,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:f32):void {
- %b1 = block {
+ $B1: {
%3:f32 = access %2, 1u
ret
}
@@ -737,12 +737,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:ptr<private, f32, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ptr<private, f32, read_write> = access %2, 1u
ret
}
@@ -774,8 +774,8 @@
^^
:7:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
MyStruct = struct @align(4) {
@@ -784,7 +784,7 @@
}
%my_func = func(%2:MyStruct, %3:i32):void {
- %b1 = block {
+ $B1: {
%4:i32 = access %2, %3
ret
}
@@ -817,8 +817,8 @@
^^
:7:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
MyStruct = struct @align(4) {
@@ -827,7 +827,7 @@
}
%my_func = func(%2:ptr<private, MyStruct, read_write>, %3:i32):void {
- %b1 = block {
+ $B1: {
%4:i32 = access %2, %3
ret
}
@@ -853,12 +853,12 @@
^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:mat3x2<f32>):void {
- %b1 = block {
+ $B1: {
%3:i32 = access %2, 1u, 1u
ret
}
@@ -885,12 +885,12 @@
^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:ptr<private, array<array<f32, 2>, 3>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ptr<private, i32, read_write> = access %2, 1u, 1u
ret
}
@@ -917,12 +917,12 @@
^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:ptr<private, array<array<f32, 2>, 3>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:f32 = access %2, 1u, 1u
ret
}
@@ -948,12 +948,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:ptr<private, vec3<f32>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:f32 = access %2, 1u
ret
}
@@ -993,12 +993,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:ptr<private, mat3x2<f32>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:f32 = access %2, 1u, 1u
ret
}
@@ -1039,12 +1039,12 @@
^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:ptr<storage, array<f32, 2>, read>):void {
- %b1 = block {
+ $B1: {
%3:ptr<uniform, f32, read> = access %2, 1u
ret
}
@@ -1071,12 +1071,12 @@
^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func(%2:ptr<storage, array<f32, 2>, read>):void {
- %b1 = block {
+ $B1: {
%3:ptr<storage, f32, read_write> = access %2, 1u
ret
}
@@ -1128,12 +1128,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
ret
ret
}
@@ -1166,16 +1166,16 @@
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(),
R"(:4:7 error: block: does not end in a terminator instruction
- %b2 = block { # true
- ^^^^^^^^^^^
+ $B2: { # true
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if true [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2, f: $B3] { # if_1
+ $B2: { # true
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -1198,21 +1198,21 @@
auto res = ir::Validate(mod);
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(), R"(:3:8 error: if: condition must be a `bool` type
- if 1i [t: %b2, f: %b3] { # if_1
+ if 1i [t: $B2, f: $B3] { # if_1
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if 1i [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if 1i [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -1235,21 +1235,21 @@
auto res = ir::Validate(mod);
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(), R"(:3:8 error: if: operand is undefined
- if undef [t: %b2, f: %b3] { # if_1
+ if undef [t: $B2, f: $B3] { # if_1
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if undef [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if undef [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -1274,21 +1274,21 @@
auto res = ir::Validate(mod);
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(), R"(:3:5 error: if: result is undefined
- undef = if true [t: %b2, f: %b3] { # if_1
+ undef = if true [t: $B2, f: $B3] { # if_1
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- undef = if true [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ undef = if true [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -1322,14 +1322,14 @@
ASSERT_NE(res, Success);
EXPECT_EQ(res.Failure().reason.Str(),
R"(:4:7 error: block: does not end in a terminator instruction
- %b2 = block { # body
- ^^^^^^^^^^^
+ $B2: { # body
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
}
}
ret
@@ -1349,11 +1349,11 @@
^^^^^
:1:1 note: In block
-%b1 = block { # root
-^^^^^^^^^^^
+$B1: { # root
+^^^
note: # Disassembly
-%b1 = block { # root
+$B1: { # root
undef = var
}
@@ -1376,12 +1376,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
undef = var
ret
}
@@ -1406,12 +1406,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, f32, read_write> = var, %3
ret
}
@@ -1435,12 +1435,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
undef = let 1i
ret
}
@@ -1464,12 +1464,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:f32 = let undef
ret
}
@@ -1494,12 +1494,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:f32 = let 1i
ret
}
@@ -1525,12 +1525,12 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^$ARROWS^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
<destroyed tint::core::ir::Var $ADDRESS>
ret
}
@@ -1562,12 +1562,12 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, f32, read_write> = var
ret
}
@@ -1593,12 +1593,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, f32, read_write> = var, %3
ret
}
@@ -1624,12 +1624,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, f32, read_write> = var, %3
ret
}
@@ -1652,7 +1652,7 @@
EXPECT_EQ(res.Failure().reason.Str(), R"(error: load: orphaned instruction: load
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, f32, read_write> = var
ret
}
@@ -1674,12 +1674,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = add undef, 2i
ret
}
@@ -1701,12 +1701,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = add 2i, undef
ret
}
@@ -1731,12 +1731,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
undef = add 3i, 2i
ret
}
@@ -1758,12 +1758,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = negation undef
ret
}
@@ -1788,12 +1788,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
undef = negation 2i
ret
}
@@ -1819,12 +1819,12 @@
^^^^^^^^^^^^^^^^^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:f32 = complement 2i
ret
}
@@ -1860,14 +1860,14 @@
^^^^^^^
:4:7 note: In block
- %b2 = block { # true
- ^^^^^^^^^^^
+ $B2: { # true
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
exit_if # undef
}
}
@@ -1899,18 +1899,18 @@
^^^^^^^^^^
:4:7 note: In block
- %b2 = block { # true
- ^^^^^^^^^^^
+ $B2: { # true
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = if true [t: %b2] { # if_1
+ %2:i32, %3:f32 = if true [t: $B2] { # if_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = if true [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ %2:i32, %3:f32 = if true [t: $B2] { # if_1
+ $B2: { # true
exit_if 1i # if_1
}
# implicit false block: exit_if undef, undef
@@ -1943,18 +1943,18 @@
^^^^^^^^^^^^^^^^^^^^
:4:7 note: In block
- %b2 = block { # true
- ^^^^^^^^^^^
+ $B2: { # true
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = if true [t: %b2] { # if_1
+ %2:i32, %3:f32 = if true [t: $B2] { # if_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = if true [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ %2:i32, %3:f32 = if true [t: $B2] { # if_1
+ $B2: { # true
exit_if 1i, 2.0f, 3i # if_1
}
# implicit false block: exit_if undef, undef
@@ -2004,18 +2004,18 @@
^^
:4:7 note: In block
- %b2 = block { # true
- ^^^^^^^^^^^
+ $B2: { # true
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = if true [t: %b2] { # if_1
+ %2:i32, %3:f32 = if true [t: $B2] { # if_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = if true [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ %2:i32, %3:f32 = if true [t: $B2] { # if_1
+ $B2: { # true
exit_if 1i, 2i # if_1
}
# implicit false block: exit_if undef, undef
@@ -2044,14 +2044,14 @@
^^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
ret
}
}
@@ -2087,20 +2087,20 @@
^^^^^^^
:6:11 note: In block
- %b3 = block { # true
- ^^^^^^^^^^^
+ $B3: { # true
+ ^^^
:5:9 note: first control instruction jumped
- if true [t: %b3] { # if_2
+ if true [t: $B3] { # if_2
^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
- if true [t: %b3] { # if_2
- %b3 = block { # true
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
+ if true [t: $B3] { # if_2
+ $B3: { # true
exit_if # if_1
}
}
@@ -2140,20 +2140,20 @@
^^^^^^^
:6:11 note: In block
- %b3 = block { # case
- ^^^^^^^^^^^
+ $B3: { # case
+ ^^^
:5:9 note: first control instruction jumped
- switch 1i [c: (1i, %b3)] { # switch_1
+ switch 1i [c: (1i, $B3)] { # switch_1
^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
- switch 1i [c: (1i, %b3)] { # switch_1
- %b3 = block { # case
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
+ switch 1i [c: (1i, $B3)] { # switch_1
+ $B3: { # case
exit_if # if_1
}
}
@@ -2192,20 +2192,20 @@
^^^^^^^
:6:11 note: In block
- %b3 = block { # body
- ^^^^^^^^^^^
+ $B3: { # body
+ ^^^
:5:9 note: first control instruction jumped
- loop [b: %b3] { # loop_1
+ loop [b: $B3] { # loop_1
^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
- loop [b: %b3] { # loop_1
- %b3 = block { # body
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
+ loop [b: $B3] { # loop_1
+ $B3: { # body
exit_if # if_1
}
}
@@ -2251,14 +2251,14 @@
^^^^^^^^^^^
:4:7 note: In block
- %b2 = block { # case
- ^^^^^^^^^^^
+ $B2: { # case
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- switch true [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch true [c: (default, $B2)] { # switch_1
+ $B2: { # case
exit_switch # undef
}
}
@@ -2292,18 +2292,18 @@
^^^^^^^^^^^^^^
:4:7 note: In block
- %b2 = block { # case
- ^^^^^^^^^^^
+ $B2: { # case
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = switch true [c: (default, %b2)] { # switch_1
+ %2:i32, %3:f32 = switch true [c: (default, $B2)] { # switch_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = switch true [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ %2:i32, %3:f32 = switch true [c: (default, $B2)] { # switch_1
+ $B2: { # case
exit_switch 1i # switch_1
}
}
@@ -2336,18 +2336,18 @@
^^^^^^^^^^^^^^^^^^^^^^^^
:4:7 note: In block
- %b2 = block { # case
- ^^^^^^^^^^^
+ $B2: { # case
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = switch true [c: (default, %b2)] { # switch_1
+ %2:i32, %3:f32 = switch true [c: (default, $B2)] { # switch_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = switch true [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ %2:i32, %3:f32 = switch true [c: (default, $B2)] { # switch_1
+ $B2: { # case
exit_switch 1i, 2.0f, 3i # switch_1
}
}
@@ -2398,18 +2398,18 @@
^^
:4:7 note: In block
- %b2 = block { # case
- ^^^^^^^^^^^
+ $B2: { # case
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = switch true [c: (default, %b2)] { # switch_1
+ %2:i32, %3:f32 = switch true [c: (default, $B2)] { # switch_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = switch true [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ %2:i32, %3:f32 = switch true [c: (default, $B2)] { # switch_1
+ $B2: { # case
exit_switch 1i, 2i # switch_1
}
}
@@ -2442,19 +2442,19 @@
^^^^^^^^^^^
:9:7 note: In block
- %b3 = block { # true
- ^^^^^^^^^^^
+ $B3: { # true
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- switch true [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch true [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret
}
}
- if true [t: %b3] { # if_1
- %b3 = block { # true
+ if true [t: $B3] { # if_1
+ $B3: { # true
exit_switch # switch_1
}
}
@@ -2523,20 +2523,20 @@
^^^^^^^^^^^
:6:11 note: In block
- %b3 = block { # case
- ^^^^^^^^^^^
+ $B3: { # case
+ ^^^
:5:9 note: first control instruction jumped
- switch false [c: (default, %b3)] { # switch_2
+ switch false [c: (default, $B3)] { # switch_2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- switch true [c: (default, %b2)] { # switch_1
- %b2 = block { # case
- switch false [c: (default, %b3)] { # switch_2
- %b3 = block { # case
+ $B1: {
+ switch true [c: (default, $B2)] { # switch_1
+ $B2: { # case
+ switch false [c: (default, $B3)] { # switch_2
+ $B3: { # case
exit_switch # switch_1
}
}
@@ -2574,20 +2574,20 @@
^^^^^^^^^^^
:6:11 note: In block
- %b3 = block { # body
- ^^^^^^^^^^^
+ $B3: { # body
+ ^^^
:5:9 note: first control instruction jumped
- loop [b: %b3] { # loop_1
+ loop [b: $B3] { # loop_1
^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- switch true [c: (default, %b2)] { # switch_1
- %b2 = block { # case
- loop [b: %b3] { # loop_1
- %b3 = block { # body
+ $B1: {
+ switch true [c: (default, $B2)] { # switch_1
+ $B2: { # case
+ loop [b: $B3] { # loop_1
+ $B3: { # body
exit_switch # switch_1
}
}
@@ -2631,18 +2631,18 @@
^^^^^^^^^
:4:7 note: In block
- %b2 = block { # body
- ^^^^^^^^^^^
+ $B2: { # body
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
exit_loop # undef
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -2674,22 +2674,22 @@
^^^^^^^^^^^^
:4:7 note: In block
- %b2 = block { # body
- ^^^^^^^^^^^
+ $B2: { # body
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = loop [b: %b2, c: %b3] { # loop_1
+ %2:i32, %3:f32 = loop [b: $B2, c: $B3] { # loop_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ $B1: {
+ %2:i32, %3:f32 = loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
exit_loop 1i # loop_1
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -2721,22 +2721,22 @@
^^^^^^^^^^^^^^^^^^^^^^
:4:7 note: In block
- %b2 = block { # body
- ^^^^^^^^^^^
+ $B2: { # body
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = loop [b: %b2, c: %b3] { # loop_1
+ %2:i32, %3:f32 = loop [b: $B2, c: $B3] { # loop_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ $B1: {
+ %2:i32, %3:f32 = loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
exit_loop 1i, 2.0f, 3i # loop_1
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -2786,22 +2786,22 @@
^^
:4:7 note: In block
- %b2 = block { # body
- ^^^^^^^^^^^
+ $B2: { # body
+ ^^^
:3:5 note: control instruction
- %2:i32, %3:f32 = loop [b: %b2, c: %b3] { # loop_1
+ %2:i32, %3:f32 = loop [b: $B2, c: $B3] { # loop_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- %2:i32, %3:f32 = loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ $B1: {
+ %2:i32, %3:f32 = loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
exit_loop 1i, 2i # loop_1
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -2832,22 +2832,22 @@
^^^^^^^^^
:12:7 note: In block
- %b4 = block { # true
- ^^^^^^^^^^^
+ $B4: { # true
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
ret
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
- if true [t: %b4] { # if_1
- %b4 = block { # true
+ if true [t: $B4] { # if_1
+ $B4: { # true
exit_loop # loop_1
}
}
@@ -2915,27 +2915,27 @@
^^^^^^^^^
:6:11 note: In block
- %b4 = block { # case
- ^^^^^^^^^^^
+ $B4: { # case
+ ^^^
:5:9 note: first control instruction jumped
- switch false [c: (default, %b4)] { # switch_1
+ switch false [c: (default, $B4)] { # switch_1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- switch false [c: (default, %b4)] { # switch_1
- %b4 = block { # case
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ switch false [c: (default, $B4)] { # switch_1
+ $B4: { # case
exit_loop # loop_1
}
}
exit_loop # loop_1
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -2970,27 +2970,27 @@
^^^^^^^^^
:6:11 note: In block
- %b4 = block { # body
- ^^^^^^^^^^^
+ $B4: { # body
+ ^^^
:5:9 note: first control instruction jumped
- loop [b: %b4] { # loop_2
+ loop [b: $B4] { # loop_2
^^^^^^^^^^^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- loop [b: %b4] { # loop_2
- %b4 = block { # body
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ loop [b: $B4] { # loop_2
+ $B4: { # body
exit_loop # loop_1
}
}
exit_loop # loop_1
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -3020,17 +3020,17 @@
^^^^^^^^^
:7:7 note: In block
- %b3 = block { # continuing
- ^^^^^^^^^^^
+ $B3: { # continuing
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
exit_loop # loop_1
}
}
@@ -3066,27 +3066,27 @@
^^^^^^^^^
:9:11 note: In block
- %b4 = block { # true
- ^^^^^^^^^^^
+ $B4: { # true
+ ^^^
:7:7 note: in continuing block
- %b3 = block { # continuing
- ^^^^^^^^^^^
+ $B3: { # continuing
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
- if true [t: %b4] { # if_1
- %b4 = block { # true
+ $B3: { # continuing
+ if true [t: $B4] { # if_1
+ $B4: { # true
exit_loop # loop_1
}
}
- next_iteration %b2
+ next_iteration $B2
}
}
ret
@@ -3118,21 +3118,21 @@
^^^^^^^^^
:4:7 note: In block
- %b2 = block { # initializer
- ^^^^^^^^^^^
+ $B2: { # initializer
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
+ $B1: {
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
exit_loop # loop_1
}
- %b3 = block { # body
- continue %b4
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
- next_iteration %b3
+ $B4: { # continuing
+ next_iteration $B3
}
}
ret
@@ -3168,30 +3168,30 @@
^^^^^^^^^
:6:11 note: In block
- %b5 = block { # true
- ^^^^^^^^^^^
+ $B5: { # true
+ ^^^
:4:7 note: in initializer block
- %b2 = block { # initializer
- ^^^^^^^^^^^
+ $B2: { # initializer
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
- if true [t: %b5] { # if_1
- %b5 = block { # true
+ $B1: {
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
+ if true [t: $B5] { # if_1
+ $B5: { # true
exit_loop # loop_1
}
}
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
- continue %b4
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
- next_iteration %b3
+ $B4: { # continuing
+ next_iteration $B3
}
}
ret
@@ -3231,12 +3231,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -3256,12 +3256,12 @@
^^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
ret 42i
}
}
@@ -3281,12 +3281,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():i32 {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -3307,12 +3307,12 @@
^^^^^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():i32 {
- %b1 = block {
+ $B1: {
ret 42.0f
}
}
@@ -3335,12 +3335,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = load undef
ret
}
@@ -3366,12 +3366,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%l:i32 = let 1i
%3:f32 = load %l
ret
@@ -3398,12 +3398,12 @@
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:f32 = load %2
ret
@@ -3427,12 +3427,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
store undef, 42i
ret
}
@@ -3456,12 +3456,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, undef
ret
@@ -3487,12 +3487,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%l:i32 = let 1i
store %l, 42u
ret
@@ -3518,12 +3518,12 @@
^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 42u
ret
@@ -3550,12 +3550,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, vec3<f32>, read_write> = var
undef = load_vector_element %2, 1i
ret
@@ -3580,12 +3580,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:f32 = load_vector_element undef, 1i
ret
}
@@ -3610,12 +3610,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, vec3<f32>, read_write> = var
%3:f32 = load_vector_element %2, undef
ret
@@ -3640,12 +3640,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
store_vector_element undef, 1i, 2i
ret
}
@@ -3670,20 +3670,20 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
:4:37 error: store_vector_element: value type does not match vector pointer element type
store_vector_element %2, undef, 2i
^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, vec3<f32>, read_write> = var
store_vector_element %2, undef, 2i
ret
@@ -3709,12 +3709,12 @@
^^^^^
:2:3 note: In block
- %b1 = block {
- ^^^^^^^^^^^
+ $B1: {
+ ^^^
note: # Disassembly
%my_func = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, vec3<f32>, read_write> = var
store_vector_element %2, 1i, undef
ret
diff --git a/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc b/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc
index 483a00a..915307b 100644
--- a/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc
+++ b/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc
@@ -53,7 +53,7 @@
auto* src = R"(
%foo = @compute func():void {
- %b1 = block {
+ $B1: {
%2:void = workgroupBarrier
ret
}
@@ -63,7 +63,7 @@
auto* expect = R"(
%foo = @compute func():void {
- %b1 = block {
+ $B1: {
%2:void = msl.threadgroup_barrier 4u
ret
}
@@ -85,7 +85,7 @@
auto* src = R"(
%foo = @compute func():void {
- %b1 = block {
+ $B1: {
%2:void = storageBarrier
ret
}
@@ -95,7 +95,7 @@
auto* expect = R"(
%foo = @compute func():void {
- %b1 = block {
+ $B1: {
%2:void = msl.threadgroup_barrier 1u
ret
}
@@ -117,7 +117,7 @@
auto* src = R"(
%foo = @compute func():void {
- %b1 = block {
+ $B1: {
%2:void = textureBarrier
ret
}
@@ -127,7 +127,7 @@
auto* expect = R"(
%foo = @compute func():void {
- %b1 = block {
+ $B1: {
%2:void = msl.threadgroup_barrier 2u
ret
}
diff --git a/src/tint/lang/spirv/reader/lower/vector_element_pointer_test.cc b/src/tint/lang/spirv/reader/lower/vector_element_pointer_test.cc
index 6ac38fa..ade391c 100644
--- a/src/tint/lang/spirv/reader/lower/vector_element_pointer_test.cc
+++ b/src/tint/lang/spirv/reader/lower/vector_element_pointer_test.cc
@@ -49,7 +49,7 @@
auto* src = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%2:u32 = access %vec, 2u
ret %2
}
@@ -74,7 +74,7 @@
auto* src = R"(
%foo = func():vec4<u32> {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, vec4<u32>, read_write> = access %vec
%4:vec4<u32> = load %3
@@ -103,7 +103,7 @@
auto* src = R"(
%foo = func():vec4<u32> {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, vec4<u32>, read_write> = access %vec
%4:ptr<function, vec4<u32>, read_write> = access %3
@@ -132,7 +132,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, u32, read_write> = access %vec, 2u
ret
@@ -143,7 +143,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
ret
}
@@ -166,7 +166,7 @@
auto* src = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, u32, read_write> = access %vec, 2u
%4:u32 = load %3
@@ -178,7 +178,7 @@
auto* expect = R"(
%foo = func():u32 {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:u32 = load_vector_element %vec, 2u
ret %3
@@ -202,7 +202,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, u32, read_write> = access %vec, 2u
store %3, 42u
@@ -214,7 +214,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
store_vector_element %vec, 2u, 42u
ret
@@ -239,7 +239,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, u32, read_write> = access %vec, 2u
%4:ptr<function, u32, read_write> = access %3
@@ -252,7 +252,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
store_vector_element %vec, 2u, 42u
ret
@@ -278,7 +278,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, u32, read_write> = access %vec, 2u
%4:u32 = load %3
@@ -292,7 +292,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%vec:ptr<function, vec4<u32>, read_write> = var
%3:u32 = load_vector_element %vec, 2u
%4:u32 = add %3, 1u
@@ -318,7 +318,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%3:ptr<function, f32, read_write> = access %mat, 1u, 2u
store %3, 42.0f
@@ -330,7 +330,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%mat:ptr<function, mat4x4<f32>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %mat, 1u
store_vector_element %3, 2u, 42.0f
@@ -355,7 +355,7 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<vec4<f32>, 4>, read_write> = var
%3:ptr<function, f32, read_write> = access %arr, 1u, 2u
store %3, 42.0f
@@ -367,7 +367,7 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<vec4<f32>, 4>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %arr, 1u
store_vector_element %3, 2u, 42.0f
@@ -401,7 +401,7 @@
}
%foo = func():void {
- %b1 = block {
+ $B1: {
%str:ptr<function, str, read_write> = var
%3:ptr<function, f32, read_write> = access %str, 0u, 2u
store %3, 42.0f
@@ -417,7 +417,7 @@
}
%foo = func():void {
- %b1 = block {
+ $B1: {
%str:ptr<function, str, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %str, 0u
store_vector_element %3, 2u, 42.0f
@@ -453,7 +453,7 @@
}
%foo = func():void {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<str, 4>, read_write> = var
%3:ptr<function, f32, read_write> = access %arr, 1u, 0u, 3u, 2u, 1u
store %3, 42.0f
@@ -469,7 +469,7 @@
}
%foo = func():void {
- %b1 = block {
+ $B1: {
%arr:ptr<function, array<str, 4>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %arr, 1u, 0u, 3u, 2u
store_vector_element %3, 1u, 42.0f
diff --git a/src/tint/lang/spirv/reader/parser/composite_test.cc b/src/tint/lang/spirv/reader/parser/composite_test.cc
index 078034c..463e33b 100644
--- a/src/tint/lang/spirv/reader/parser/composite_test.cc
+++ b/src/tint/lang/spirv/reader/parser/composite_test.cc
@@ -57,7 +57,8 @@
OpFunctionEnd
)",
R"(
- %b2 = block {
+%2 = func():vec4<u32> {
+ $B2: {
%3:vec4<u32> = construct 1u, 2u, 3u, 4u
ret %3
}
@@ -95,7 +96,8 @@
OpFunctionEnd
)",
R"(
- %b2 = block {
+%2 = func():mat4x3<f32> {
+ $B2: {
%3:vec3<f32> = construct 1.0f, 2.0f, 3.0f
%4:vec3<f32> = construct 2.0f, 3.0f, 1.0f
%5:vec3<f32> = construct 3.0f, 2.0f, 1.0f
@@ -133,7 +135,8 @@
OpFunctionEnd
)",
R"(
- %b2 = block {
+%2 = func():array<u32, 4> {
+ $B2: {
%3:array<u32, 4> = construct 1u, 2u, 3u, 4u
ret %3
}
@@ -172,7 +175,8 @@
OpFunctionEnd
)",
R"(
- %b2 = block {
+%2 = func():array<vec4<u32>, 4> {
+ $B2: {
%3:vec4<u32> = construct 1u, 2u, 3u, 4u
%4:vec4<u32> = construct 2u, 3u, 4u, 1u
%5:vec4<u32> = construct 3u, 4u, 1u, 2u
@@ -223,12 +227,12 @@
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
%2 = func():tint_symbol_3 {
- %b2 = block {
+ $B2: {
%3:vec4<u32> = construct 1u, 2u, 3u, 4u
%4:vec4<u32> = construct 2u, 3u, 4u, 1u
%5:vec4<u32> = construct 3u, 4u, 1u, 2u
@@ -265,7 +269,7 @@
)",
R"(
%2 = func(%3:vec4<u32>):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %3, 2u
ret %4
}
@@ -300,7 +304,7 @@
)",
R"(
%2 = func(%3:mat4x3<f32>):vec3<f32> {
- %b2 = block {
+ $B2: {
%4:vec3<f32> = access %3, 2u
ret %4
}
@@ -335,7 +339,7 @@
)",
R"(
%2 = func(%3:mat4x3<f32>):f32 {
- %b2 = block {
+ $B2: {
%4:f32 = access %3, 2u, 1u
ret %4
}
@@ -369,7 +373,7 @@
)",
R"(
%2 = func(%3:array<u32, 4>):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %3, 2u
ret %4
}
@@ -404,7 +408,7 @@
)",
R"(
%2 = func(%3:array<vec3<u32>, 4>):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %3, 1u, 2u
ret %4
}
@@ -442,12 +446,12 @@
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
%2 = func(%3:tint_symbol_2):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = access %3, 1u
ret %4
}
diff --git a/src/tint/lang/spirv/reader/parser/constant_test.cc b/src/tint/lang/spirv/reader/parser/constant_test.cc
index b46db7d..b509dc0 100644
--- a/src/tint/lang/spirv/reader/parser/constant_test.cc
+++ b/src/tint/lang/spirv/reader/parser/constant_test.cc
@@ -65,7 +65,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:void = call %2, true
%6:void = call %2, false
%7:void = call %2, false
@@ -116,7 +116,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:void = call %2, 0i
%6:void = call %2, 1i
%7:void = call %2, -1i
@@ -166,7 +166,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:void = call %2, 0u
%6:void = call %2, 1u
%7:void = call %2, 4294967295u
@@ -219,7 +219,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:void = call %2, 0.0h
%6:void = call %2, 1.0h
%7:void = call %2, 65504.0h
@@ -273,7 +273,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:void = call %2, 0.0f
%6:void = call %2, 1.0f
%7:void = call %2, 340282346638528859811704183484516925440.0f
@@ -322,7 +322,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:vec2<bool> = call %2, vec2<bool>(true, false)
%6:vec2<bool> = call %2, vec2<bool>(false)
ret
@@ -368,7 +368,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:vec3<i32> = call %2, vec3<i32>(0i, 1i, -1i)
%6:vec3<i32> = call %2, vec3<i32>(0i)
ret
@@ -415,7 +415,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:vec4<f32> = call %2, vec4<f32>(0.0f, 1.0f, 340282346638528859811704183484516925440.0f, -340282346638528859811704183484516925440.0f)
%6:vec4<f32> = call %2, vec4<f32>(0.0f)
ret
@@ -463,7 +463,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:mat2x4<f32> = call %2, mat2x4<f32>(vec4<f32>(0.0f), vec4<f32>(1.0f))
%6:mat2x4<f32> = call %2, mat2x4<f32>(vec4<f32>(0.0f))
ret
@@ -514,7 +514,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:mat3x2<f16> = call %2, mat3x2<f16>(vec2<f16>(0.0h), vec2<f16>(1.0h), vec2<f16>(65504.0h))
%6:mat3x2<f16> = call %2, mat3x2<f16>(vec2<f16>(0.0h))
ret
@@ -562,7 +562,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:array<i32, 4> = call %2, array<i32, 4>(0i, 1i, -1i, 2147483647i)
%6:array<i32, 4> = call %2, array<i32, 4>(0i)
ret
@@ -615,7 +615,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:array<array<f32, 4>, 2> = call %2, array<array<f32, 4>, 2>(array<f32, 4>(0.0f, 1.0f, 340282346638528859811704183484516925440.0f, -340282346638528859811704183484516925440.0f), array<f32, 4>(-340282346638528859811704183484516925440.0f, 340282346638528859811704183484516925440.0f, 1.0f, 0.0f))
%6:array<array<f32, 4>, 2> = call %2, array<array<f32, 4>, 2>(array<f32, 4>(0.0f))
ret
@@ -661,7 +661,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:tint_symbol_2 = call %2, tint_symbol_2(42i, -1.0f)
%6:tint_symbol_2 = call %2, tint_symbol_2(0i, 0.0f)
ret
@@ -716,7 +716,7 @@
)",
R"(
%4 = func():void {
- %b3 = block {
+ $B3: {
%5:tint_symbol_5 = call %2, tint_symbol_5(array<tint_symbol_2, 2>(tint_symbol_2(42i, -1.0f), tint_symbol_2(-1i, 42.0f)), array<tint_symbol_2, 2>(tint_symbol_2(-1i, 42.0f), tint_symbol_2(42i, -1.0f)))
%6:tint_symbol_5 = call %2, tint_symbol_5(array<tint_symbol_2, 2>(tint_symbol_2(0i, 0.0f)))
ret
diff --git a/src/tint/lang/spirv/reader/parser/function_test.cc b/src/tint/lang/spirv/reader/parser/function_test.cc
index 21cdd84..d268ebb 100644
--- a/src/tint/lang/spirv/reader/parser/function_test.cc
+++ b/src/tint/lang/spirv/reader/parser/function_test.cc
@@ -45,7 +45,7 @@
)",
R"(
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -67,7 +67,7 @@
)",
R"(
%main = @compute @workgroup_size(3, 4, 5) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -89,7 +89,7 @@
)",
R"(
%main = @fragment func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -110,7 +110,7 @@
)",
R"(
%main = @vertex func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -140,12 +140,12 @@
)",
R"(
%foo = @compute @workgroup_size(3, 4, 5) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
%bar = @compute @workgroup_size(6, 7, 8) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -174,12 +174,12 @@
)",
R"(
%1 = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:void = call %1
ret
}
@@ -209,13 +209,13 @@
)",
R"(
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%2:void = call %3
ret
}
}
%3 = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -250,12 +250,12 @@
)",
R"(
%1 = func(%2:bool):void {
- %b1 = block {
+ $B1: {
ret
}
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%4:void = call %1, true
%5:void = call %1, false
ret
@@ -299,18 +299,18 @@
)",
R"(
%1 = func(%2:bool):void {
- %b1 = block {
+ $B1: {
ret
}
}
%3 = func(%4:bool):void {
- %b2 = block {
+ $B2: {
%5:void = call %1, %4
ret
}
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b3 = block {
+ $B3: {
%7:void = call %3, true
%8:void = call %3, false
ret
@@ -347,12 +347,12 @@
)",
R"(
%1 = func(%2:bool, %3:bool):void {
- %b1 = block {
+ $B1: {
ret
}
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%5:void = call %1, true, false
ret
}
@@ -385,12 +385,12 @@
)",
R"(
%1 = func():bool {
- %b1 = block {
+ $B1: {
ret true
}
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:bool = call %1
ret
}
@@ -429,18 +429,18 @@
)",
R"(
%1 = func():bool {
- %b1 = block {
+ $B1: {
ret true
}
}
%2 = func():bool {
- %b2 = block {
+ $B2: {
%3:bool = call %2
ret %3
}
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b3 = block {
+ $B3: {
%5:bool = call %1
ret
}
@@ -474,12 +474,12 @@
)",
R"(
%1 = func(%2:bool):bool {
- %b1 = block {
+ $B1: {
ret %2
}
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%4:bool = call %1, true
ret
}
diff --git a/src/tint/lang/spirv/reader/parser/memory_test.cc b/src/tint/lang/spirv/reader/parser/memory_test.cc
index a2b3abd..90e4945 100644
--- a/src/tint/lang/spirv/reader/parser/memory_test.cc
+++ b/src/tint/lang/spirv/reader/parser/memory_test.cc
@@ -48,7 +48,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, u32, read_write> = var
%3:u32 = load %2
ret
@@ -75,7 +76,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, vec4<u32>, read_write> = var
%3:vec4<u32> = load %2
ret
@@ -105,7 +107,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 2u
%4:u32 = load %3
@@ -135,7 +138,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, mat3x4<f32>, read_write> = var
%3:mat3x4<f32> = load %2
ret
@@ -167,7 +171,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, mat3x4<f32>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %2, 2u
%4:vec4<f32> = load %3
@@ -196,7 +201,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<u32, 4>, read_write> = var
%3:array<u32, 4> = load %2
ret
@@ -227,7 +233,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<u32, 4>, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 2u
%4:u32 = load %3
@@ -255,7 +262,13 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+tint_symbol_2 = struct @align(4) {
+ tint_symbol:u32 @offset(0)
+ tint_symbol_1:u32 @offset(4)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, tint_symbol_2, read_write> = var
%3:tint_symbol_2 = load %2
ret
@@ -285,7 +298,13 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+tint_symbol_2 = struct @align(4) {
+ tint_symbol:u32 @offset(0)
+ tint_symbol_1:u32 @offset(4)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, tint_symbol_2, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 1u
%4:u32 = load %3
@@ -313,7 +332,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, u32, read_write> = var
store %2, 42u
ret
@@ -341,7 +361,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, vec4<u32>, read_write> = var
store %2, vec4<u32>(0u)
ret
@@ -372,7 +393,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, vec4<u32>, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 2u
store %3, 42u
@@ -403,7 +425,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, mat3x4<f32>, read_write> = var
store %2, mat3x4<f32>(vec4<f32>(0.0f))
ret
@@ -436,7 +459,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, mat3x4<f32>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %2, 2u
store %3, vec4<f32>(0.0f)
@@ -466,7 +490,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<u32, 4>, read_write> = var
store %2, array<u32, 4>(0u)
ret
@@ -498,7 +523,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<u32, 4>, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 2u
store %3, 42u
@@ -527,7 +553,13 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+tint_symbol_2 = struct @align(4) {
+ tint_symbol:u32 @offset(0)
+ tint_symbol_1:u32 @offset(4)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, tint_symbol_2, read_write> = var
store %2, tint_symbol_2(0u)
ret
@@ -558,7 +590,13 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+tint_symbol_2 = struct @align(4) {
+ tint_symbol:u32 @offset(0)
+ tint_symbol_1:u32 @offset(4)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, tint_symbol_2, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 1u
store %3, 42u
@@ -596,7 +634,14 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+ tint_symbol:array<u32, 4> @offset(0)
+ tint_symbol_1:array<u32, 4> @offset(16)
+ tint_symbol_2:array<u32, 4> @offset(32)
+ tint_symbol_3:array<u32, 4> @offset(48)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<tint_symbol_4, 4>, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 1u, 2u, 3u
%4:u32 = load %3
@@ -639,7 +684,14 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+ tint_symbol:array<u32, 4> @offset(0)
+ tint_symbol_1:array<u32, 4> @offset(16)
+ tint_symbol_2:array<u32, 4> @offset(32)
+ tint_symbol_3:array<u32, 4> @offset(48)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<tint_symbol_4, 4>, read_write> = var
%3:ptr<function, tint_symbol_4, read_write> = access %2, 1u
%4:ptr<function, array<u32, 4>, read_write> = access %3, 2u
@@ -671,7 +723,8 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, u32, read_write> = var
%3:ptr<function, u32, read_write> = access %2
%4:ptr<function, u32, read_write> = access %3
@@ -711,7 +764,14 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+ tint_symbol:array<u32, 4> @offset(0)
+ tint_symbol_1:array<u32, 4> @offset(16)
+ tint_symbol_2:array<u32, 4> @offset(32)
+ tint_symbol_3:array<u32, 4> @offset(48)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<tint_symbol_4, 4>, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 1i, 2u, 3i
%4:u32 = load %3
@@ -750,7 +810,14 @@
OpFunctionEnd
)",
R"(
- %b1 = block {
+ tint_symbol:array<u32, 4> @offset(0)
+ tint_symbol_1:array<u32, 4> @offset(16)
+ tint_symbol_2:array<u32, 4> @offset(32)
+ tint_symbol_3:array<u32, 4> @offset(48)
+}
+
+%main = @compute @workgroup_size(1, 1, 1) func():void {
+ $B1: {
%2:ptr<function, array<tint_symbol_4, 4>, read_write> = var
%3:ptr<function, u32, read_write> = access %2, 1u, 2u, 3u
%4:u32 = load %3
@@ -797,13 +864,13 @@
tint_symbol:u32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read> = var @binding_point(1, 2)
%2:ptr<storage, tint_symbol_1, read_write> = var @binding_point(1, 3)
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%4:ptr<storage, u32, read> = access %1, 0u
%5:ptr<storage, u32, read_write> = access %2, 0u
%6:u32 = load %4
diff --git a/src/tint/lang/spirv/reader/parser/struct_test.cc b/src/tint/lang/spirv/reader/parser/struct_test.cc
index bee1e62..88d7349 100644
--- a/src/tint/lang/spirv/reader/parser/struct_test.cc
+++ b/src/tint/lang/spirv/reader/parser/struct_test.cc
@@ -91,7 +91,7 @@
}
%1 = func(%2:tint_symbol_2):void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -129,7 +129,7 @@
}
%1 = func(%2:tint_symbol_2, %3:tint_symbol_2):tint_symbol_2 {
- %b1 = block {
+ $B1: {
ret %2
}
}
@@ -179,7 +179,7 @@
}
%1 = func(%2:tint_symbol_9):void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -222,7 +222,7 @@
}
%1 = func(%2:tint_symbol_4):void {
- %b1 = block {
+ $B1: {
ret
}
}
diff --git a/src/tint/lang/spirv/reader/parser/var_test.cc b/src/tint/lang/spirv/reader/parser/var_test.cc
index 8a3d4c0..f7bbc1b 100644
--- a/src/tint/lang/spirv/reader/parser/var_test.cc
+++ b/src/tint/lang/spirv/reader/parser/var_test.cc
@@ -48,7 +48,7 @@
)",
R"(
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, u32, read_write> = var
ret
}
@@ -75,7 +75,7 @@
)",
R"(
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, u32, read_write> = var, 42u
ret
}
@@ -100,12 +100,12 @@
OpFunctionEnd
)",
R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, u32, read_write> = var
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -130,12 +130,12 @@
OpFunctionEnd
)",
R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, u32, read_write> = var, 42u
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -170,12 +170,12 @@
tint_symbol:u32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read> = var @binding_point(1, 2)
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -209,12 +209,12 @@
tint_symbol:u32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read_write> = var @binding_point(1, 2)
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -252,13 +252,13 @@
tint_symbol:u32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, tint_symbol_1, read> = var @binding_point(1, 2)
%2:ptr<storage, tint_symbol_1, read_write> = var @binding_point(1, 3)
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -292,12 +292,12 @@
tint_symbol:u32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<uniform, tint_symbol_1, read> = var @binding_point(1, 2)
}
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
ret
}
}
diff --git a/src/tint/lang/spirv/reader/reader_test.cc b/src/tint/lang/spirv/reader/reader_test.cc
index e5640bc..20a0ebb 100644
--- a/src/tint/lang/spirv/reader/reader_test.cc
+++ b/src/tint/lang/spirv/reader/reader_test.cc
@@ -111,7 +111,7 @@
ASSERT_EQ(got, Success);
EXPECT_EQ(got, R"(
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, vec4<u32>, read_write> = var
%3:u32 = load_vector_element %2, 2u
ret
@@ -145,7 +145,7 @@
ASSERT_EQ(got, Success);
EXPECT_EQ(got, R"(
%main = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, vec4<u32>, read_write> = var
store_vector_element %2, 2u, 42u
ret
diff --git a/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc b/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc
index e64f154..1049aac 100644
--- a/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc
+++ b/src/tint/lang/spirv/writer/raise/builtin_polyfill_test.cc
@@ -71,12 +71,12 @@
arr:array<i32> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<storage, Buffer, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, array<i32>, read_write> = access %var, 2u
%4:u32 = arrayLength %3
ret %4
@@ -92,12 +92,12 @@
arr:array<i32> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<storage, Buffer, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, array<i32>, read_write> = access %var, 2u
%4:u32 = spirv.array_length %var, 2u
ret %4
@@ -137,12 +137,12 @@
arr:array<i32> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<storage, Buffer, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%a:ptr<storage, Buffer, read_write> = let %var
%b:ptr<storage, Buffer, read_write> = let %a
%5:ptr<storage, array<i32>, read_write> = access %b, 2u
@@ -160,12 +160,12 @@
arr:array<i32> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<storage, Buffer, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%a:ptr<storage, Buffer, read_write> = let %var
%b:ptr<storage, Buffer, read_write> = let %a
%5:ptr<storage, array<i32>, read_write> = access %b, 2u
@@ -207,12 +207,12 @@
arr:array<i32> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<storage, Buffer, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, array<i32>, read_write> = access %var, 2u
%a:ptr<storage, array<i32>, read_write> = let %3
%b:ptr<storage, array<i32>, read_write> = let %a
@@ -230,12 +230,12 @@
arr:array<i32> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<storage, Buffer, read_write> = var @binding_point(0, 0)
}
%foo = func():u32 {
- %b2 = block {
+ $B2: {
%3:ptr<storage, array<i32>, read_write> = access %var, 2u
%a:ptr<storage, array<i32>, read_write> = let %3
%b:ptr<storage, array<i32>, read_write> = let %a
@@ -265,12 +265,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicAdd %1, %arg1
ret %4
}
@@ -279,12 +279,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, atomic<i32>, read_write> = var @binding_point(0, 0)
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_iadd %1, 1u, 0u, %arg1
ret %4
}
@@ -309,12 +309,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicAdd %1, %arg1
ret %4
}
@@ -323,12 +323,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_iadd %1, 2u, 0u, %arg1
ret %4
}
@@ -353,12 +353,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicAnd %1, %arg1
ret %4
}
@@ -367,12 +367,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_and %1, 2u, 0u, %arg1
ret %4
}
@@ -405,12 +405,12 @@
exchanged:bool @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%cmp:i32, %val:i32):i32 {
- %b2 = block {
+ $B2: {
%5:__atomic_compare_exchange_result_i32 = atomicCompareExchangeWeak %1, %cmp, %val
%6:i32 = access %5, 0u
ret %6
@@ -425,12 +425,12 @@
exchanged:bool @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%cmp:i32, %val:i32):i32 {
- %b2 = block {
+ $B2: {
%5:i32 = spirv.atomic_compare_exchange %1, 2u, 0u, 0u, %val, %cmp
%6:bool = eq %5, %cmp
%7:__atomic_compare_exchange_result_i32 = construct %5, %6
@@ -458,12 +458,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicExchange %1, %arg1
ret %4
}
@@ -472,12 +472,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_exchange %1, 2u, 0u, %arg1
ret %4
}
@@ -500,12 +500,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = atomicLoad %1
ret %3
}
@@ -514,12 +514,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = spirv.atomic_load %1, 2u, 0u
ret %3
}
@@ -544,12 +544,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicMax %1, %arg1
ret %4
}
@@ -558,12 +558,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_smax %1, 2u, 0u, %arg1
ret %4
}
@@ -588,12 +588,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<u32>, read_write> = var
}
%foo = func(%arg1:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = atomicMax %1, %arg1
ret %4
}
@@ -602,12 +602,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<u32>, read_write> = var
}
%foo = func(%arg1:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = spirv.atomic_umax %1, 2u, 0u, %arg1
ret %4
}
@@ -632,12 +632,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicMin %1, %arg1
ret %4
}
@@ -646,12 +646,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_smin %1, 2u, 0u, %arg1
ret %4
}
@@ -676,12 +676,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<u32>, read_write> = var
}
%foo = func(%arg1:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = atomicMin %1, %arg1
ret %4
}
@@ -690,12 +690,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<u32>, read_write> = var
}
%foo = func(%arg1:u32):u32 {
- %b2 = block {
+ $B2: {
%4:u32 = spirv.atomic_umin %1, 2u, 0u, %arg1
ret %4
}
@@ -720,12 +720,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicOr %1, %arg1
ret %4
}
@@ -734,12 +734,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_or %1, 2u, 0u, %arg1
ret %4
}
@@ -764,12 +764,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):void {
- %b2 = block {
+ $B2: {
%4:void = atomicStore %1, %arg1
ret
}
@@ -778,12 +778,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):void {
- %b2 = block {
+ $B2: {
%4:void = spirv.atomic_store %1, 2u, 0u, %arg1
ret
}
@@ -808,12 +808,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicSub %1, %arg1
ret %4
}
@@ -822,12 +822,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_isub %1, 2u, 0u, %arg1
ret %4
}
@@ -852,12 +852,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = atomicXor %1, %arg1
ret %4
}
@@ -866,12 +866,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<workgroup, atomic<i32>, read_write> = var
}
%foo = func(%arg1:i32):i32 {
- %b2 = block {
+ $B2: {
%4:i32 = spirv.atomic_xor %1, 2u, 0u, %arg1
ret %4
}
@@ -896,7 +896,7 @@
auto* src = R"(
%foo = func(%arg1:vec4<f32>, %arg2:vec4<f32>):f32 {
- %b1 = block {
+ $B1: {
%4:f32 = dot %arg1, %arg2
ret %4
}
@@ -906,7 +906,7 @@
auto* expect = R"(
%foo = func(%arg1:vec4<f32>, %arg2:vec4<f32>):f32 {
- %b1 = block {
+ $B1: {
%4:f32 = spirv.dot %arg1, %arg2
ret %4
}
@@ -931,7 +931,7 @@
auto* src = R"(
%foo = func(%arg1:vec2<i32>, %arg2:vec2<i32>):i32 {
- %b1 = block {
+ $B1: {
%4:i32 = dot %arg1, %arg2
ret %4
}
@@ -941,7 +941,7 @@
auto* expect = R"(
%foo = func(%arg1:vec2<i32>, %arg2:vec2<i32>):i32 {
- %b1 = block {
+ $B1: {
%4:i32 = access %arg1, 0u
%5:i32 = access %arg2, 0u
%6:i32 = mul %4, %5
@@ -972,7 +972,7 @@
auto* src = R"(
%foo = func(%arg1:vec4<u32>, %arg2:vec4<u32>):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = dot %arg1, %arg2
ret %4
}
@@ -982,7 +982,7 @@
auto* expect = R"(
%foo = func(%arg1:vec4<u32>, %arg2:vec4<u32>):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = access %arg1, 0u
%5:u32 = access %arg2, 0u
%6:u32 = mul %4, %5
@@ -1021,7 +1021,7 @@
auto* src = R"(
%foo = func(%arg1:u32, %arg2:u32):i32 {
- %b1 = block {
+ $B1: {
%4:i32 = dot4I8Packed %arg1, %arg2
ret %4
}
@@ -1031,7 +1031,7 @@
auto* expect = R"(
%foo = func(%arg1:u32, %arg2:u32):i32 {
- %b1 = block {
+ $B1: {
%4:i32 = spirv.sdot %arg1, %arg2, 0u
ret %4
}
@@ -1056,7 +1056,7 @@
auto* src = R"(
%foo = func(%arg1:u32, %arg2:u32):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = dot4U8Packed %arg1, %arg2
ret %4
}
@@ -1066,7 +1066,7 @@
auto* expect = R"(
%foo = func(%arg1:u32, %arg2:u32):u32 {
- %b1 = block {
+ $B1: {
%4:u32 = spirv.udot %arg1, %arg2, 0u
ret %4
}
@@ -1092,7 +1092,7 @@
auto* src = R"(
%foo = func(%argf:i32, %argt:i32, %cond:bool):i32 {
- %b1 = block {
+ $B1: {
%5:i32 = select %argf, %argt, %cond
ret %5
}
@@ -1102,7 +1102,7 @@
auto* expect = R"(
%foo = func(%argf:i32, %argt:i32, %cond:bool):i32 {
- %b1 = block {
+ $B1: {
%5:i32 = spirv.select %cond, %argt, %argf
ret %5
}
@@ -1128,7 +1128,7 @@
auto* src = R"(
%foo = func(%argf:vec4<i32>, %argt:vec4<i32>, %cond:vec4<bool>):vec4<i32> {
- %b1 = block {
+ $B1: {
%5:vec4<i32> = select %argf, %argt, %cond
ret %5
}
@@ -1138,7 +1138,7 @@
auto* expect = R"(
%foo = func(%argf:vec4<i32>, %argt:vec4<i32>, %cond:vec4<bool>):vec4<i32> {
- %b1 = block {
+ $B1: {
%5:vec4<i32> = spirv.select %cond, %argt, %argf
ret %5
}
@@ -1164,7 +1164,7 @@
auto* src = R"(
%foo = func(%argf:vec4<i32>, %argt:vec4<i32>, %cond:bool):vec4<i32> {
- %b1 = block {
+ $B1: {
%5:vec4<i32> = select %argf, %argt, %cond
ret %5
}
@@ -1174,7 +1174,7 @@
auto* expect = R"(
%foo = func(%argf:vec4<i32>, %argt:vec4<i32>, %cond:bool):vec4<i32> {
- %b1 = block {
+ $B1: {
%5:vec4<bool> = construct %cond, %cond, %cond, %cond
%6:vec4<i32> = spirv.select %5, %argt, %argf
ret %6
@@ -1202,7 +1202,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %coords:vec2<i32>, %lod:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = textureLoad %t, %coords, %lod
ret %5
}
@@ -1212,7 +1212,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %coords:vec2<i32>, %lod:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = spirv.image_fetch %t, %coords, 2u, %lod
ret %5
}
@@ -1241,7 +1241,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>, %coords:vec2<i32>, %array_idx:i32, %lod:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureLoad %t, %coords, %array_idx, %lod
ret %6
}
@@ -1251,7 +1251,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>, %coords:vec2<i32>, %array_idx:i32, %lod:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec3<i32> = construct %coords, %array_idx
%7:vec4<f32> = spirv.image_fetch %t, %6, 2u, %lod
ret %7
@@ -1281,7 +1281,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>, %coords:vec2<i32>, %array_idx:u32, %lod:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureLoad %t, %coords, %array_idx, %lod
ret %6
}
@@ -1291,7 +1291,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>, %coords:vec2<i32>, %array_idx:u32, %lod:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:i32 = convert %array_idx
%7:vec3<i32> = construct %coords, %6
%8:vec4<f32> = spirv.image_fetch %t, %7, 2u, %lod
@@ -1320,7 +1320,7 @@
auto* src = R"(
%foo = func(%t:texture_multisampled_2d<f32>, %coords:vec2<i32>, %sample_idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = textureLoad %t, %coords, %sample_idx
ret %5
}
@@ -1330,7 +1330,7 @@
auto* expect = R"(
%foo = func(%t:texture_multisampled_2d<f32>, %coords:vec2<i32>, %sample_idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = spirv.image_fetch %t, %coords, 64u, %sample_idx
ret %5
}
@@ -1357,7 +1357,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %coords:vec2<i32>, %lod:i32):f32 {
- %b1 = block {
+ $B1: {
%5:f32 = textureLoad %t, %coords, %lod
ret %5
}
@@ -1367,7 +1367,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %coords:vec2<i32>, %lod:i32):f32 {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = spirv.image_fetch %t, %coords, 2u, %lod
%6:f32 = access %5, 0u
ret %6
@@ -1395,7 +1395,7 @@
auto* src = R"(
%foo = func(%t:texture_1d<f32>, %s:sampler, %coords:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = textureSample %t, %s, %coords
ret %5
}
@@ -1405,7 +1405,7 @@
auto* expect = R"(
%foo = func(%t:texture_1d<f32>, %s:sampler, %coords:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:spirv.sampled_image<texture_1d<f32>> = spirv.sampled_image %t, %s
%6:vec4<f32> = spirv.image_sample_implicit_lod %5, %coords, 0u
ret %6
@@ -1433,7 +1433,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = textureSample %t, %s, %coords
ret %5
}
@@ -1443,7 +1443,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%6:vec4<f32> = spirv.image_sample_implicit_lod %5, %coords, 0u
ret %6
@@ -1472,7 +1472,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = textureSample %t, %s, %coords, vec2<i32>(1i)
ret %5
}
@@ -1482,7 +1482,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%6:vec4<f32> = spirv.image_sample_implicit_lod %5, %coords, 8u, vec2<i32>(1i)
ret %6
@@ -1512,7 +1512,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureSample %t, %s, %coords, %array_idx, vec2<i32>(1i)
ret %6
}
@@ -1522,7 +1522,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_2d_array<f32>> = spirv.sampled_image %t, %s
%7:f32 = convert %array_idx
%8:vec3<f32> = construct %coords, %7
@@ -1554,7 +1554,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %bias:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureSampleBias %t, %s, %coords, %bias
ret %6
}
@@ -1564,7 +1564,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %bias:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_sample_implicit_lod %6, %coords, 1u, %bias
ret %7
@@ -1594,7 +1594,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %bias:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureSampleBias %t, %s, %coords, %bias, vec2<i32>(1i)
ret %6
}
@@ -1604,7 +1604,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %bias:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_sample_implicit_lod %6, %coords, 9u, %bias, vec2<i32>(1i)
ret %7
@@ -1635,7 +1635,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32, %bias:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:vec4<f32> = textureSampleBias %t, %s, %coords, %array_idx, %bias, vec2<i32>(1i)
ret %7
}
@@ -1645,7 +1645,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32, %bias:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_2d_array<f32>> = spirv.sampled_image %t, %s
%8:f32 = convert %array_idx
%9:vec3<f32> = construct %coords, %8
@@ -1676,7 +1676,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:f32 = textureSampleCompare %t, %s, %coords, %dref
ret %6
}
@@ -1686,7 +1686,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_depth_2d> = spirv.sampled_image %t, %s
%7:f32 = spirv.image_sample_dref_implicit_lod %6, %coords, %dref, 0u
ret %7
@@ -1716,7 +1716,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:f32 = textureSampleCompare %t, %s, %coords, %dref, vec2<i32>(1i)
ret %6
}
@@ -1726,7 +1726,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_depth_2d> = spirv.sampled_image %t, %s
%7:f32 = spirv.image_sample_dref_implicit_lod %6, %coords, %dref, 8u, vec2<i32>(1i)
ret %7
@@ -1757,7 +1757,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d_array, %s:sampler_comparison, %coords:vec2<f32>, %array_idx:i32, %bias:f32):f32 {
- %b1 = block {
+ $B1: {
%7:f32 = textureSampleCompare %t, %s, %coords, %array_idx, %bias, vec2<i32>(1i)
ret %7
}
@@ -1767,7 +1767,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d_array, %s:sampler_comparison, %coords:vec2<f32>, %array_idx:i32, %bias:f32):f32 {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_depth_2d_array> = spirv.sampled_image %t, %s
%8:f32 = convert %array_idx
%9:vec3<f32> = construct %coords, %8
@@ -1799,7 +1799,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:f32 = textureSampleCompareLevel %t, %s, %coords, %dref
ret %6
}
@@ -1809,7 +1809,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_depth_2d> = spirv.sampled_image %t, %s
%7:f32 = spirv.image_sample_dref_explicit_lod %6, %coords, %dref, 2u, 0.0f
ret %7
@@ -1839,7 +1839,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:f32 = textureSampleCompareLevel %t, %s, %coords, %dref, vec2<i32>(1i)
ret %6
}
@@ -1849,7 +1849,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %dref:f32):f32 {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_depth_2d> = spirv.sampled_image %t, %s
%7:f32 = spirv.image_sample_dref_explicit_lod %6, %coords, %dref, 10u, 0.0f, vec2<i32>(1i)
ret %7
@@ -1880,7 +1880,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d_array, %s:sampler_comparison, %coords:vec2<f32>, %array_idx:i32, %bias:f32):f32 {
- %b1 = block {
+ $B1: {
%7:f32 = textureSampleCompareLevel %t, %s, %coords, %array_idx, %bias, vec2<i32>(1i)
ret %7
}
@@ -1890,7 +1890,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d_array, %s:sampler_comparison, %coords:vec2<f32>, %array_idx:i32, %bias:f32):f32 {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_depth_2d_array> = spirv.sampled_image %t, %s
%8:f32 = convert %array_idx
%9:vec3<f32> = construct %coords, %8
@@ -1923,7 +1923,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %ddx:vec2<f32>, %ddy:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:vec4<f32> = textureSampleGrad %t, %s, %coords, %ddx, %ddy
ret %7
}
@@ -1933,7 +1933,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %ddx:vec2<f32>, %ddy:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%8:vec4<f32> = spirv.image_sample_explicit_lod %7, %coords, 4u, %ddx, %ddy
ret %8
@@ -1964,7 +1964,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %ddx:vec2<f32>, %ddy:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:vec4<f32> = textureSampleGrad %t, %s, %coords, %ddx, %ddy, vec2<i32>(1i)
ret %7
}
@@ -1974,7 +1974,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %ddx:vec2<f32>, %ddy:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%8:vec4<f32> = spirv.image_sample_explicit_lod %7, %coords, 12u, %ddx, %ddy, vec2<i32>(1i)
ret %8
@@ -2006,7 +2006,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32, %ddx:vec2<f32>, %ddy:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%8:vec4<f32> = textureSampleGrad %t, %s, %coords, %array_idx, %ddx, %ddy, vec2<i32>(1i)
ret %8
}
@@ -2016,7 +2016,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32, %ddx:vec2<f32>, %ddy:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%8:spirv.sampled_image<texture_2d_array<f32>> = spirv.sampled_image %t, %s
%9:f32 = convert %array_idx
%10:vec3<f32> = construct %coords, %9
@@ -2048,7 +2048,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %lod:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureSampleLevel %t, %s, %coords, %lod
ret %6
}
@@ -2058,7 +2058,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %lod:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_sample_explicit_lod %6, %coords, 2u, %lod
ret %7
@@ -2088,7 +2088,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %lod:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureSampleLevel %t, %s, %coords, %lod, vec2<i32>(1i)
ret %6
}
@@ -2098,7 +2098,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>, %lod:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_sample_explicit_lod %6, %coords, 10u, %lod, vec2<i32>(1i)
ret %7
@@ -2129,7 +2129,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32, %lod:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:vec4<f32> = textureSampleLevel %t, %s, %coords, %array_idx, %lod, vec2<i32>(1i)
ret %7
}
@@ -2139,7 +2139,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %coords:vec2<f32>, %array_idx:i32, %lod:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_2d_array<f32>> = spirv.sampled_image %t, %s
%8:f32 = convert %array_idx
%9:vec3<f32> = construct %coords, %8
@@ -2171,7 +2171,7 @@
auto* src = R"(
%foo = func(%component:i32, %t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureGather %component, %t, %s, %coords
ret %6
}
@@ -2181,7 +2181,7 @@
auto* expect = R"(
%foo = func(%component:i32, %t:texture_2d<f32>, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_gather %6, %coords, %component, 0u
ret %7
@@ -2211,7 +2211,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %component:i32, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureGather %component, %t, %s, %coords, vec2<i32>(1i)
ret %6
}
@@ -2221,7 +2221,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %s:sampler, %component:i32, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_2d<f32>> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_gather %6, %coords, %component, 8u, vec2<i32>(1i)
ret %7
@@ -2252,7 +2252,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %component:i32, %coords:vec2<f32>, %array_idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:vec4<f32> = textureGather %component, %t, %s, %coords, %array_idx, vec2<i32>(1i)
ret %7
}
@@ -2262,7 +2262,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>, %s:sampler, %component:i32, %coords:vec2<f32>, %array_idx:i32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_2d_array<f32>> = spirv.sampled_image %t, %s
%8:f32 = convert %array_idx
%9:vec3<f32> = construct %coords, %8
@@ -2292,7 +2292,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = textureGather %t, %s, %coords
ret %5
}
@@ -2302,7 +2302,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %s:sampler, %coords:vec2<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:spirv.sampled_image<texture_depth_2d> = spirv.sampled_image %t, %s
%6:vec4<f32> = spirv.image_gather %5, %coords, 0u, 0u
ret %6
@@ -2332,7 +2332,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %depth:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureGatherCompare %t, %s, %coords, %depth
ret %6
}
@@ -2342,7 +2342,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %depth:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_depth_2d> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_dref_gather %6, %coords, %depth, 0u
ret %7
@@ -2372,7 +2372,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %depth:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:vec4<f32> = textureGatherCompare %t, %s, %coords, %depth, vec2<i32>(1i)
ret %6
}
@@ -2382,7 +2382,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d, %s:sampler_comparison, %coords:vec2<f32>, %depth:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%6:spirv.sampled_image<texture_depth_2d> = spirv.sampled_image %t, %s
%7:vec4<f32> = spirv.image_dref_gather %6, %coords, %depth, 8u, vec2<i32>(1i)
ret %7
@@ -2413,7 +2413,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d_array, %s:sampler_comparison, %coords:vec2<f32>, %array_idx:u32, %depth:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:vec4<f32> = textureGatherCompare %t, %s, %coords, %array_idx, %depth
ret %7
}
@@ -2423,7 +2423,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d_array, %s:sampler_comparison, %coords:vec2<f32>, %array_idx:u32, %depth:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%7:spirv.sampled_image<texture_depth_2d_array> = spirv.sampled_image %t, %s
%8:f32 = convert %array_idx
%9:vec3<f32> = construct %coords, %8
@@ -2456,7 +2456,7 @@
auto* src = R"(
%foo = func(%t:texture_storage_2d<r32uint, write>, %coords:vec2<i32>, %texel:vec4<u32>):void {
- %b1 = block {
+ $B1: {
%5:void = textureStore %t, %coords, %texel
ret
}
@@ -2466,7 +2466,7 @@
auto* expect = R"(
%foo = func(%t:texture_storage_2d<r32uint, write>, %coords:vec2<i32>, %texel:vec4<u32>):void {
- %b1 = block {
+ $B1: {
%5:void = spirv.image_write %t, %coords, %texel, 0u
ret
}
@@ -2497,7 +2497,7 @@
auto* src = R"(
%foo = func(%t:texture_storage_2d_array<rgba8sint, write>, %coords:vec2<i32>, %array_idx:i32, %texel:vec4<i32>):void {
- %b1 = block {
+ $B1: {
%6:void = textureStore %t, %coords, %array_idx, %texel
ret
}
@@ -2507,7 +2507,7 @@
auto* expect = R"(
%foo = func(%t:texture_storage_2d_array<rgba8sint, write>, %coords:vec2<i32>, %array_idx:i32, %texel:vec4<i32>):void {
- %b1 = block {
+ $B1: {
%6:vec3<i32> = construct %coords, %array_idx
%7:void = spirv.image_write %t, %6, %texel, 0u
ret
@@ -2539,7 +2539,7 @@
auto* src = R"(
%foo = func(%t:texture_storage_2d_array<rgba32uint, write>, %coords:vec2<i32>, %array_idx:u32, %texel:vec4<u32>):void {
- %b1 = block {
+ $B1: {
%6:void = textureStore %t, %coords, %array_idx, %texel
ret
}
@@ -2549,7 +2549,7 @@
auto* expect = R"(
%foo = func(%t:texture_storage_2d_array<rgba32uint, write>, %coords:vec2<i32>, %array_idx:u32, %texel:vec4<u32>):void {
- %b1 = block {
+ $B1: {
%6:i32 = convert %array_idx
%7:vec3<i32> = construct %coords, %6
%8:void = spirv.image_write %t, %7, %texel, 0u
@@ -2576,7 +2576,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = textureDimensions %t
ret %3
}
@@ -2586,7 +2586,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = spirv.image_query_size_lod %t, 0u
ret %3
}
@@ -2612,7 +2612,7 @@
auto* src = R"(
%foo = func(%t:texture_2d<f32>, %lod:i32):vec2<u32> {
- %b1 = block {
+ $B1: {
%4:vec2<u32> = textureDimensions %t, %lod
ret %4
}
@@ -2622,7 +2622,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d<f32>, %lod:i32):vec2<u32> {
- %b1 = block {
+ $B1: {
%4:vec2<u32> = spirv.image_query_size_lod %t, %lod
ret %4
}
@@ -2647,7 +2647,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = textureDimensions %t
ret %3
}
@@ -2657,7 +2657,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = spirv.image_query_size_lod %t, 0u
%4:vec2<u32> = swizzle %3, xy
ret %4
@@ -2683,7 +2683,7 @@
auto* src = R"(
%foo = func(%t:texture_multisampled_2d<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = textureDimensions %t
ret %3
}
@@ -2693,7 +2693,7 @@
auto* expect = R"(
%foo = func(%t:texture_multisampled_2d<f32>):vec2<u32> {
- %b1 = block {
+ $B1: {
%3:vec2<u32> = spirv.image_query_size %t
ret %3
}
@@ -2718,7 +2718,7 @@
auto* src = R"(
%foo = func(%t:texture_2d_array<f32>):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = textureNumLayers %t
ret %3
}
@@ -2728,7 +2728,7 @@
auto* expect = R"(
%foo = func(%t:texture_2d_array<f32>):u32 {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = spirv.image_query_size_lod %t, 0u
%4:u32 = access %3, 2u
ret %4
@@ -2754,7 +2754,7 @@
auto* src = R"(
%foo = func(%t:texture_cube_array<f32>):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = textureNumLayers %t
ret %3
}
@@ -2764,7 +2764,7 @@
auto* expect = R"(
%foo = func(%t:texture_cube_array<f32>):u32 {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = spirv.image_query_size_lod %t, 0u
%4:u32 = access %3, 2u
ret %4
@@ -2790,7 +2790,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_2d_array):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = textureNumLayers %t
ret %3
}
@@ -2800,7 +2800,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_2d_array):u32 {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = spirv.image_query_size_lod %t, 0u
%4:u32 = access %3, 2u
ret %4
@@ -2826,7 +2826,7 @@
auto* src = R"(
%foo = func(%t:texture_depth_cube_array):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = textureNumLayers %t
ret %3
}
@@ -2836,7 +2836,7 @@
auto* expect = R"(
%foo = func(%t:texture_depth_cube_array):u32 {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = spirv.image_query_size_lod %t, 0u
%4:u32 = access %3, 2u
ret %4
@@ -2865,7 +2865,7 @@
auto* src = R"(
%foo = func(%t:texture_storage_2d_array<r32float, write>):u32 {
- %b1 = block {
+ $B1: {
%3:u32 = textureNumLayers %t
ret %3
}
@@ -2875,7 +2875,7 @@
auto* expect = R"(
%foo = func(%t:texture_storage_2d_array<r32float, write>):u32 {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = spirv.image_query_size %t
%4:u32 = access %3, 2u
ret %4
@@ -2900,7 +2900,7 @@
auto* src = R"(
%foo = func(%arg:f32):f32 {
- %b1 = block {
+ $B1: {
%3:f32 = quantizeToF16 %arg
ret %3
}
@@ -2927,7 +2927,7 @@
auto* src = R"(
%foo = func(%arg:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%3:vec4<f32> = quantizeToF16 %arg
ret %3
}
@@ -2937,7 +2937,7 @@
auto* expect = R"(
%foo = func(%arg:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%3:f32 = access %arg, 0u
%4:f32 = quantizeToF16 %3
%5:f32 = access %arg, 1u
diff --git a/src/tint/lang/spirv/writer/raise/expand_implicit_splats_test.cc b/src/tint/lang/spirv/writer/raise/expand_implicit_splats_test.cc
index 4d7b38f..3e9bb3d 100644
--- a/src/tint/lang/spirv/writer/raise/expand_implicit_splats_test.cc
+++ b/src/tint/lang/spirv/writer/raise/expand_implicit_splats_test.cc
@@ -51,7 +51,7 @@
auto* expect = R"(
%foo = func(%vector:vec2<i32>):vec2<i32> {
- %b1 = block {
+ $B1: {
%3:vec2<i32> = construct %vector
ret %3
}
@@ -76,7 +76,7 @@
auto* expect = R"(
%foo = func(%scalar:i32, %vector:vec2<i32>):vec3<i32> {
- %b1 = block {
+ $B1: {
%4:vec3<i32> = construct %scalar, %vector
ret %4
}
@@ -100,7 +100,7 @@
auto* expect = R"(
%foo = func(%scalar:i32):vec3<i32> {
- %b1 = block {
+ $B1: {
%3:vec3<i32> = construct %scalar, %scalar, %scalar
ret %3
}
@@ -124,7 +124,7 @@
auto* src = R"(
%foo = func(%scalar:i32):vec2<i32> {
- %b1 = block {
+ $B1: {
%3:vec2<i32> = construct %scalar
ret %3
}
@@ -134,7 +134,7 @@
auto* expect = R"(
%foo = func(%scalar:i32):vec2<i32> {
- %b1 = block {
+ $B1: {
%3:vec2<i32> = construct %scalar, %scalar
ret %3
}
@@ -158,7 +158,7 @@
auto* src = R"(
%foo = func(%scalar:u32):vec3<u32> {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = construct %scalar
ret %3
}
@@ -168,7 +168,7 @@
auto* expect = R"(
%foo = func(%scalar:u32):vec3<u32> {
- %b1 = block {
+ $B1: {
%3:vec3<u32> = construct %scalar, %scalar, %scalar
ret %3
}
@@ -192,7 +192,7 @@
auto* src = R"(
%foo = func(%scalar:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%3:vec4<f32> = construct %scalar
ret %3
}
@@ -202,7 +202,7 @@
auto* expect = R"(
%foo = func(%scalar:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%3:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
ret %3
}
@@ -227,7 +227,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = add %vector, %scalar
ret %4
}
@@ -237,7 +237,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = add %vector, %4
ret %5
@@ -263,7 +263,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = add %scalar, %vector
ret %4
}
@@ -273,7 +273,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = add %4, %vector
ret %5
@@ -299,7 +299,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = sub %vector, %scalar
ret %4
}
@@ -309,7 +309,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = sub %vector, %4
ret %5
@@ -335,7 +335,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = sub %scalar, %vector
ret %4
}
@@ -345,7 +345,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = sub %4, %vector
ret %5
@@ -371,7 +371,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = div %vector, %scalar
ret %4
}
@@ -381,7 +381,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = div %vector, %4
ret %5
@@ -407,7 +407,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = div %scalar, %vector
ret %4
}
@@ -417,7 +417,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = div %4, %vector
ret %5
@@ -443,7 +443,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = mod %vector, %scalar
ret %4
}
@@ -453,7 +453,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = mod %vector, %4
ret %5
@@ -479,7 +479,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = mod %scalar, %vector
ret %4
}
@@ -489,7 +489,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<f32> = mod %4, %vector
ret %5
@@ -515,7 +515,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = mul %vector, %scalar
ret %4
}
@@ -525,7 +525,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = spirv.vector_times_scalar %vector, %scalar
ret %4
}
@@ -550,7 +550,7 @@
auto* src = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = mul %scalar, %vector
ret %4
}
@@ -560,7 +560,7 @@
auto* expect = R"(
%foo = func(%scalar:f32, %vector:vec4<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = spirv.vector_times_scalar %vector, %scalar
ret %4
}
@@ -585,7 +585,7 @@
auto* src = R"(
%foo = func(%scalar:i32, %vector:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = mul %vector, %scalar
ret %4
}
@@ -595,7 +595,7 @@
auto* expect = R"(
%foo = func(%scalar:i32, %vector:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<i32> = mul %vector, %4
ret %5
@@ -621,7 +621,7 @@
auto* src = R"(
%foo = func(%scalar:i32, %vector:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = mul %scalar, %vector
ret %4
}
@@ -631,7 +631,7 @@
auto* expect = R"(
%foo = func(%scalar:i32, %vector:vec4<i32>):vec4<i32> {
- %b1 = block {
+ $B1: {
%4:vec4<i32> = construct %scalar, %scalar, %scalar, %scalar
%5:vec4<i32> = mul %4, %vector
ret %5
@@ -658,7 +658,7 @@
auto* src = R"(
%foo = func(%arg1:vec4<f32>, %arg2:vec4<f32>, %factor:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = mix %arg1, %arg2, %factor
ret %5
}
@@ -668,7 +668,7 @@
auto* expect = R"(
%foo = func(%arg1:vec4<f32>, %arg2:vec4<f32>, %factor:f32):vec4<f32> {
- %b1 = block {
+ $B1: {
%5:vec4<f32> = construct %factor, %factor, %factor, %factor
%6:vec4<f32> = mix %arg1, %arg2, %5
ret %6
diff --git a/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic_test.cc b/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic_test.cc
index 3aa4bc4..835a4e1 100644
--- a/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic_test.cc
+++ b/src/tint/lang/spirv/writer/raise/handle_matrix_arithmetic_test.cc
@@ -53,7 +53,7 @@
auto* src = R"(
%foo = func(%arg1:mat2x3<f32>, %arg2:mat2x3<f32>):mat2x3<f32> {
- %b1 = block {
+ $B1: {
%4:mat2x3<f32> = add %arg1, %arg2
ret %4
}
@@ -63,7 +63,7 @@
auto* expect = R"(
%foo = func(%arg1:mat2x3<f32>, %arg2:mat2x3<f32>):mat2x3<f32> {
- %b1 = block {
+ $B1: {
%4:vec3<f32> = access %arg1, 0u
%5:vec3<f32> = access %arg2, 0u
%6:vec3<f32> = add %4, %5
@@ -94,7 +94,7 @@
auto* src = R"(
%foo = func(%arg1:mat4x2<f16>, %arg2:mat4x2<f16>):mat4x2<f16> {
- %b1 = block {
+ $B1: {
%4:mat4x2<f16> = add %arg1, %arg2
ret %4
}
@@ -104,7 +104,7 @@
auto* expect = R"(
%foo = func(%arg1:mat4x2<f16>, %arg2:mat4x2<f16>):mat4x2<f16> {
- %b1 = block {
+ $B1: {
%4:vec2<f16> = access %arg1, 0u
%5:vec2<f16> = access %arg2, 0u
%6:vec2<f16> = add %4, %5
@@ -141,7 +141,7 @@
auto* src = R"(
%foo = func(%arg1:mat3x2<f32>, %arg2:mat3x2<f32>):mat3x2<f32> {
- %b1 = block {
+ $B1: {
%4:mat3x2<f32> = sub %arg1, %arg2
ret %4
}
@@ -151,7 +151,7 @@
auto* expect = R"(
%foo = func(%arg1:mat3x2<f32>, %arg2:mat3x2<f32>):mat3x2<f32> {
- %b1 = block {
+ $B1: {
%4:vec2<f32> = access %arg1, 0u
%5:vec2<f32> = access %arg2, 0u
%6:vec2<f32> = sub %4, %5
@@ -185,7 +185,7 @@
auto* src = R"(
%foo = func(%arg1:mat2x4<f16>, %arg2:mat2x4<f16>):mat2x4<f16> {
- %b1 = block {
+ $B1: {
%4:mat2x4<f16> = sub %arg1, %arg2
ret %4
}
@@ -195,7 +195,7 @@
auto* expect = R"(
%foo = func(%arg1:mat2x4<f16>, %arg2:mat2x4<f16>):mat2x4<f16> {
- %b1 = block {
+ $B1: {
%4:vec4<f16> = access %arg1, 0u
%5:vec4<f16> = access %arg2, 0u
%6:vec4<f16> = sub %4, %5
@@ -226,7 +226,7 @@
auto* src = R"(
%foo = func(%arg1:mat2x3<f32>, %arg2:f32):mat2x3<f32> {
- %b1 = block {
+ $B1: {
%4:mat2x3<f32> = mul %arg1, %arg2
ret %4
}
@@ -236,7 +236,7 @@
auto* expect = R"(
%foo = func(%arg1:mat2x3<f32>, %arg2:f32):mat2x3<f32> {
- %b1 = block {
+ $B1: {
%4:mat2x3<f32> = spirv.matrix_times_scalar %arg1, %arg2
ret %4
}
@@ -261,7 +261,7 @@
auto* src = R"(
%foo = func(%arg1:mat3x4<f32>, %arg2:vec3<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = mul %arg1, %arg2
ret %4
}
@@ -271,7 +271,7 @@
auto* expect = R"(
%foo = func(%arg1:mat3x4<f32>, %arg2:vec3<f32>):vec4<f32> {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = spirv.matrix_times_vector %arg1, %arg2
ret %4
}
@@ -296,7 +296,7 @@
auto* src = R"(
%foo = func(%arg1:mat4x2<f32>, %arg2:mat2x4<f32>):mat2x2<f32> {
- %b1 = block {
+ $B1: {
%4:mat2x2<f32> = mul %arg1, %arg2
ret %4
}
@@ -306,7 +306,7 @@
auto* expect = R"(
%foo = func(%arg1:mat4x2<f32>, %arg2:mat2x4<f32>):mat2x2<f32> {
- %b1 = block {
+ $B1: {
%4:mat2x2<f32> = spirv.matrix_times_matrix %arg1, %arg2
ret %4
}
@@ -331,7 +331,7 @@
auto* src = R"(
%foo = func(%arg1:f16, %arg2:mat3x2<f16>):mat3x2<f16> {
- %b1 = block {
+ $B1: {
%4:mat3x2<f16> = mul %arg1, %arg2
ret %4
}
@@ -341,7 +341,7 @@
auto* expect = R"(
%foo = func(%arg1:f16, %arg2:mat3x2<f16>):mat3x2<f16> {
- %b1 = block {
+ $B1: {
%4:mat3x2<f16> = spirv.matrix_times_scalar %arg2, %arg1
ret %4
}
@@ -366,7 +366,7 @@
auto* src = R"(
%foo = func(%arg1:vec3<f16>, %arg2:mat4x3<f16>):vec4<f16> {
- %b1 = block {
+ $B1: {
%4:vec4<f16> = mul %arg1, %arg2
ret %4
}
@@ -376,7 +376,7 @@
auto* expect = R"(
%foo = func(%arg1:vec3<f16>, %arg2:mat4x3<f16>):vec4<f16> {
- %b1 = block {
+ $B1: {
%4:vec4<f16> = spirv.vector_times_matrix %arg1, %arg2
ret %4
}
@@ -401,7 +401,7 @@
auto* src = R"(
%foo = func(%arg1:mat3x3<f16>, %arg2:mat3x3<f16>):mat3x3<f16> {
- %b1 = block {
+ $B1: {
%4:mat3x3<f16> = mul %arg1, %arg2
ret %4
}
@@ -411,7 +411,7 @@
auto* expect = R"(
%foo = func(%arg1:mat3x3<f16>, %arg2:mat3x3<f16>):mat3x3<f16> {
- %b1 = block {
+ $B1: {
%4:mat3x3<f16> = spirv.matrix_times_matrix %arg1, %arg2
ret %4
}
@@ -435,7 +435,7 @@
auto* src = R"(
%foo = func(%arg:mat2x3<f32>):mat2x3<f16> {
- %b1 = block {
+ $B1: {
%3:mat2x3<f16> = convert %arg
ret %3
}
@@ -445,7 +445,7 @@
auto* expect = R"(
%foo = func(%arg:mat2x3<f32>):mat2x3<f16> {
- %b1 = block {
+ $B1: {
%3:vec3<f32> = access %arg, 0u
%4:vec3<f16> = convert %3
%5:vec3<f32> = access %arg, 1u
@@ -473,7 +473,7 @@
auto* src = R"(
%foo = func(%arg:mat4x4<f32>):mat4x4<f16> {
- %b1 = block {
+ $B1: {
%3:mat4x4<f16> = convert %arg
ret %3
}
@@ -483,7 +483,7 @@
auto* expect = R"(
%foo = func(%arg:mat4x4<f32>):mat4x4<f16> {
- %b1 = block {
+ $B1: {
%3:vec4<f32> = access %arg, 0u
%4:vec4<f16> = convert %3
%5:vec4<f32> = access %arg, 1u
@@ -515,7 +515,7 @@
auto* src = R"(
%foo = func(%arg:mat4x3<f16>):mat4x3<f32> {
- %b1 = block {
+ $B1: {
%3:mat4x3<f32> = convert %arg
ret %3
}
@@ -525,7 +525,7 @@
auto* expect = R"(
%foo = func(%arg:mat4x3<f16>):mat4x3<f32> {
- %b1 = block {
+ $B1: {
%3:vec3<f16> = access %arg, 0u
%4:vec3<f32> = convert %3
%5:vec3<f16> = access %arg, 1u
@@ -557,7 +557,7 @@
auto* src = R"(
%foo = func(%arg:mat2x2<f32>):mat2x2<f16> {
- %b1 = block {
+ $B1: {
%3:mat2x2<f16> = convert %arg
ret %3
}
@@ -567,7 +567,7 @@
auto* expect = R"(
%foo = func(%arg:mat2x2<f32>):mat2x2<f16> {
- %b1 = block {
+ $B1: {
%3:vec2<f32> = access %arg, 0u
%4:vec2<f16> = convert %3
%5:vec2<f32> = access %arg, 1u
diff --git a/src/tint/lang/spirv/writer/raise/merge_return_test.cc b/src/tint/lang/spirv/writer/raise/merge_return_test.cc
index 662726e..017f5e4 100644
--- a/src/tint/lang/spirv/writer/raise/merge_return_test.cc
+++ b/src/tint/lang/spirv/writer/raise/merge_return_test.cc
@@ -48,7 +48,7 @@
auto* src = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = add %2, 1i
ret %3
}
@@ -79,13 +79,13 @@
});
auto* src = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
- %3:i32 = if %4 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ %3:i32 = if %4 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
%5:i32 = add %2, 1i
exit_if %5 # if_1
}
- %b3 = block { # false
+ $B3: { # false
%6:i32 = add %2, 2i
exit_if %6 # if_1
}
@@ -126,23 +126,23 @@
auto* src = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
- switch %2 [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch %2 [c: (default, $B2)] { # switch_1
+ $B2: { # case
exit_switch # switch_1
}
}
- loop [b: %b3] { # loop_1
- %b3 = block { # body
+ loop [b: $B3] { # loop_1
+ $B3: { # body
exit_loop # loop_1
}
}
- %3:i32 = if %4 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ %3:i32 = if %4 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
%5:i32 = add %2, 1i
exit_if %5 # if_1
}
- %b5 = block { # false
+ $B5: { # false
%6:i32 = add %2, 2i
exit_if %6 # if_1
}
@@ -175,12 +175,12 @@
auto* src = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
@@ -192,12 +192,12 @@
auto* expect = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
exit_if # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
@@ -228,12 +228,12 @@
auto* src = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
@@ -245,12 +245,12 @@
auto* expect = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
exit_if # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
@@ -279,12 +279,12 @@
auto* src = R"(
%foo = func(%2:bool):i32 {
- %b1 = block {
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret 1i
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
@@ -296,22 +296,22 @@
auto* expect = R"(
%foo = func(%2:bool):i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
store %continue_execution, false
store %return_value, 1i
exit_if # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- if %5 [t: %b4] { # if_2
- %b4 = block { # true
+ if %5 [t: $B4] { # if_2
+ $B4: { # true
store %return_value, 2i
exit_if # if_2
}
@@ -343,12 +343,12 @@
auto* src = R"(
%foo = func(%2:bool):i32 {
- %b1 = block {
- %3:i32 = if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ %3:i32 = if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret 1i
}
- %b3 = block { # false
+ $B3: { # false
exit_if 2i # if_1
}
}
@@ -360,22 +360,22 @@
auto* expect = R"(
%foo = func(%2:bool):i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- %5:i32 = if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ %5:i32 = if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
store %continue_execution, false
store %return_value, 1i
exit_if undef # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if 2i # if_1
}
}
%6:bool = load %continue_execution
- if %6 [t: %b4] { # if_2
- %b4 = block { # true
+ if %6 [t: $B4] { # if_2
+ $B4: { # true
store %return_value, %5
exit_if # if_2
}
@@ -408,12 +408,12 @@
auto* src = R"(
%foo = func(%2:bool):i32 {
- %b1 = block {
- %3:i32 = if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ %3:i32 = if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret 1i
}
- %b3 = block { # false
+ $B3: { # false
exit_if undef # if_1
}
}
@@ -425,22 +425,22 @@
auto* expect = R"(
%foo = func(%2:bool):i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- %5:i32 = if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ %5:i32 = if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
store %continue_execution, false
store %return_value, 1i
exit_if undef # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if undef # if_1
}
}
%6:bool = load %continue_execution
- if %6 [t: %b4] { # if_2
- %b4 = block { # true
+ if %6 [t: $B4] { # if_2
+ $B4: { # true
store %return_value, %5
exit_if # if_2
}
@@ -471,12 +471,12 @@
auto* src = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -489,12 +489,12 @@
auto* expect = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
exit_if # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
@@ -534,20 +534,20 @@
auto* src = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- %3:i32, %4:f32 = if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
- if %2 [t: %b4, f: %b5] { # if_2
- %b4 = block { # true
+ $B1: {
+ %3:i32, %4:f32 = if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
+ if %2 [t: $B4, f: $B5] { # if_2
+ $B4: { # true
ret
}
- %b5 = block { # false
+ $B5: { # false
ret
}
}
unreachable
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -560,20 +560,20 @@
auto* expect = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- %3:i32, %4:f32 = if %2 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
- if %2 [t: %b4, f: %b5] { # if_2
- %b4 = block { # true
+ $B1: {
+ %3:i32, %4:f32 = if %2 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
+ if %2 [t: $B4, f: $B5] { # if_2
+ $B4: { # true
exit_if # if_2
}
- %b5 = block { # false
+ $B5: { # false
exit_if # if_2
}
}
exit_if undef, undef # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if undef, undef # if_1
}
}
@@ -609,14 +609,14 @@
auto* src = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
- if %2 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
+ if %2 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
ret
}
- %b4 = block { # false
+ $B4: { # false
ret
}
}
@@ -632,14 +632,14 @@
auto* expect = R"(
%foo = func(%2:bool):void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
- if %2 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
+ if %2 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
exit_if # if_1
}
- %b4 = block { # false
+ $B4: { # false
exit_if # if_1
}
}
@@ -674,17 +674,17 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):void {
- %b2 = block {
- if %3 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %3 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
ret
}
- %b4 = block { # false
+ $B4: { # false
exit_if # if_1
}
}
@@ -697,25 +697,25 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):void {
- %b2 = block {
+ $B2: {
%continue_execution:ptr<function, bool, read_write> = var, true
- if %3 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ if %3 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
- %b4 = block { # false
+ $B4: { # false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- if %5 [t: %b5] { # if_2
- %b5 = block { # true
+ if %5 [t: $B5] { # if_2
+ $B5: { # true
store %1, 42i
exit_if # if_2
}
@@ -750,17 +750,17 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):void {
- %b2 = block {
- if %3 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %3 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
ret
}
- %b4 = block { # false
+ $B4: { # false
exit_if # if_1
}
}
@@ -773,25 +773,25 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):void {
- %b2 = block {
+ $B2: {
%continue_execution:ptr<function, bool, read_write> = var, true
- if %3 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ if %3 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
- %b4 = block { # false
+ $B4: { # false
exit_if # if_1
}
}
%5:bool = load %continue_execution
- if %5 [t: %b5] { # if_2
- %b5 = block { # true
+ if %5 [t: $B5] { # if_2
+ $B5: { # true
store %1, 42i
exit_if # if_2
}
@@ -838,31 +838,31 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%condA:bool, %condB:bool, %condC:bool):i32 {
- %b2 = block {
- if %condA [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %condA [t: $B3, f: $B4] { # if_1
+ $B3: { # true
ret 3i
}
- %b4 = block { # false
- if %condB [t: %b5, f: %b6] { # if_2
- %b5 = block { # true
- if %condC [t: %b7, f: %b8] { # if_3
- %b7 = block { # true
+ $B4: { # false
+ if %condB [t: $B5, f: $B6] { # if_2
+ $B5: { # true
+ if %condC [t: $B7, f: $B8] { # if_3
+ $B7: { # true
ret 1i
}
- %b8 = block { # false
+ $B8: { # false
exit_if # if_3
}
}
store %1, 1i
ret 2i
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_2
}
}
@@ -880,36 +880,36 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%condA:bool, %condB:bool, %condC:bool):i32 {
- %b2 = block {
+ $B2: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- if %condA [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ if %condA [t: $B3, f: $B4] { # if_1
+ $B3: { # true
store %continue_execution, false
store %return_value, 3i
exit_if # if_1
}
- %b4 = block { # false
- if %condB [t: %b5, f: %b6] { # if_2
- %b5 = block { # true
- if %condC [t: %b7, f: %b8] { # if_3
- %b7 = block { # true
+ $B4: { # false
+ if %condB [t: $B5, f: $B6] { # if_2
+ $B5: { # true
+ if %condC [t: $B7, f: $B8] { # if_3
+ $B7: { # true
store %continue_execution, false
store %return_value, 1i
exit_if # if_3
}
- %b8 = block { # false
+ $B8: { # false
exit_if # if_3
}
}
%8:bool = load %continue_execution
- if %8 [t: %b9] { # if_4
- %b9 = block { # true
+ if %8 [t: $B9] { # if_4
+ $B9: { # true
store %1, 1i
store %continue_execution, false
store %return_value, 2i
@@ -918,13 +918,13 @@
}
exit_if # if_2
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_2
}
}
%9:bool = load %continue_execution
- if %9 [t: %b10] { # if_5
- %b10 = block { # true
+ if %9 [t: $B10] { # if_5
+ $B10: { # true
store %1, 2i
exit_if # if_5
}
@@ -933,8 +933,8 @@
}
}
%10:bool = load %continue_execution
- if %10 [t: %b11] { # if_6
- %b11 = block { # true
+ if %10 [t: $B11] { # if_6
+ $B11: { # true
store %1, 3i
%11:i32 = add 5i, 6i
store %return_value, %11
@@ -981,30 +981,30 @@
b.Return(func, 3_i);
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%condA:bool, %condB:bool, %condC:bool):i32 {
- %b2 = block {
- if %condA [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %condA [t: $B3, f: $B4] { # if_1
+ $B3: { # true
ret 3i
}
- %b4 = block { # false
- if %condB [t: %b5, f: %b6] { # if_2
- %b5 = block { # true
- if %condC [t: %b7, f: %b8] { # if_3
- %b7 = block { # true
+ $B4: { # false
+ if %condB [t: $B5, f: $B6] { # if_2
+ $B5: { # true
+ if %condC [t: $B7, f: $B8] { # if_3
+ $B7: { # true
ret 1i
}
- %b8 = block { # false
+ $B8: { # false
exit_if # if_3
}
}
exit_if # if_2
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_2
}
}
@@ -1019,36 +1019,36 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%condA:bool, %condB:bool, %condC:bool):i32 {
- %b2 = block {
+ $B2: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- if %condA [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ if %condA [t: $B3, f: $B4] { # if_1
+ $B3: { # true
store %continue_execution, false
store %return_value, 3i
exit_if # if_1
}
- %b4 = block { # false
- if %condB [t: %b5, f: %b6] { # if_2
- %b5 = block { # true
- if %condC [t: %b7, f: %b8] { # if_3
- %b7 = block { # true
+ $B4: { # false
+ if %condB [t: $B5, f: $B6] { # if_2
+ $B5: { # true
+ if %condC [t: $B7, f: $B8] { # if_3
+ $B7: { # true
store %continue_execution, false
store %return_value, 1i
exit_if # if_3
}
- %b8 = block { # false
+ $B8: { # false
exit_if # if_3
}
}
exit_if # if_2
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_2
}
}
@@ -1056,8 +1056,8 @@
}
}
%8:bool = load %continue_execution
- if %8 [t: %b9] { # if_4
- %b9 = block { # true
+ if %8 [t: $B9] { # if_4
+ $B9: { # true
store %return_value, 3i
exit_if # if_4
}
@@ -1107,31 +1107,31 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%condA:bool, %condB:bool, %condC:bool):i32 {
- %b2 = block {
- %6:i32 = if %condA [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B2: {
+ %6:i32 = if %condA [t: $B3, f: $B4] { # if_1
+ $B3: { # true
ret 3i
}
- %b4 = block { # false
- %7:i32 = if %condB [t: %b5, f: %b6] { # if_2
- %b5 = block { # true
- if %condC [t: %b7, f: %b8] { # if_3
- %b7 = block { # true
+ $B4: { # false
+ %7:i32 = if %condB [t: $B5, f: $B6] { # if_2
+ $B5: { # true
+ if %condC [t: $B7, f: $B8] { # if_3
+ $B7: { # true
ret 1i
}
- %b8 = block { # false
+ $B8: { # false
exit_if # if_3
}
}
%8:i32 = add 42i, 1i
exit_if %8 # if_2
}
- %b6 = block { # false
+ $B6: { # false
%9:i32 = add 43i, 2i
exit_if %9 # if_2
}
@@ -1149,36 +1149,36 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%condA:bool, %condB:bool, %condC:bool):i32 {
- %b2 = block {
+ $B2: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- %8:i32 = if %condA [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ %8:i32 = if %condA [t: $B3, f: $B4] { # if_1
+ $B3: { # true
store %continue_execution, false
store %return_value, 3i
exit_if undef # if_1
}
- %b4 = block { # false
- %9:i32 = if %condB [t: %b5, f: %b6] { # if_2
- %b5 = block { # true
- if %condC [t: %b7, f: %b8] { # if_3
- %b7 = block { # true
+ $B4: { # false
+ %9:i32 = if %condB [t: $B5, f: $B6] { # if_2
+ $B5: { # true
+ if %condC [t: $B7, f: $B8] { # if_3
+ $B7: { # true
store %continue_execution, false
store %return_value, 1i
exit_if # if_3
}
- %b8 = block { # false
+ $B8: { # false
exit_if # if_3
}
}
%10:bool = load %continue_execution
- %11:i32 = if %10 [t: %b9] { # if_4
- %b9 = block { # true
+ %11:i32 = if %10 [t: $B9] { # if_4
+ $B9: { # true
%12:i32 = add 42i, 1i
exit_if %12 # if_4
}
@@ -1186,14 +1186,14 @@
}
exit_if %11 # if_2
}
- %b6 = block { # false
+ $B6: { # false
%13:i32 = add 43i, 2i
exit_if %13 # if_2
}
}
%14:bool = load %continue_execution
- %15:i32 = if %14 [t: %b10] { # if_5
- %b10 = block { # true
+ %15:i32 = if %14 [t: $B10] { # if_5
+ $B10: { # true
%16:i32 = add %9, 1i
exit_if %16 # if_5
}
@@ -1203,8 +1203,8 @@
}
}
%17:bool = load %continue_execution
- if %17 [t: %b11] { # if_6
- %b11 = block { # true
+ if %17 [t: $B11] { # if_6
+ $B11: { # true
%18:i32 = add %8, 1i
store %return_value, %18
exit_if # if_6
@@ -1244,22 +1244,22 @@
auto* src = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%3:bool = eq %2, 1i
- if %3 [t: %b2] { # if_1
- %b2 = block { # true
+ if %3 [t: $B2] { # if_1
+ $B2: { # true
ret 101i
}
}
%4:bool = eq %2, 2i
- if %4 [t: %b3] { # if_2
- %b3 = block { # true
+ if %4 [t: $B3] { # if_2
+ $B3: { # true
ret 202i
}
}
%5:bool = eq %2, 3i
- if %5 [t: %b4] { # if_3
- %b4 = block { # true
+ if %5 [t: $B4] { # if_3
+ $B4: { # true
ret 303i
}
}
@@ -1271,42 +1271,42 @@
auto* expect = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
%5:bool = eq %2, 1i
- if %5 [t: %b2] { # if_1
- %b2 = block { # true
+ if %5 [t: $B2] { # if_1
+ $B2: { # true
store %continue_execution, false
store %return_value, 101i
exit_if # if_1
}
}
%6:bool = load %continue_execution
- if %6 [t: %b3] { # if_2
- %b3 = block { # true
+ if %6 [t: $B3] { # if_2
+ $B3: { # true
%7:bool = eq %2, 2i
- if %7 [t: %b4] { # if_3
- %b4 = block { # true
+ if %7 [t: $B4] { # if_3
+ $B4: { # true
store %continue_execution, false
store %return_value, 202i
exit_if # if_3
}
}
%8:bool = load %continue_execution
- if %8 [t: %b5] { # if_4
- %b5 = block { # true
+ if %8 [t: $B5] { # if_4
+ $B5: { # true
%9:bool = eq %2, 3i
- if %9 [t: %b6] { # if_5
- %b6 = block { # true
+ if %9 [t: $B6] { # if_5
+ $B6: { # true
store %continue_execution, false
store %return_value, 303i
exit_if # if_5
}
}
%10:bool = load %continue_execution
- if %10 [t: %b7] { # if_6
- %b7 = block { # true
+ if %10 [t: $B7] { # if_6
+ $B7: { # true
store %return_value, 404i
exit_if # if_6
}
@@ -1348,19 +1348,19 @@
auto* src = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%3:bool = eq %2, 1i
- if %3 [t: %b2] { # if_1
- %b2 = block { # true
+ if %3 [t: $B2] { # if_1
+ $B2: { # true
ret 101i
}
}
%4:bool = eq %2, 2i
- if %4 [t: %b3, f: %b4] { # if_2
- %b3 = block { # true
+ if %4 [t: $B3, f: $B4] { # if_2
+ $B3: { # true
ret 202i
}
- %b4 = block { # false
+ $B4: { # false
ret 303i
}
}
@@ -1372,28 +1372,28 @@
auto* expect = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
%5:bool = eq %2, 1i
- if %5 [t: %b2] { # if_1
- %b2 = block { # true
+ if %5 [t: $B2] { # if_1
+ $B2: { # true
store %continue_execution, false
store %return_value, 101i
exit_if # if_1
}
}
%6:bool = load %continue_execution
- if %6 [t: %b3] { # if_2
- %b3 = block { # true
+ if %6 [t: $B3] { # if_2
+ $B3: { # true
%7:bool = eq %2, 2i
- if %7 [t: %b4, f: %b5] { # if_3
- %b4 = block { # true
+ if %7 [t: $B4, f: $B5] { # if_3
+ $B4: { # true
store %continue_execution, false
store %return_value, 202i
exit_if # if_3
}
- %b5 = block { # false
+ $B5: { # false
store %continue_execution, false
store %return_value, 303i
exit_if # if_3
@@ -1424,9 +1424,9 @@
});
auto* src = R"(
%foo = func():i32 {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
ret 42i
}
}
@@ -1438,10 +1438,10 @@
auto* expect = R"(
%foo = func():i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ loop [b: $B2] { # loop_1
+ $B2: { # body
store %return_value, 42i
exit_loop # loop_1
}
@@ -1486,28 +1486,28 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):i32 {
- %b2 = block {
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- if %3 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ $B2: {
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ if %3 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
ret 42i
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_1
}
}
store %1, 2i
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
store %1, 1i
- break_if true %b3
+ break_if true $B3
}
}
store %1, 3i
@@ -1518,43 +1518,43 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):i32 {
- %b2 = block {
+ $B2: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- if %3 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ if %3 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
store %continue_execution, false
store %return_value, 42i
exit_if # if_1
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_1
}
}
%6:bool = load %continue_execution
- if %6 [t: %b7] { # if_2
- %b7 = block { # true
+ if %6 [t: $B7] { # if_2
+ $B7: { # true
store %1, 2i
- continue %b4
+ continue $B4
}
}
exit_loop # loop_1
}
- %b4 = block { # continuing
+ $B4: { # continuing
store %1, 1i
- break_if true %b3
+ break_if true $B3
}
}
%7:bool = load %continue_execution
- if %7 [t: %b8] { # if_3
- %b8 = block { # true
+ if %7 [t: $B8] { # if_3
+ $B8: { # true
store %1, 3i
store %return_value, 43i
exit_if # if_3
@@ -1600,28 +1600,28 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):i32 {
- %b2 = block {
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- if %3 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ $B2: {
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ if %3 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
ret 42i
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_1
}
}
store %1, 2i
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
store %1, 1i
- next_iteration %b3
+ next_iteration $B3
}
}
unreachable
@@ -1631,38 +1631,38 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:bool):i32 {
- %b2 = block {
+ $B2: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- loop [b: %b3, c: %b4] { # loop_1
- %b3 = block { # body
- if %3 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ loop [b: $B3, c: $B4] { # loop_1
+ $B3: { # body
+ if %3 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
store %continue_execution, false
store %return_value, 42i
exit_if # if_1
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_1
}
}
%6:bool = load %continue_execution
- if %6 [t: %b7] { # if_2
- %b7 = block { # true
+ if %6 [t: $B7] { # if_2
+ $B7: { # true
store %1, 2i
- continue %b4
+ continue $B4
}
}
exit_loop # loop_1
}
- %b4 = block { # continuing
+ $B4: { # continuing
store %1, 1i
- next_iteration %b3
+ next_iteration $B3
}
}
%7:i32 = load %return_value
@@ -1805,12 +1805,12 @@
auto* src = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
- switch %2 [c: (1i, %b2), c: (default, %b3)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch %2 [c: (1i, $B2), c: (default, $B3)] { # switch_1
+ $B2: { # case
ret 42i
}
- %b3 = block { # case
+ $B3: { # case
exit_switch # switch_1
}
}
@@ -1822,22 +1822,22 @@
auto* expect = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- switch %2 [c: (1i, %b2), c: (default, %b3)] { # switch_1
- %b2 = block { # case
+ switch %2 [c: (1i, $B2), c: (default, $B3)] { # switch_1
+ $B2: { # case
store %continue_execution, false
store %return_value, 42i
exit_switch # switch_1
}
- %b3 = block { # case
+ $B3: { # case
exit_switch # switch_1
}
}
%5:bool = load %continue_execution
- if %5 [t: %b4] { # if_1
- %b4 = block { # true
+ if %5 [t: $B4] { # if_1
+ $B4: { # true
store %return_value, 0i
exit_if # if_1
}
@@ -1879,27 +1879,27 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:i32):i32 {
- %b2 = block {
- switch %3 [c: (1i, %b3), c: (default, %b4)] { # switch_1
- %b3 = block { # case
+ $B2: {
+ switch %3 [c: (1i, $B3), c: (default, $B4)] { # switch_1
+ $B3: { # case
%4:bool = eq %3, 1i
- if %4 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ if %4 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
ret 42i
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_1
}
}
store %1, 2i
exit_switch # switch_1
}
- %b4 = block { # case
+ $B4: { # case
exit_switch # switch_1
}
}
@@ -1910,43 +1910,43 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
%foo = func(%3:i32):i32 {
- %b2 = block {
+ $B2: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- switch %3 [c: (1i, %b3), c: (default, %b4)] { # switch_1
- %b3 = block { # case
+ switch %3 [c: (1i, $B3), c: (default, $B4)] { # switch_1
+ $B3: { # case
%6:bool = eq %3, 1i
- if %6 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ if %6 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
store %continue_execution, false
store %return_value, 42i
exit_if # if_1
}
- %b6 = block { # false
+ $B6: { # false
exit_if # if_1
}
}
%7:bool = load %continue_execution
- if %7 [t: %b7] { # if_2
- %b7 = block { # true
+ if %7 [t: $B7] { # if_2
+ $B7: { # true
store %1, 2i
exit_switch # switch_1
}
}
exit_switch # switch_1
}
- %b4 = block { # case
+ $B4: { # case
exit_switch # switch_1
}
}
%8:bool = load %continue_execution
- if %8 [t: %b8] { # if_3
- %b8 = block { # true
+ if %8 [t: $B8] { # if_3
+ $B8: { # true
store %return_value, 0i
exit_if # if_3
}
@@ -1980,18 +1980,18 @@
auto* src = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
- %3:i32 = switch %2 [c: (1i, %b2), c: (2i, %b3), c: (3i, %b4), c: (default, %b5)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ %3:i32 = switch %2 [c: (1i, $B2), c: (2i, $B3), c: (3i, $B4), c: (default, $B5)] { # switch_1
+ $B2: { # case
ret 42i
}
- %b3 = block { # case
+ $B3: { # case
ret 99i
}
- %b4 = block { # case
+ $B4: { # case
exit_switch 1i # switch_1
}
- %b5 = block { # case
+ $B5: { # case
exit_switch 0i # switch_1
}
}
@@ -2003,30 +2003,30 @@
auto* expect = R"(
%foo = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- %5:i32 = switch %2 [c: (1i, %b2), c: (2i, %b3), c: (3i, %b4), c: (default, %b5)] { # switch_1
- %b2 = block { # case
+ %5:i32 = switch %2 [c: (1i, $B2), c: (2i, $B3), c: (3i, $B4), c: (default, $B5)] { # switch_1
+ $B2: { # case
store %continue_execution, false
store %return_value, 42i
exit_switch undef # switch_1
}
- %b3 = block { # case
+ $B3: { # case
store %continue_execution, false
store %return_value, 99i
exit_switch undef # switch_1
}
- %b4 = block { # case
+ $B4: { # case
exit_switch 1i # switch_1
}
- %b5 = block { # case
+ $B5: { # case
exit_switch 0i # switch_1
}
}
%6:bool = load %continue_execution
- if %6 [t: %b6] { # if_1
- %b6 = block { # true
+ if %6 [t: $B6] { # if_1
+ $B6: { # true
store %return_value, %5
exit_if # if_1
}
@@ -2056,15 +2056,15 @@
auto* src = R"(
%foo = func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
- if true [t: %b3] { # if_1
- %b3 = block { # true
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
+ if true [t: $B3] { # if_1
+ $B3: { # true
ret
}
}
- continue %b4
+ continue $B4
}
}
unreachable
@@ -2075,20 +2075,20 @@
auto* expect = R"(
%foo = func():void {
- %b1 = block {
+ $B1: {
%continue_execution:ptr<function, bool, read_write> = var, true
- loop [b: %b2] { # loop_1
- %b2 = block { # body
- if true [t: %b3] { # if_1
- %b3 = block { # true
+ loop [b: $B2] { # loop_1
+ $B2: { # body
+ if true [t: $B3] { # if_1
+ $B3: { # true
store %continue_execution, false
exit_if # if_1
}
}
%3:bool = load %continue_execution
- if %3 [t: %b4] { # if_2
- %b4 = block { # true
- continue %b5
+ if %3 [t: $B4] { # if_2
+ $B4: { # true
+ continue $B5
}
}
exit_loop # loop_1
@@ -2117,11 +2117,11 @@
auto* src = R"(
%foo = func():i32 {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
- if true [t: %b3] { # if_2
- %b3 = block { # true
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
+ if true [t: $B3] { # if_2
+ $B3: { # true
ret 1i
}
}
@@ -2136,21 +2136,21 @@
auto* expect = R"(
%foo = func():i32 {
- %b1 = block {
+ $B1: {
%return_value:ptr<function, i32, read_write> = var
%continue_execution:ptr<function, bool, read_write> = var, true
- if true [t: %b2] { # if_1
- %b2 = block { # true
- if true [t: %b3] { # if_2
- %b3 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
+ if true [t: $B3] { # if_2
+ $B3: { # true
store %continue_execution, false
store %return_value, 1i
exit_if # if_2
}
}
%4:bool = load %continue_execution
- if %4 [t: %b4] { # if_3
- %b4 = block { # true
+ if %4 [t: $B4] { # if_3
+ $B4: { # true
store %continue_execution, false
store %return_value, 2i
exit_if # if_3
@@ -2160,8 +2160,8 @@
}
}
%5:bool = load %continue_execution
- if %5 [t: %b5] { # if_4
- %b5 = block { # true
+ if %5 [t: $B5] { # if_4
+ $B5: { # true
store %return_value, 3i
exit_if # if_4
}
diff --git a/src/tint/lang/spirv/writer/raise/pass_matrix_by_pointer_test.cc b/src/tint/lang/spirv/writer/raise/pass_matrix_by_pointer_test.cc
index fb5ad4f..e50d515 100644
--- a/src/tint/lang/spirv/writer/raise/pass_matrix_by_pointer_test.cc
+++ b/src/tint/lang/spirv/writer/raise/pass_matrix_by_pointer_test.cc
@@ -58,18 +58,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, array<f32, 4>, read_write> = var
}
%target = func(%value:array<f32, 4>):f32 {
- %b2 = block {
+ $B2: {
%4:f32 = access %value, 1i
ret %4
}
}
%caller = func():f32 {
- %b3 = block {
+ $B3: {
%6:array<f32, 4> = load %var
%7:f32 = call %target, %6
ret %7
@@ -104,19 +104,19 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%target = func(%value:ptr<private, mat3x3<f32>, read_write>):vec3<f32> {
- %b2 = block {
+ $B2: {
%4:ptr<private, vec3<f32>, read_write> = access %value, 1i
%5:vec3<f32> = load %4
ret %5
}
}
%caller = func():vec3<f32> {
- %b3 = block {
+ $B3: {
%7:vec3<f32> = call %target, %var
ret %7
}
@@ -142,12 +142,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%caller = func():f32 {
- %b2 = block {
+ $B2: {
%3:mat3x3<f32> = load %var
%4:f32 = determinant %3
ret %4
@@ -182,18 +182,18 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%target = func(%value:mat3x3<f32>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:mat3x3<f32> = mul %value, 2.0f
ret %4
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%6:mat3x3<f32> = load %var
%7:mat3x3<f32> = call %target, %6
ret %7
@@ -203,19 +203,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%target = func(%3:ptr<function, mat3x3<f32>, read_write>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:mat3x3<f32> = load %3
%5:mat3x3<f32> = mul %4, 2.0f
ret %5
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%7:mat3x3<f32> = load %var
%8:ptr<function, mat3x3<f32>, read_write> = var, %7
%9:mat3x3<f32> = call %target, %8
@@ -254,19 +254,19 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, array<mat3x3<f32>, 4>, read_write> = var
}
%target = func(%value_a:mat3x3<f32>, %scalar:f32, %value_b:mat3x3<f32>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%6:mat3x3<f32> = mul %value_a, %scalar
%7:mat3x3<f32> = add %6, %value_b
ret %7
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%9:ptr<private, mat3x3<f32>, read_write> = access %var, 0u
%10:mat3x3<f32> = load %9
%11:ptr<private, mat3x3<f32>, read_write> = access %var, 1u
@@ -279,12 +279,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, array<mat3x3<f32>, 4>, read_write> = var
}
%target = func(%3:ptr<function, mat3x3<f32>, read_write>, %scalar:f32, %5:ptr<function, mat3x3<f32>, read_write>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%6:mat3x3<f32> = load %5
%7:mat3x3<f32> = load %3
%8:mat3x3<f32> = mul %7, %scalar
@@ -293,7 +293,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%11:ptr<private, mat3x3<f32>, read_write> = access %var, 0u
%12:mat3x3<f32> = load %11
%13:ptr<private, mat3x3<f32>, read_write> = access %var, 1u
@@ -331,19 +331,19 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%target = func(%value:mat3x3<f32>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:mat3x3<f32> = add %value, %value
%5:mat3x3<f32> = mul %4, %value
ret %5
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%7:mat3x3<f32> = load %var
%8:mat3x3<f32> = call %target, %7
ret %8
@@ -353,12 +353,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%target = func(%3:ptr<function, mat3x3<f32>, read_write>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:mat3x3<f32> = load %3
%5:mat3x3<f32> = add %4, %4
%6:mat3x3<f32> = mul %5, %4
@@ -366,7 +366,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%8:mat3x3<f32> = load %var
%9:ptr<function, mat3x3<f32>, read_write> = var, %8
%10:mat3x3<f32> = call %target, %9
@@ -412,32 +412,32 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%target = func(%value:mat3x3<f32>, %scalar:f32):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%5:mat3x3<f32> = mul %value, %scalar
ret %5
}
}
%caller_a = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%7:mat3x3<f32> = load %var
%8:mat3x3<f32> = call %target, %7, 2.0f
ret %8
}
}
%caller_b = func():mat3x3<f32> {
- %b4 = block {
+ $B4: {
%10:mat3x3<f32> = load %var
%11:mat3x3<f32> = call %target, %10, 3.0f
ret %11
}
}
%caller_c = func():mat3x3<f32> {
- %b5 = block {
+ $B5: {
%13:mat3x3<f32> = load %var
%14:mat3x3<f32> = call %target, %13, 4.0f
ret %14
@@ -447,19 +447,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, mat3x3<f32>, read_write> = var
}
%target = func(%3:ptr<function, mat3x3<f32>, read_write>, %scalar:f32):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%5:mat3x3<f32> = load %3
%6:mat3x3<f32> = mul %5, %scalar
ret %6
}
}
%caller_a = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%8:mat3x3<f32> = load %var
%9:ptr<function, mat3x3<f32>, read_write> = var, %8
%10:mat3x3<f32> = call %target, %9, 2.0f
@@ -467,7 +467,7 @@
}
}
%caller_b = func():mat3x3<f32> {
- %b4 = block {
+ $B4: {
%12:mat3x3<f32> = load %var
%13:ptr<function, mat3x3<f32>, read_write> = var, %12
%14:mat3x3<f32> = call %target, %13, 3.0f
@@ -475,7 +475,7 @@
}
}
%caller_c = func():mat3x3<f32> {
- %b5 = block {
+ $B5: {
%16:mat3x3<f32> = load %var
%17:ptr<function, mat3x3<f32>, read_write> = var, %16
%18:mat3x3<f32> = call %target, %17, 4.0f
@@ -511,12 +511,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, array<mat3x3<f32>, 2>, read_write> = var
}
%target = func(%value:array<mat3x3<f32>, 2>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:mat3x3<f32> = access %value, 0u
%5:mat3x3<f32> = access %value, 1u
%6:mat3x3<f32> = add %4, %5
@@ -524,7 +524,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%8:array<mat3x3<f32>, 2> = load %var
%9:mat3x3<f32> = call %target, %8
ret %9
@@ -534,12 +534,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, array<mat3x3<f32>, 2>, read_write> = var
}
%target = func(%3:ptr<function, array<mat3x3<f32>, 2>, read_write>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:array<mat3x3<f32>, 2> = load %3
%5:mat3x3<f32> = access %4, 0u
%6:mat3x3<f32> = access %4, 1u
@@ -548,7 +548,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%9:array<mat3x3<f32>, 2> = load %var
%10:ptr<function, array<mat3x3<f32>, 2>, read_write> = var, %9
%11:mat3x3<f32> = call %target, %10
@@ -592,12 +592,12 @@
s:f32 @offset(48)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, MyStruct, read_write> = var
}
%target = func(%value:MyStruct):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:mat3x3<f32> = access %value, 0u
%5:f32 = access %value, 1u
%6:mat3x3<f32> = mul %4, %5
@@ -605,7 +605,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%8:MyStruct = load %var
%9:mat3x3<f32> = call %target, %8
ret %9
@@ -620,12 +620,12 @@
s:f32 @offset(48)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, MyStruct, read_write> = var
}
%target = func(%3:ptr<function, MyStruct, read_write>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:MyStruct = load %3
%5:mat3x3<f32> = access %4, 0u
%6:f32 = access %4, 1u
@@ -634,7 +634,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%9:MyStruct = load %var
%10:ptr<function, MyStruct, read_write> = var, %9
%11:mat3x3<f32> = call %target, %10
@@ -682,12 +682,12 @@
s:f32 @offset(96)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, array<MyStruct, 4>, read_write> = var
}
%target = func(%value:array<MyStruct, 4>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:mat3x3<f32> = access %value, 2u, 0u, 0u
%5:mat3x3<f32> = access %value, 2u, 0u, 1u
%6:f32 = access %value, 2u, 1u
@@ -697,7 +697,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%10:array<MyStruct, 4> = load %var
%11:mat3x3<f32> = call %target, %10
ret %11
@@ -712,12 +712,12 @@
s:f32 @offset(96)
}
-%b1 = block { # root
+$B1: { # root
%var:ptr<private, array<MyStruct, 4>, read_write> = var
}
%target = func(%3:ptr<function, array<MyStruct, 4>, read_write>):mat3x3<f32> {
- %b2 = block {
+ $B2: {
%4:array<MyStruct, 4> = load %3
%5:mat3x3<f32> = access %4, 2u, 0u, 0u
%6:mat3x3<f32> = access %4, 2u, 0u, 1u
@@ -728,7 +728,7 @@
}
}
%caller = func():mat3x3<f32> {
- %b3 = block {
+ $B3: {
%11:array<MyStruct, 4> = load %var
%12:ptr<function, array<MyStruct, 4>, read_write> = var, %11
%13:mat3x3<f32> = call %target, %12
diff --git a/src/tint/lang/spirv/writer/raise/shader_io_test.cc b/src/tint/lang/spirv/writer/raise/shader_io_test.cc
index 2e94217..4faaf5d 100644
--- a/src/tint/lang/spirv/writer/raise/shader_io_test.cc
+++ b/src/tint/lang/spirv/writer/raise/shader_io_test.cc
@@ -49,7 +49,7 @@
auto* src = R"(
%foo = @compute func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -92,9 +92,9 @@
auto* src = R"(
%foo = @fragment func(%front_facing:bool [@front_facing], %position:vec4<f32> [@invariant, @position], %color1:f32 [@location(0)], %color2:f32 [@location(1), @interpolate(linear, sample)]):void {
- %b1 = block {
- if %front_facing [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %front_facing [t: $B2] { # if_1
+ $B2: { # true
%6:f32 = add %color1, %color2
%7:vec4<f32> = mul %position, %6
exit_if # if_1
@@ -107,7 +107,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%foo_front_facing_Input:ptr<__in, bool, read> = var @builtin(front_facing)
%foo_position_Input:ptr<__in, vec4<f32>, read> = var @invariant @builtin(position)
%foo_loc0_Input:ptr<__in, f32, read> = var @location(0)
@@ -115,9 +115,9 @@
}
%foo_inner = func(%front_facing:bool, %position:vec4<f32>, %color1:f32, %color2:f32):void {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
%10:f32 = add %color1, %color2
%11:vec4<f32> = mul %position, %10
exit_if # if_1
@@ -127,7 +127,7 @@
}
}
%foo = @fragment func():void {
- %b4 = block {
+ $B4: {
%13:bool = load %foo_front_facing_Input
%14:vec4<f32> = load %foo_position_Input
%15:f32 = load %foo_loc0_Input
@@ -228,10 +228,10 @@
}
%foo = @fragment func(%inputs:Inputs):void {
- %b1 = block {
+ $B1: {
%3:bool = access %inputs, 0i
- if %3 [t: %b2] { # if_1
- %b2 = block { # true
+ if %3 [t: $B2] { # if_1
+ $B2: { # true
%4:vec4<f32> = access %inputs, 1i
%5:f32 = access %inputs, 2i
%6:f32 = access %inputs, 3i
@@ -254,7 +254,7 @@
color2:f32 @offset(36)
}
-%b1 = block { # root
+$B1: { # root
%foo_front_facing_Input:ptr<__in, bool, read> = var @builtin(front_facing)
%foo_position_Input:ptr<__in, vec4<f32>, read> = var @invariant @builtin(position)
%foo_loc0_Input:ptr<__in, f32, read> = var @location(0)
@@ -262,10 +262,10 @@
}
%foo_inner = func(%inputs:Inputs):void {
- %b2 = block {
+ $B2: {
%7:bool = access %inputs, 0i
- if %7 [t: %b3] { # if_1
- %b3 = block { # true
+ if %7 [t: $B3] { # if_1
+ $B3: { # true
%8:vec4<f32> = access %inputs, 1i
%9:f32 = access %inputs, 2i
%10:f32 = access %inputs, 3i
@@ -278,7 +278,7 @@
}
}
%foo = @fragment func():void {
- %b4 = block {
+ $B4: {
%14:bool = load %foo_front_facing_Input
%15:vec4<f32> = load %foo_position_Input
%16:f32 = load %foo_loc0_Input
@@ -355,9 +355,9 @@
}
%foo = @fragment func(%front_facing:bool [@front_facing], %inputs:Inputs, %color2:f32 [@location(1), @interpolate(linear, sample)]):void {
- %b1 = block {
- if %front_facing [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %front_facing [t: $B2] { # if_1
+ $B2: { # true
%5:vec4<f32> = access %inputs, 0i
%6:f32 = access %inputs, 1i
%7:f32 = add %6, %color2
@@ -377,7 +377,7 @@
color1:f32 @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%foo_front_facing_Input:ptr<__in, bool, read> = var @builtin(front_facing)
%foo_position_Input:ptr<__in, vec4<f32>, read> = var @invariant @builtin(position)
%foo_loc0_Input:ptr<__in, f32, read> = var @location(0)
@@ -385,9 +385,9 @@
}
%foo_inner = func(%front_facing:bool, %inputs:Inputs, %color2:f32):void {
- %b2 = block {
- if %front_facing [t: %b3] { # if_1
- %b3 = block { # true
+ $B2: {
+ if %front_facing [t: $B3] { # if_1
+ $B3: { # true
%9:vec4<f32> = access %inputs, 0i
%10:f32 = access %inputs, 1i
%11:f32 = add %10, %color2
@@ -399,7 +399,7 @@
}
}
%foo = @fragment func():void {
- %b4 = block {
+ $B4: {
%14:bool = load %foo_front_facing_Input
%15:vec4<f32> = load %foo_position_Input
%16:f32 = load %foo_loc0_Input
@@ -430,7 +430,7 @@
auto* src = R"(
%foo = @vertex func():vec4<f32> [@invariant, @position] {
- %b1 = block {
+ $B1: {
%2:vec4<f32> = construct 0.5f
ret %2
}
@@ -439,18 +439,18 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%foo_position_Output:ptr<__out, vec4<f32>, write> = var @invariant @builtin(position)
}
%foo_inner = func():vec4<f32> {
- %b2 = block {
+ $B2: {
%3:vec4<f32> = construct 0.5f
ret %3
}
}
%foo = @vertex func():void {
- %b3 = block {
+ $B3: {
%5:vec4<f32> = call %foo_inner
store %foo_position_Output, %5
ret
@@ -476,7 +476,7 @@
auto* src = R"(
%foo = @fragment func():vec4<f32> [@location(1)] {
- %b1 = block {
+ $B1: {
%2:vec4<f32> = construct 0.5f
ret %2
}
@@ -485,18 +485,18 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%foo_loc1_Output:ptr<__out, vec4<f32>, write> = var @location(1)
}
%foo_inner = func():vec4<f32> {
- %b2 = block {
+ $B2: {
%3:vec4<f32> = construct 0.5f
ret %3
}
}
%foo = @fragment func():void {
- %b3 = block {
+ $B3: {
%5:vec4<f32> = call %foo_inner
store %foo_loc1_Output, %5
ret
@@ -571,7 +571,7 @@
}
%foo = @vertex func():Outputs {
- %b1 = block {
+ $B1: {
%2:vec4<f32> = construct 0.0f
%3:Outputs = construct %2, 0.25f, 0.75f
ret %3
@@ -587,21 +587,21 @@
color2:f32 @offset(20)
}
-%b1 = block { # root
+$B1: { # root
%foo_position_Output:ptr<__out, vec4<f32>, write> = var @invariant @builtin(position)
%foo_loc0_Output:ptr<__out, f32, write> = var @location(0)
%foo_loc1_Output:ptr<__out, f32, write> = var @location(1) @interpolate(linear, sample)
}
%foo_inner = func():Outputs {
- %b2 = block {
+ $B2: {
%5:vec4<f32> = construct 0.0f
%6:Outputs = construct %5, 0.25f, 0.75f
ret %6
}
}
%foo = @vertex func():void {
- %b3 = block {
+ $B3: {
%8:Outputs = call %foo_inner
%9:vec4<f32> = access %8, 0u
store %foo_position_Output, %9
@@ -664,7 +664,7 @@
}
%foo = @fragment func():Output {
- %b1 = block {
+ $B1: {
%2:Output = construct 0.25f, 0.75f
ret %2
}
@@ -678,19 +678,19 @@
color2:f32 @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%foo_loc0_idx0_Output:ptr<__out, f32, write> = var @location(0) @blend_src(0)
%foo_loc0_idx1_Output:ptr<__out, f32, write> = var @location(0) @blend_src(1)
}
%foo_inner = func():Output {
- %b2 = block {
+ $B2: {
%4:Output = construct 0.25f, 0.75f
ret %4
}
}
%foo = @fragment func():void {
- %b3 = block {
+ $B3: {
%6:Output = call %foo_inner
%7:f32 = access %6, 0u
store %foo_loc0_idx0_Output, %7
@@ -772,7 +772,7 @@
}
%vert = @vertex func():Interface {
- %b1 = block {
+ $B1: {
%2:vec4<f32> = construct 0.0f
%3:vec4<f32> = construct 1.0f
%4:Interface = construct %2, %3
@@ -780,7 +780,7 @@
}
}
%frag = @fragment func(%inputs:Interface):vec4<f32> [@location(0)] {
- %b2 = block {
+ $B2: {
%7:vec4<f32> = access %inputs, 0u
%8:vec4<f32> = access %inputs, 1u
%9:vec4<f32> = add %7, %8
@@ -796,7 +796,7 @@
color:vec4<f32> @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%vert_position_Output:ptr<__out, vec4<f32>, write> = var @builtin(position)
%vert_loc0_Output:ptr<__out, vec4<f32>, write> = var @location(0)
%frag_position_Input:ptr<__in, vec4<f32>, read> = var @builtin(position)
@@ -805,7 +805,7 @@
}
%vert_inner = func():Interface {
- %b2 = block {
+ $B2: {
%7:vec4<f32> = construct 0.0f
%8:vec4<f32> = construct 1.0f
%9:Interface = construct %7, %8
@@ -813,7 +813,7 @@
}
}
%frag_inner = func(%inputs:Interface):vec4<f32> {
- %b3 = block {
+ $B3: {
%12:vec4<f32> = access %inputs, 0u
%13:vec4<f32> = access %inputs, 1u
%14:vec4<f32> = add %12, %13
@@ -821,7 +821,7 @@
}
}
%vert = @vertex func():void {
- %b4 = block {
+ $B4: {
%16:Interface = call %vert_inner
%17:vec4<f32> = access %16, 0u
store %vert_position_Output, %17
@@ -831,7 +831,7 @@
}
}
%frag = @fragment func():void {
- %b5 = block {
+ $B5: {
%20:vec4<f32> = load %frag_position_Input
%21:vec4<f32> = load %frag_loc0_Input
%22:Interface = construct %20, %21
@@ -894,12 +894,12 @@
color:vec4<f32> @offset(16), @location(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, Outputs, read> = var
}
%vert = @vertex func():Outputs {
- %b2 = block {
+ $B2: {
%3:Outputs = load %1
ret %3
}
@@ -913,20 +913,20 @@
color:vec4<f32> @offset(16)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<storage, Outputs, read> = var
%vert_position_Output:ptr<__out, vec4<f32>, write> = var @builtin(position)
%vert_loc0_Output:ptr<__out, vec4<f32>, write> = var @location(0)
}
%vert_inner = func():Outputs {
- %b2 = block {
+ $B2: {
%5:Outputs = load %1
ret %5
}
}
%vert = @vertex func():void {
- %b3 = block {
+ $B3: {
%7:Outputs = call %vert_inner
%8:vec4<f32> = access %7, 0u
store %vert_position_Output, %8
@@ -992,7 +992,7 @@
}
%foo = @fragment func(%mask_in:u32 [@sample_mask]):Outputs {
- %b1 = block {
+ $B1: {
%3:Outputs = construct 0.5f, %mask_in
ret %3
}
@@ -1006,20 +1006,20 @@
mask:u32 @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%foo_sample_mask_Input:ptr<__in, array<u32, 1>, read> = var @builtin(sample_mask)
%foo_loc0_Output:ptr<__out, f32, write> = var @location(0)
%foo_sample_mask_Output:ptr<__out, array<u32, 1>, write> = var @builtin(sample_mask)
}
%foo_inner = func(%mask_in:u32):Outputs {
- %b2 = block {
+ $B2: {
%6:Outputs = construct 0.5f, %mask_in
ret %6
}
}
%foo = @fragment func():void {
- %b3 = block {
+ $B3: {
%8:ptr<__in, u32, read> = access %foo_sample_mask_Input, 0u
%9:u32 = load %8
%10:Outputs = call %foo_inner, %9
@@ -1106,19 +1106,19 @@
}
%vert = @vertex func(%input:MyStruct, %ival:i32 [@location(1), @interpolate(flat)]):vec4<f32> [@invariant, @position] {
- %b1 = block {
+ $B1: {
%4:vec4<f32> = construct 0.5f
ret %4
}
}
%frag1 = @fragment func():MyStruct {
- %b2 = block {
+ $B2: {
%6:MyStruct = construct 0.5f
ret %6
}
}
%frag2 = @fragment func():i32 [@location(0), @interpolate(flat)] {
- %b3 = block {
+ $B3: {
ret 42i
}
}
@@ -1130,7 +1130,7 @@
color:f32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%vert_loc1_Input:ptr<__in, f32, read> = var @location(1)
%vert_loc1_Input_1:ptr<__in, i32, read> = var @location(1) # %vert_loc1_Input_1: 'vert_loc1_Input'
%vert_position_Output:ptr<__out, vec4<f32>, write> = var @invariant @builtin(position)
@@ -1139,24 +1139,24 @@
}
%vert_inner = func(%input:MyStruct, %ival:i32):vec4<f32> {
- %b2 = block {
+ $B2: {
%9:vec4<f32> = construct 0.5f
ret %9
}
}
%frag1_inner = func():MyStruct {
- %b3 = block {
+ $B3: {
%11:MyStruct = construct 0.5f
ret %11
}
}
%frag2_inner = func():i32 {
- %b4 = block {
+ $B4: {
ret 42i
}
}
%vert = @vertex func():void {
- %b5 = block {
+ $B5: {
%14:f32 = load %vert_loc1_Input
%15:MyStruct = construct %14
%16:i32 = load %vert_loc1_Input_1
@@ -1166,7 +1166,7 @@
}
}
%frag1 = @fragment func():void {
- %b6 = block {
+ $B6: {
%19:MyStruct = call %frag1_inner
%20:f32 = access %19, 0u
store %frag1_loc1_Output, %20
@@ -1174,7 +1174,7 @@
}
}
%frag2 = @fragment func():void {
- %b7 = block {
+ $B7: {
%22:i32 = call %frag2_inner
store %frag2_loc0_Output, %22
ret
@@ -1232,7 +1232,7 @@
}
%foo = @fragment func():Outputs {
- %b1 = block {
+ $B1: {
%2:Outputs = construct 0.5f, 2.0f
ret %2
}
@@ -1251,20 +1251,20 @@
max:f32 @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%foo_loc0_Output:ptr<__out, f32, write> = var @location(0)
%foo_frag_depth_Output:ptr<__out, f32, write> = var @builtin(frag_depth)
%tint_frag_depth_clamp_args:ptr<push_constant, FragDepthClampArgs, read> = var
}
%foo_inner = func():Outputs {
- %b2 = block {
+ $B2: {
%5:Outputs = construct 0.5f, 2.0f
ret %5
}
}
%foo = @fragment func():void {
- %b3 = block {
+ $B3: {
%7:Outputs = call %foo_inner
%8:f32 = access %7, 0u
store %foo_loc0_Output, %8
@@ -1333,19 +1333,19 @@
}
%ep1 = @fragment func():Outputs {
- %b1 = block {
+ $B1: {
%2:Outputs = construct 0.5f, 2.0f
ret %2
}
}
%ep2 = @fragment func():Outputs {
- %b2 = block {
+ $B2: {
%4:Outputs = construct 0.5f, 2.0f
ret %4
}
}
%ep3 = @fragment func():Outputs {
- %b3 = block {
+ $B3: {
%6:Outputs = construct 0.5f, 2.0f
ret %6
}
@@ -1364,7 +1364,7 @@
max:f32 @offset(4)
}
-%b1 = block { # root
+$B1: { # root
%ep1_loc0_Output:ptr<__out, f32, write> = var @location(0)
%ep1_frag_depth_Output:ptr<__out, f32, write> = var @builtin(frag_depth)
%tint_frag_depth_clamp_args:ptr<push_constant, FragDepthClampArgs, read> = var
@@ -1375,25 +1375,25 @@
}
%ep1_inner = func():Outputs {
- %b2 = block {
+ $B2: {
%9:Outputs = construct 0.5f, 2.0f
ret %9
}
}
%ep2_inner = func():Outputs {
- %b3 = block {
+ $B3: {
%11:Outputs = construct 0.5f, 2.0f
ret %11
}
}
%ep3_inner = func():Outputs {
- %b4 = block {
+ $B4: {
%13:Outputs = construct 0.5f, 2.0f
ret %13
}
}
%ep1 = @fragment func():void {
- %b5 = block {
+ $B5: {
%15:Outputs = call %ep1_inner
%16:f32 = access %15, 0u
store %ep1_loc0_Output, %16
@@ -1407,7 +1407,7 @@
}
}
%ep2 = @fragment func():void {
- %b6 = block {
+ $B6: {
%23:Outputs = call %ep2_inner
%24:f32 = access %23, 0u
store %ep2_loc0_Output, %24
@@ -1421,7 +1421,7 @@
}
}
%ep3 = @fragment func():void {
- %b7 = block {
+ $B7: {
%31:Outputs = call %ep3_inner
%32:f32 = access %31, 0u
store %ep3_loc0_Output, %32
@@ -1454,7 +1454,7 @@
auto* src = R"(
%foo = @vertex func():vec4<f32> [@position] {
- %b1 = block {
+ $B1: {
%2:vec4<f32> = construct 0.5f
ret %2
}
@@ -1463,19 +1463,19 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%foo_position_Output:ptr<__out, vec4<f32>, write> = var @builtin(position)
%foo___point_size_Output:ptr<__out, f32, write> = var @builtin(__point_size)
}
%foo_inner = func():vec4<f32> {
- %b2 = block {
+ $B2: {
%4:vec4<f32> = construct 0.5f
ret %4
}
}
%foo = @vertex func():void {
- %b3 = block {
+ $B3: {
%6:vec4<f32> = call %foo_inner
store %foo_position_Output, %6
store %foo___point_size_Output, 1.0f
@@ -1537,7 +1537,7 @@
}
%main = @fragment func(%in1:f16 [@location(2)], %in2:vec4<f16>):Outputs {
- %b1 = block {
+ $B1: {
%4:Outputs = construct %in1, %in2
ret %4
}
@@ -1551,7 +1551,7 @@
out2:vec4<f16> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%main_loc2_Input:ptr<__in, f16, read> = var @location(2)
%main_Input:ptr<__in, vec4<f16>, read> = var
%main_loc1_Output:ptr<__out, f16, write> = var @location(1)
@@ -1559,13 +1559,13 @@
}
%main_inner = func(%in1:f16, %in2:vec4<f16>):Outputs {
- %b2 = block {
+ $B2: {
%8:Outputs = construct %in1, %in2
ret %8
}
}
%main = @fragment func():void {
- %b3 = block {
+ $B3: {
%10:f16 = load %main_loc2_Input
%11:vec4<f16> = load %main_Input
%12:Outputs = call %main_inner, %10, %11
@@ -1631,7 +1631,7 @@
}
%main = @fragment func(%in1:f16 [@location(2)], %in2:vec4<f16>):Outputs {
- %b1 = block {
+ $B1: {
%4:Outputs = construct %in1, %in2
ret %4
}
@@ -1645,7 +1645,7 @@
out2:vec4<f16> @offset(8)
}
-%b1 = block { # root
+$B1: { # root
%main_loc2_Input:ptr<__in, f32, read> = var @location(2)
%main_Input:ptr<__in, vec4<f32>, read> = var
%main_loc1_Output:ptr<__out, f32, write> = var @location(1)
@@ -1653,13 +1653,13 @@
}
%main_inner = func(%in1:f16, %in2:vec4<f16>):Outputs {
- %b2 = block {
+ $B2: {
%8:Outputs = construct %in1, %in2
ret %8
}
}
%main = @fragment func():void {
- %b3 = block {
+ $B3: {
%10:f32 = load %main_loc2_Input
%11:f16 = convert %10
%12:vec4<f32> = load %main_Input
diff --git a/src/tint/lang/spirv/writer/raise/var_for_dynamic_index_test.cc b/src/tint/lang/spirv/writer/raise/var_for_dynamic_index_test.cc
index d523ea4..59b0f27 100644
--- a/src/tint/lang/spirv/writer/raise/var_for_dynamic_index_test.cc
+++ b/src/tint/lang/spirv/writer/raise/var_for_dynamic_index_test.cc
@@ -53,7 +53,7 @@
auto* expect = R"(
%foo = func(%2:array<i32, 4>):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = access %2, 1i
ret %3
}
@@ -76,7 +76,7 @@
auto* expect = R"(
%foo = func(%2:mat2x2<f32>):f32 {
- %b1 = block {
+ $B1: {
%3:f32 = access %2, 1i, 0i
ret %3
}
@@ -101,7 +101,7 @@
auto* expect = R"(
%foo = func(%2:ptr<function, array<i32, 4>, read_write>, %3:i32):i32 {
- %b1 = block {
+ $B1: {
%4:ptr<function, i32, read_write> = access %2, %3
%5:i32 = load %4
ret %5
@@ -127,7 +127,7 @@
auto* expect = R"(
%foo = func(%2:ptr<function, mat2x2<f32>, read_write>, %3:i32):f32 {
- %b1 = block {
+ $B1: {
%4:ptr<function, vec2<f32>, read_write> = access %2, %3
%5:f32 = load_vector_element %4, %3
ret %5
@@ -152,7 +152,7 @@
auto* expect = R"(
%foo = func(%2:vec4<f32>, %3:i32):f32 {
- %b1 = block {
+ $B1: {
%4:f32 = access %2, %3
ret %4
}
@@ -176,7 +176,7 @@
auto* expect = R"(
%foo = func(%2:array<i32, 4>, %3:i32):i32 {
- %b1 = block {
+ $B1: {
%4:ptr<function, array<i32, 4>, read_write> = var, %2
%5:ptr<function, i32, read_write> = access %4, %3
%6:i32 = load %5
@@ -202,7 +202,7 @@
auto* expect = R"(
%foo = func(%2:mat2x2<f32>, %3:i32):vec2<f32> {
- %b1 = block {
+ $B1: {
%4:ptr<function, mat2x2<f32>, read_write> = var, %2
%5:ptr<function, vec2<f32>, read_write> = access %4, %3
%6:vec2<f32> = load %5
@@ -228,7 +228,7 @@
auto* expect = R"(
%foo = func(%2:mat2x2<f32>, %3:i32):f32 {
- %b1 = block {
+ $B1: {
%4:ptr<function, mat2x2<f32>, read_write> = var, %2
%5:ptr<function, vec2<f32>, read_write> = access %4, %3
%6:f32 = load_vector_element %5, %3
@@ -254,7 +254,7 @@
auto* expect = R"(
%foo = func(%2:array<array<array<i32, 4>, 4>, 4>, %3:i32):i32 {
- %b1 = block {
+ $B1: {
%4:ptr<function, array<array<array<i32, 4>, 4>, 4>, read_write> = var, %2
%5:ptr<function, i32, read_write> = access %4, %3, 1u, %3
%6:i32 = load %5
@@ -280,7 +280,7 @@
auto* expect = R"(
%foo = func(%2:array<array<array<i32, 4>, 4>, 4>, %3:i32):i32 {
- %b1 = block {
+ $B1: {
%4:array<i32, 4> = access %2, 1u, 2u
%5:ptr<function, array<i32, 4>, read_write> = var, %4
%6:ptr<function, i32, read_write> = access %5, %3
@@ -307,7 +307,7 @@
auto* expect = R"(
%foo = func(%2:array<array<array<array<i32, 4>, 4>, 4>, 4>, %3:i32):i32 {
- %b1 = block {
+ $B1: {
%4:array<array<array<i32, 4>, 4>, 4> = access %2, 1u
%5:ptr<function, array<array<array<i32, 4>, 4>, 4>, read_write> = var, %4
%6:ptr<function, i32, read_write> = access %5, %3, 2u, %3
@@ -346,7 +346,7 @@
}
%foo = func(%2:MyStruct, %3:i32):f32 {
- %b1 = block {
+ $B1: {
%4:mat4x4<f32> = access %2, 1u
%5:ptr<function, mat4x4<f32>, read_write> = var, %4
%6:ptr<function, vec4<f32>, read_write> = access %5, %3
@@ -377,7 +377,7 @@
auto* expect = R"(
%foo = func(%2:array<i32, 4>, %3:i32, %4:i32, %5:i32):i32 {
- %b1 = block {
+ $B1: {
%6:ptr<function, array<i32, 4>, read_write> = var, %2
%7:ptr<function, i32, read_write> = access %6, %3
%8:i32 = load %7
@@ -411,7 +411,7 @@
auto* expect = R"(
%foo = func(%2:array<array<array<i32, 4>, 4>, 4>, %3:i32, %4:i32, %5:i32):i32 {
- %b1 = block {
+ $B1: {
%6:array<i32, 4> = access %2, 1u, 2u
%7:ptr<function, array<i32, 4>, read_write> = var, %6
%8:ptr<function, i32, read_write> = access %7, %3
@@ -450,13 +450,13 @@
auto* src = R"(
%func = func(%2:array<i32, 4>, %3:bool, %4:i32, %5:i32):i32 {
- %b1 = block {
- if %3 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %3 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
%6:i32 = access %2, %4
ret %6
}
- %b3 = block { # false
+ $B3: { # false
%7:i32 = access %2, %5
ret %7
}
@@ -469,15 +469,15 @@
auto* expect = R"(
%func = func(%2:array<i32, 4>, %3:bool, %4:i32, %5:i32):i32 {
- %b1 = block {
+ $B1: {
%6:ptr<function, array<i32, 4>, read_write> = var, %2
- if %3 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ if %3 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
%7:ptr<function, i32, read_write> = access %6, %4
%8:i32 = load %7
ret %8
}
- %b3 = block { # false
+ $B3: { # false
%9:ptr<function, i32, read_write> = access %6, %5
%10:i32 = load %9
ret %10
@@ -514,13 +514,13 @@
auto* src = R"(
%func = func(%2:array<array<i32, 4>, 4>, %3:bool, %4:i32, %5:i32):i32 {
- %b1 = block {
- if %3 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if %3 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
%6:i32 = access %2, 0u, %4
ret %6
}
- %b3 = block { # false
+ $B3: { # false
%7:i32 = access %2, 0u, %5
ret %7
}
@@ -533,16 +533,16 @@
auto* expect = R"(
%func = func(%2:array<array<i32, 4>, 4>, %3:bool, %4:i32, %5:i32):i32 {
- %b1 = block {
+ $B1: {
%6:array<i32, 4> = access %2, 0u
%7:ptr<function, array<i32, 4>, read_write> = var, %6
- if %3 [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ if %3 [t: $B2, f: $B3] { # if_1
+ $B2: { # true
%8:ptr<function, i32, read_write> = access %7, %4
%9:i32 = load %8
ret %9
}
- %b3 = block { # false
+ $B3: { # false
%10:ptr<function, i32, read_write> = access %7, %5
%11:i32 = load %10
ret %11
@@ -582,15 +582,15 @@
auto* src = R"(
%func = func(%2:bool, %3:i32, %4:i32):i32 {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block (%5:array<i32, 4>) { # body
- if %2 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2 (%5:array<i32, 4>): { # body
+ if %2 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
%6:i32 = access %5:array<i32, 4>, %3
ret %6
}
- %b4 = block { # false
+ $B4: { # false
%7:i32 = access %5:array<i32, 4>, %4
ret %7
}
@@ -606,17 +606,17 @@
auto* expect = R"(
%func = func(%2:bool, %3:i32, %4:i32):i32 {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block (%5:array<i32, 4>) { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2 (%5:array<i32, 4>): { # body
%6:ptr<function, array<i32, 4>, read_write> = var, %5:array<i32, 4>
- if %2 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ if %2 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
%7:ptr<function, i32, read_write> = access %6, %3
%8:i32 = load %7
ret %8
}
- %b4 = block { # false
+ $B4: { # false
%9:ptr<function, i32, read_write> = access %6, %4
%10:i32 = load %9
ret %10
@@ -661,15 +661,15 @@
auto* src = R"(
%func = func(%2:bool, %3:i32, %4:i32):i32 {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block (%5:array<array<i32, 4>, 4>) { # body
- if %2 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2 (%5:array<array<i32, 4>, 4>): { # body
+ if %2 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
%6:i32 = access %5:array<array<i32, 4>, 4>, 0u, %3
ret %6
}
- %b4 = block { # false
+ $B4: { # false
%7:i32 = access %5:array<array<i32, 4>, 4>, 0u, %4
ret %7
}
@@ -685,18 +685,18 @@
auto* expect = R"(
%func = func(%2:bool, %3:i32, %4:i32):i32 {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block (%5:array<array<i32, 4>, 4>) { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2 (%5:array<array<i32, 4>, 4>): { # body
%6:array<i32, 4> = access %5:array<array<i32, 4>, 4>, 0u
%7:ptr<function, array<i32, 4>, read_write> = var, %6
- if %2 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ if %2 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
%8:ptr<function, i32, read_write> = access %7, %3
%9:i32 = load %8
ret %9
}
- %b4 = block { # false
+ $B4: { # false
%10:ptr<function, i32, read_write> = access %7, %4
%11:i32 = load %10
ret %11
@@ -741,19 +741,19 @@
auto* src = R"(
%func_a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = access array<i32, 4>(0i), %2
ret %3
}
}
%func_b = func(%5:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = access array<i32, 4>(0i), %5
ret %6
}
}
%func_c = func(%8:i32):i32 {
- %b3 = block {
+ $B3: {
%9:i32 = access array<i32, 4>(0i), %8
ret %9
}
@@ -762,26 +762,26 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, array<i32, 4>, read_write> = var, array<i32, 4>(0i)
}
%func_a = func(%3:i32):i32 {
- %b2 = block {
+ $B2: {
%4:ptr<private, i32, read_write> = access %1, %3
%5:i32 = load %4
ret %5
}
}
%func_b = func(%7:i32):i32 {
- %b3 = block {
+ $B3: {
%8:ptr<private, i32, read_write> = access %1, %7
%9:i32 = load %8
ret %9
}
}
%func_c = func(%11:i32):i32 {
- %b4 = block {
+ $B4: {
%12:ptr<private, i32, read_write> = access %1, %11
%13:i32 = load %12
ret %13
@@ -821,19 +821,19 @@
auto* src = R"(
%func_a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = access array<array<i32, 4>, 4>(array<i32, 4>(0i)), 0u, %2
ret %3
}
}
%func_b = func(%5:i32):i32 {
- %b2 = block {
+ $B2: {
%6:i32 = access array<array<i32, 4>, 4>(array<i32, 4>(0i)), 0u, %5
ret %6
}
}
%func_c = func(%8:i32):i32 {
- %b3 = block {
+ $B3: {
%9:i32 = access array<array<i32, 4>, 4>(array<i32, 4>(0i)), 0u, %8
ret %9
}
@@ -842,26 +842,26 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, array<i32, 4>, read_write> = var, array<i32, 4>(0i)
}
%func_a = func(%3:i32):i32 {
- %b2 = block {
+ $B2: {
%4:ptr<private, i32, read_write> = access %1, %3
%5:i32 = load %4
ret %5
}
}
%func_b = func(%7:i32):i32 {
- %b3 = block {
+ $B3: {
%8:ptr<private, i32, read_write> = access %1, %7
%9:i32 = load %8
ret %9
}
}
%func_c = func(%11:i32):i32 {
- %b4 = block {
+ $B4: {
%12:ptr<private, i32, read_write> = access %1, %11
%13:i32 = load %12
ret %13
diff --git a/src/tint/lang/wgsl/reader/lower/lower_test.cc b/src/tint/lang/wgsl/reader/lower/lower_test.cc
index d77f991..4a0c91c 100644
--- a/src/tint/lang/wgsl/reader/lower/lower_test.cc
+++ b/src/tint/lang/wgsl/reader/lower/lower_test.cc
@@ -56,7 +56,7 @@
auto* src = R"(
%f = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = wgsl.max 1i, 2i
ret
}
@@ -66,7 +66,7 @@
auto* expect = R"(
%f = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = max 1i, 2i
ret
}
@@ -91,12 +91,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = wgsl.workgroupUniformLoad %wgvar
ret %3
}
@@ -105,12 +105,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%wgvar:ptr<workgroup, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:void = workgroupBarrier
%4:i32 = load %wgvar
%5:void = workgroupBarrier
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc
index 2e53fca..cb5294e 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/accessor_test.cc
@@ -55,7 +55,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<u32, 3>, read_write> = var
%3:ptr<function, u32, read_write> = access %a, 2u
%4:u32 = load %3
@@ -81,7 +81,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<u32, 3>, read_write> = var
%p:ptr<function, array<u32, 3>, read_write> = let %a
%4:ptr<function, u32, read_write> = access %p, 2u
@@ -108,7 +108,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<u32, 3>, read_write> = var
%p:ptr<function, array<u32, 3>, read_write> = let %a
%4:ptr<function, u32, read_write> = access %p, 2u
@@ -136,7 +136,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:vec3<u32> = let vec3<u32>(0u)
%3:u32 = access %a, 2u
%b:u32 = let %3
@@ -161,7 +161,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec3<u32>, read_write> = var
%3:u32 = load_vector_element %a, 2u
%b:u32 = let %3
@@ -186,7 +186,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec3<u32>, read_write> = var
%p:ptr<function, vec3<u32>, read_write> = let %a
%4:u32 = load_vector_element %p, 2u
@@ -212,7 +212,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec3<u32>, read_write> = var
%p:ptr<function, vec3<u32>, read_write> = let %a
%4:u32 = load_vector_element %p, 2u
@@ -236,7 +236,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<array<f32, 4>, 3>, read_write> = var
%3:ptr<function, f32, read_write> = access %a, 2u, 3u
%4:f32 = load %3
@@ -262,7 +262,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<array<f32, 4>, 3>, read_write> = var
%p:ptr<function, array<array<f32, 4>, 3>, read_write> = let %a
%4:ptr<function, f32, read_write> = access %p, 2u, 3u
@@ -289,7 +289,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<array<f32, 4>, 3>, read_write> = var
%p:ptr<function, array<array<f32, 4>, 3>, read_write> = let %a
%4:ptr<function, f32, read_write> = access %p, 2u, 3u
@@ -314,7 +314,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, mat3x4<f32>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %a, 2u
%4:f32 = load_vector_element %3, 3u
@@ -346,7 +346,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, MyStruct, read_write> = var
%3:ptr<function, i32, read_write> = access %a, 0u
%4:i32 = load %3
@@ -380,7 +380,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, MyStruct, read_write> = var
%p:ptr<function, MyStruct, read_write> = let %a
%4:ptr<function, i32, read_write> = access %p, 0u
@@ -415,7 +415,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, MyStruct, read_write> = var
%p:ptr<function, MyStruct, read_write> = let %a
%4:ptr<function, i32, read_write> = access %p, 0u
@@ -458,7 +458,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, Outer, read_write> = var
%3:ptr<function, f32, read_write> = access %a, 1u, 0u
%4:f32 = load %3
@@ -506,7 +506,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<Outer, 4>, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %a, 0u, 1u, 1u, 2u
%4:vec4<f32> = load %3
@@ -530,7 +530,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, array<u32, 4>, read_write> = var
%3:ptr<function, u32, read_write> = access %a, 2u
store %3, 0u
@@ -553,7 +553,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec2<f32>, read_write> = var
%3:f32 = load_vector_element %a, 1u
%b:f32 = let %3
@@ -578,7 +578,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec2<f32>, read_write> = var
%p:ptr<function, vec2<f32>, read_write> = let %a
%4:f32 = load_vector_element %p, 1u
@@ -604,7 +604,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec2<f32>, read_write> = var
%p:ptr<function, vec2<f32>, read_write> = let %a
%4:f32 = load_vector_element %p, 1u
@@ -628,7 +628,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec3<f32>, read_write> = var
%3:vec3<f32> = load %a
%4:vec4<f32> = swizzle %3, zyxz
@@ -652,7 +652,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, vec3<f32>, read_write> = var
%3:vec3<f32> = load %a
%4:vec3<f32> = swizzle %3, zyx
@@ -689,7 +689,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, MyStruct, read_write> = var
%3:ptr<function, vec4<f32>, read_write> = access %a, 1u
%4:vec4<f32> = load %3
@@ -715,7 +715,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:vec3<u32> = let vec3<u32>(0u)
%3:u32 = access %a, 2u
%b:u32 = let %3
@@ -738,7 +738,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:mat3x4<f32> = let mat3x4<f32>(vec4<f32>(0.0f))
%3:f32 = access %a, 2u, 3u
%b:f32 = let %3
@@ -769,7 +769,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:MyStruct = let MyStruct(0i)
%3:i32 = access %a, 0u
%b:i32 = let %3
@@ -810,7 +810,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:Outer = let Outer(0i, Inner(0.0f))
%3:f32 = access %a, 1u, 0u
%b:f32 = let %3
@@ -857,7 +857,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:array<Outer, 4> = let array<Outer, 4>(Outer(0i, array<Inner, 4>(Inner(0i, 0.0f, vec4<f32>(0.0f)))))
%3:vec4<f32> = access %a, 0u, 1u, 1u, 2u
%b:vec4<f32> = let %3
@@ -880,7 +880,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:vec2<f32> = let vec2<f32>(0.0f)
%3:f32 = access %a, 1u
%b:f32 = let %3
@@ -903,7 +903,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:vec3<f32> = let vec3<f32>(0.0f)
%3:vec4<f32> = swizzle %a, zyxz
%b:vec4<f32> = let %3
@@ -926,7 +926,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:vec3<f32> = let vec3<f32>(0.0f)
%3:vec3<f32> = swizzle %a, zyx
%4:vec2<f32> = swizzle %3, yy
@@ -962,7 +962,7 @@
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:MyStruct = let MyStruct(0i, vec4<f32>(0.0f))
%3:vec4<f32> = access %a, 1u
%4:vec3<f32> = swizzle %3, zyx
@@ -990,7 +990,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%i:i32 = let 1i
%3:i32 = access vec3<i32>(1i, 2i, 3i), %i
%b:ptr<function, i32, read_write> = var, %3
@@ -1015,7 +1015,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%i:i32 = let 1i
%3:i32 = access vec2<i32>(1i, 2i), %i
%b:ptr<function, i32, read_write> = var, %3
@@ -1040,7 +1040,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%i:i32 = let 1i
%3:i32 = add %i, 2i
%4:i32 = sub %3, 3i
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc
index ff89135..79b7366 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/binary_test.cc
@@ -47,12 +47,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = add %3, 4u
%tint_symbol:u32 = let %4
@@ -70,12 +70,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = add %3, 1u
store %v1, %4
@@ -93,12 +93,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = add %3, 1u
store %v1, %4
@@ -117,12 +117,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = sub %3, 4u
%tint_symbol:u32 = let %4
@@ -140,12 +140,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, i32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:i32 = load %v1
%4:i32 = sub %3, 1i
store %v1, %4
@@ -163,12 +163,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = sub %3, 1u
store %v1, %4
@@ -187,12 +187,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = mul %3, 4u
%tint_symbol:u32 = let %4
@@ -210,12 +210,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = mul %3, 1u
store %v1, %4
@@ -234,12 +234,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = div %3, 4u
%tint_symbol:u32 = let %4
@@ -257,12 +257,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = div %3, 1u
store %v1, %4
@@ -281,12 +281,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = mod %3, 4u
%tint_symbol:u32 = let %4
@@ -304,12 +304,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = mod %3, 1u
store %v1, %4
@@ -328,12 +328,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = and %3, 4u
%tint_symbol:u32 = let %4
@@ -351,12 +351,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, bool, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:bool = load %v1
%4:bool = and %3, false
store %v1, %4
@@ -375,12 +375,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = or %3, 4u
%tint_symbol:u32 = let %4
@@ -398,12 +398,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, bool, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:bool = load %v1
%4:bool = or %3, false
store %v1, %4
@@ -422,12 +422,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = xor %3, 4u
%tint_symbol:u32 = let %4
@@ -445,12 +445,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = xor %3, 1u
store %v1, %4
@@ -470,24 +470,24 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():bool {
- %b1 = block {
+ $B1: {
ret true
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:bool = call %my_func
- %4:bool = if %3 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ %4:bool = if %3 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
exit_if false # if_1
}
- %b4 = block { # false
+ $B4: { # false
exit_if false # if_1
}
}
%logical_and:bool = let %4
- if %logical_and [t: %b5] { # if_2
- %b5 = block { # true
+ if %logical_and [t: $B5] { # if_2
+ $B5: { # true
exit_if # if_2
}
}
@@ -507,24 +507,24 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():bool {
- %b1 = block {
+ $B1: {
ret true
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:bool = call %my_func
- %4:bool = if %3 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ %4:bool = if %3 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
exit_if true # if_1
}
- %b4 = block { # false
+ $B4: { # false
exit_if true # if_1
}
}
%logical_or:bool = let %4
- if %logical_or [t: %b5] { # if_2
- %b5 = block { # true
+ if %logical_or [t: $B5] { # if_2
+ $B5: { # true
exit_if # if_2
}
}
@@ -543,12 +543,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:bool = eq %3, 4u
%tint_symbol:bool = let %4
@@ -567,12 +567,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:bool = neq %3, 4u
%tint_symbol:bool = let %4
@@ -591,12 +591,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:bool = lt %3, 4u
%tint_symbol:bool = let %4
@@ -615,12 +615,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:bool = gt %3, 4u
%tint_symbol:bool = let %4
@@ -639,12 +639,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:bool = lte %3, 4u
%tint_symbol:bool = let %4
@@ -663,12 +663,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:bool = gte %3, 4u
%tint_symbol:bool = let %4
@@ -687,12 +687,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = shl %3, 4u
%tint_symbol:u32 = let %4
@@ -710,12 +710,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = shl %3, 1u
store %v1, %4
@@ -734,12 +734,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 0u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = shr %3, 4u
%tint_symbol:u32 = let %4
@@ -757,12 +757,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = load %v1
%4:u32 = shr %3, 1u
store %v1, %4
@@ -783,16 +783,16 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():f32 {
- %b1 = block {
+ $B1: {
ret 0.0f
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:f32 = call %my_func
%4:bool = lt %3, 2.0f
- %5:bool = if %4 [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ %5:bool = if %4 [t: $B3, f: $B4] { # if_1
+ $B3: { # true
%6:f32 = call %my_func
%7:f32 = call %my_func
%8:f32 = mul 2.29999995231628417969f, %7
@@ -800,7 +800,7 @@
%10:bool = gt 2.5f, %9
exit_if %10 # if_1
}
- %b4 = block { # false
+ $B4: { # false
exit_if false # if_1
}
}
@@ -821,12 +821,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func(%p:bool):bool {
- %b1 = block {
+ $B1: {
ret true
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%4:bool = call %my_func, false
%tint_symbol:bool = let %4
ret
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc
index fc2a3ce..7423f12 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/builtin_test.cc
@@ -46,12 +46,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%i:ptr<private, f32, read_write> = var, 1.0f
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:f32 = load %i
%4:f32 = asin %3
%tint_symbol:f32 = let %4
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc
index ec5a82d..eb3dac7 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/call_test.cc
@@ -49,12 +49,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():f32 {
- %b1 = block {
+ $B1: {
ret 0.0f
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:f32 = call %my_func
%4:f32 = bitcast %3
%tint_symbol:f32 = let %4
@@ -75,7 +75,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test_function = @fragment func():void {
- %b1 = block {
+ $B1: {
discard
ret
}
@@ -92,12 +92,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func(%p:f32):void {
- %b1 = block {
+ $B1: {
ret
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%4:void = call %my_func, 6.0f
ret
}
@@ -113,12 +113,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%i:ptr<private, i32, read_write> = var, 1i
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:i32 = load %i
%4:f32 = convert %3
%tint_symbol:f32 = let %4
@@ -135,7 +135,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%i:ptr<private, vec3<f32>, read_write> = var, vec3<f32>(0.0f)
}
@@ -150,12 +150,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%i:ptr<private, f32, read_write> = var, 1.0f
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:f32 = load %i
%4:vec3<f32> = construct 2.0f, 3.0f, %3
%tint_symbol:vec3<f32> = let %4
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc
index 7c1275a..1af67b1 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/function_test.cc
@@ -48,7 +48,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test = @vertex func():vec4<f32> [@position] {
- %b1 = block {
+ $B1: {
ret vec4<f32>(0.0f)
}
}
@@ -63,7 +63,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test = @fragment func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -79,7 +79,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test = @compute @workgroup_size(8, 4, 2) func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -94,7 +94,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test = func():vec3<f32> {
- %b1 = block {
+ $B1: {
ret vec3<f32>(0.0f)
}
}
@@ -109,12 +109,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test = func():f32 {
- %b1 = block {
- if true [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret 0.0f
}
- %b3 = block { # false
+ $B3: { # false
ret 1.0f
}
}
@@ -133,7 +133,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test = @vertex func():vec4<f32> [@position] {
- %b1 = block {
+ $B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
}
}
@@ -150,7 +150,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test = @vertex func():vec4<f32> [@invariant, @position] {
- %b1 = block {
+ $B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
}
}
@@ -166,7 +166,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test = @fragment func():vec4<f32> [@location(1)] {
- %b1 = block {
+ $B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
}
}
@@ -184,7 +184,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test = @fragment func():vec4<f32> [@location(1), @interpolate(linear, centroid)] {
- %b1 = block {
+ $B1: {
ret vec4<f32>(1.0f, 2.0f, 3.0f, 4.0f)
}
}
@@ -200,7 +200,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test = @fragment func():f32 [@frag_depth] {
- %b1 = block {
+ $B1: {
ret 1.0f
}
}
@@ -216,7 +216,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test = @fragment func():u32 [@sample_mask] {
- %b1 = block {
+ $B1: {
ret 1u
}
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc
index 37797e6..8b67280 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/let_test.cc
@@ -46,7 +46,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:i32 = let 42i
ret
}
@@ -62,7 +62,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:i32 = let 3i
ret
}
@@ -80,7 +80,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:i32 = let 1i
%b:i32 = let %a
%c:i32 = let %b
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc
index eaa4767..7b1b1e6 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/materialize_test.cc
@@ -47,7 +47,7 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%test_function = func():f32 {
- %b1 = block {
+ $B1: {
ret 2.0f
}
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc
index ac94da8..2c7845c 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/program_to_ir_test.cc
@@ -84,7 +84,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -105,7 +105,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func(%a:u32):u32 {
- %b1 = block {
+ $B1: {
ret %a
}
}
@@ -127,7 +127,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func(%a:u32, %b:i32, %c:bool):void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -156,12 +156,12 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- if true [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2, f: $B3] { # if_1
+ $B2: { # true
exit_if # if_1
}
- %b3 = block { # false
+ $B3: { # false
exit_if # if_1
}
}
@@ -184,9 +184,9 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
ret
}
}
@@ -209,12 +209,12 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- if true [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2, f: $B3] { # if_1
+ $B2: { # true
exit_if # if_1
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -237,12 +237,12 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- if true [t: %b2, f: %b3] { # if_1
- %b2 = block { # true
+ $B1: {
+ if true [t: $B2, f: $B3] { # if_1
+ $B2: { # true
ret
}
- %b3 = block { # false
+ $B3: { # false
ret
}
}
@@ -264,11 +264,11 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- if true [t: %b2] { # if_1
- %b2 = block { # true
- loop [b: %b3] { # loop_1
- %b3 = block { # body
+ $B1: {
+ if true [t: $B2] { # if_1
+ $B2: { # true
+ loop [b: $B3] { # loop_1
+ $B3: { # body
exit_loop # loop_1
}
}
@@ -298,9 +298,9 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
exit_loop # loop_1
}
}
@@ -328,18 +328,18 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- if true [t: %b4] { # if_1
- %b4 = block { # true
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ if true [t: $B4] { # if_1
+ $B4: { # true
exit_loop # loop_1
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -366,13 +366,13 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
- break_if true %b2
+ $B3: { # continuing
+ break_if true $B2
}
}
ret
@@ -393,14 +393,14 @@
auto m = res.Move();
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%a:bool = let true
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
- break_if %a %b2
+ $B3: { # continuing
+ break_if %a $B2
}
}
ret
@@ -427,18 +427,18 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- if true [t: %b4] { # if_1
- %b4 = block { # true
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ if true [t: $B4] { # if_1
+ $B4: { # true
ret
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
unreachable
@@ -464,9 +464,9 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
ret
}
}
@@ -502,14 +502,14 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
ret
}
}
- if true [t: %b3] { # if_1
- %b3 = block { # true
+ if true [t: $B3] { # if_1
+ $B3: { # true
ret
}
}
@@ -537,14 +537,14 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
- if true [t: %b3, f: %b4] { # if_1
- %b3 = block { # true
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
+ if true [t: $B3, f: $B4] { # if_1
+ $B3: { # true
exit_loop # loop_1
}
- %b4 = block { # false
+ $B4: { # false
exit_loop # loop_1
}
}
@@ -576,49 +576,49 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- loop [b: %b4, c: %b5] { # loop_2
- %b4 = block { # body
- if true [t: %b6] { # if_1
- %b6 = block { # true
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ loop [b: $B4, c: $B5] { # loop_2
+ $B4: { # body
+ if true [t: $B6] { # if_1
+ $B6: { # true
exit_loop # loop_2
}
}
- if true [t: %b7] { # if_2
- %b7 = block { # true
- continue %b5
+ if true [t: $B7] { # if_2
+ $B7: { # true
+ continue $B5
}
}
- continue %b5
+ continue $B5
}
- %b5 = block { # continuing
- loop [b: %b8] { # loop_3
- %b8 = block { # body
+ $B5: { # continuing
+ loop [b: $B8] { # loop_3
+ $B8: { # body
exit_loop # loop_3
}
}
- loop [b: %b9, c: %b10] { # loop_4
- %b9 = block { # body
- continue %b10
+ loop [b: $B9, c: $B10] { # loop_4
+ $B9: { # body
+ continue $B10
}
- %b10 = block { # continuing
- break_if true %b9
+ $B10: { # continuing
+ break_if true $B9
}
}
- next_iteration %b4
+ next_iteration $B4
}
}
- if true [t: %b11] { # if_3
- %b11 = block { # true
+ if true [t: $B11] { # if_3
+ $B11: { # true
exit_loop # loop_1
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -644,21 +644,21 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- if false [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ if false [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -684,21 +684,21 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- if true [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ $B1: {
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ if true [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
ret
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
ret
@@ -724,30 +724,30 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
+ $B1: {
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
%i:ptr<function, i32, read_write> = var
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%3:i32 = load %i
%4:bool = lt %3, 10i
- if %4 [t: %b5, f: %b6] { # if_1
- %b5 = block { # true
+ if %4 [t: $B5, f: $B6] { # if_1
+ $B5: { # true
exit_if # if_1
}
- %b6 = block { # false
+ $B6: { # false
exit_loop # loop_1
}
}
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%5:i32 = load %i
%6:i32 = add %5, 1i
store %i, %6
- next_iteration %b3
+ next_iteration $B3
}
}
ret
@@ -773,13 +773,13 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ $B1: {
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%i:ptr<function, i32, read_write> = var
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
exit_loop # loop_1
}
}
@@ -806,9 +806,9 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ $B1: {
+ loop [b: $B2] { # loop_1
+ $B2: { # body
exit_loop # loop_1
}
}
@@ -851,15 +851,15 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- switch 1i [c: (0i, %b2), c: (1i, %b3), c: (default, %b4)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch 1i [c: (0i, $B2), c: (1i, $B3), c: (default, $B4)] { # switch_1
+ $B2: { # case
exit_switch # switch_1
}
- %b3 = block { # case
+ $B3: { # case
exit_switch # switch_1
}
- %b4 = block { # case
+ $B4: { # case
exit_switch # switch_1
}
}
@@ -899,9 +899,9 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- switch 1i [c: (0i 1i default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch 1i [c: (0i 1i default, $B2)] { # switch_1
+ $B2: { # case
exit_switch # switch_1
}
}
@@ -930,9 +930,9 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- switch 1i [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch 1i [c: (default, $B2)] { # switch_1
+ $B2: { # case
exit_switch # switch_1
}
}
@@ -970,12 +970,12 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- switch 1i [c: (0i, %b2), c: (default, %b3)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch 1i [c: (0i, $B2), c: (default, $B3)] { # switch_1
+ $B2: { # case
exit_switch # switch_1
}
- %b3 = block { # case
+ $B3: { # case
exit_switch # switch_1
}
}
@@ -1012,12 +1012,12 @@
EXPECT_EQ(Disassemble(m),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
- switch 1i [c: (0i, %b2), c: (default, %b3)] { # switch_1
- %b2 = block { # case
+ $B1: {
+ switch 1i [c: (0i, $B2), c: (default, $B3)] { # switch_1
+ $B2: { # case
ret
}
- %b3 = block { # case
+ $B3: { # case
ret
}
}
@@ -1036,12 +1036,12 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%b = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:i32 = call %b
ret
}
@@ -1061,7 +1061,7 @@
EXPECT_EQ(
Disassemble(m.Get()),
R"(%f = @fragment func(%a:vec4<f32> [@invariant, @position]):vec4<f32> [@location(1)] {
- %b1 = block {
+ $B1: {
ret %a
}
}
@@ -1077,7 +1077,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = @fragment func(%a:f32 [@location(2)]):f32 [@location(1)] {
- %b1 = block {
+ $B1: {
ret %a
}
}
@@ -1098,7 +1098,7 @@
EXPECT_EQ(
Disassemble(m.Get()),
R"(%f = @fragment func(%a:f32 [@location(2), @interpolate(linear, centroid)]):f32 [@location(1)] {
- %b1 = block {
+ $B1: {
ret %a
}
}
@@ -1117,7 +1117,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = @fragment func(%a:f32 [@location(2), @interpolate(flat)]):f32 [@location(1)] {
- %b1 = block {
+ $B1: {
ret %a
}
}
@@ -1139,7 +1139,7 @@
EXPECT_EQ(m->functions[0]->Stage(), core::ir::Function::PipelineStage::kUndefined);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -1161,7 +1161,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc
index 4e4c940..6160b5b 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/shadowing_test.cc
@@ -64,7 +64,7 @@
}
%f = func():i32 {
- %b1 = block {
+ $B1: {
%S:ptr<function, S, read_write> = var, S(0i)
%3:ptr<function, i32, read_write> = access %S, 0u
%4:i32 = load %3
@@ -92,7 +92,7 @@
}
%f = func(%S:S):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = access %S, 0u
ret %3
}
@@ -113,12 +113,12 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%i:ptr<private, i32, read_write> = var, 1i
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = load %i
%4:i32 = add %3, 1i
store %i, %4
@@ -145,12 +145,12 @@
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%i:ptr<private, i32, read_write> = var, 1i
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = load %i
%4:i32 = add %3, 1i
store %i, %4
@@ -179,10 +179,10 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
%3:i32 = load %i
%4:i32 = add %3, 1i
store %i, %4
@@ -218,10 +218,10 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
%3:i32 = load %i
%4:i32 = add %3, 1i
store %i, %4
@@ -253,17 +253,17 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %i
%4:bool = lt %3, 4i
- if %4 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ if %4 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
@@ -273,8 +273,8 @@
%8:i32 = load %i_1
ret %8
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
%9:i32 = load %i
@@ -299,17 +299,17 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %i
%4:bool = lt %3, 4i
- if %4 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ if %4 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
@@ -318,8 +318,8 @@
%i_1:i32 = let %6 # %i_1: 'i'
ret %i_1
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
%8:i32 = load %i
@@ -343,27 +343,27 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%i_1:ptr<function, f32, read_write> = var, 0.0f # %i_1: 'i'
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%4:f32 = load %i_1
%5:bool = lt %4, 4.0f
- if %5 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ if %5 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
%6:f32 = load %i_1
%j:f32 = let %6
- continue %b6
+ continue $B6
}
}
%8:i32 = load %i
@@ -387,25 +387,25 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%i_1:f32 = let 0.0f # %i_1: 'i'
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%4:bool = lt %i_1, 4.0f
- if %4 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ if %4 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
%j:f32 = let %i_1
- continue %b6
+ continue $B6
}
}
%6:i32 = load %i
@@ -430,21 +430,21 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%x:ptr<function, i32, read_write> = var, 0i
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%4:i32 = load %i
%5:bool = lt %4, 4i
- if %5 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ if %5 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
@@ -477,21 +477,21 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%x:ptr<function, i32, read_write> = var, 0i
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%4:i32 = load %i
%5:bool = lt %4, 4i
- if %5 [t: %b4, f: %b5] { # if_1
- %b4 = block { # true
+ if %5 [t: $B4, f: $B5] { # if_1
+ $B4: { # true
exit_if # if_1
}
- %b5 = block { # false
+ $B5: { # false
exit_loop # loop_1
}
}
@@ -528,14 +528,14 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %i
%4:bool = eq %3, 2i
- if %4 [t: %b4] { # if_1
- %b4 = block { # true
+ if %4 [t: $B4] { # if_1
+ $B4: { # true
exit_loop # loop_1
}
}
@@ -544,15 +544,15 @@
%i_1:ptr<function, i32, read_write> = var, %6 # %i_1: 'i'
%8:i32 = load %i_1
%9:bool = eq %8, 3i
- if %9 [t: %b5] { # if_2
- %b5 = block { # true
+ if %9 [t: $B5] { # if_2
+ $B5: { # true
exit_loop # loop_1
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
%10:i32 = load %i
@@ -582,14 +582,14 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %i
%4:bool = eq %3, 2i
- if %4 [t: %b4] { # if_1
- %b4 = block { # true
+ if %4 [t: $B4] { # if_1
+ $B4: { # true
exit_loop # loop_1
}
}
@@ -597,15 +597,15 @@
%6:i32 = add %5, 1i
%i_1:i32 = let %6 # %i_1: 'i'
%8:bool = eq %i_1, 3i
- if %8 [t: %b5] { # if_2
- %b5 = block { # true
+ if %8 [t: $B5] { # if_2
+ $B5: { # true
exit_loop # loop_1
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
- next_iteration %b2
+ $B3: { # continuing
+ next_iteration $B2
}
}
%9:i32 = load %i
@@ -636,26 +636,26 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %i
%4:bool = eq %3, 2i
- if %4 [t: %b4] { # if_1
- %b4 = block { # true
+ if %4 [t: $B4] { # if_1
+ $B4: { # true
exit_loop # loop_1
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
%5:i32 = load %i
%6:i32 = add %5, 1i
%i_1:ptr<function, i32, read_write> = var, %6 # %i_1: 'i'
%8:i32 = load %i_1
%9:bool = gt %8, 2i
- break_if %9 %b2
+ break_if %9 $B2
}
}
%10:i32 = load %i
@@ -686,25 +686,25 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %i
%4:bool = eq %3, 2i
- if %4 [t: %b4] { # if_1
- %b4 = block { # true
+ if %4 [t: $B4] { # if_1
+ $B4: { # true
exit_loop # loop_1
}
}
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
%5:i32 = load %i
%6:i32 = add %5, 1i
%i_1:i32 = let %6 # %i_1: 'i'
%8:bool = gt %i_1, 2i
- break_if %8 %b2
+ break_if %8 $B2
}
}
%9:i32 = load %i
@@ -736,22 +736,22 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
%3:i32 = load %i
- switch %3 [c: (0i, %b2), c: (1i, %b3), c: (default, %b4)] { # switch_1
- %b2 = block { # case
+ switch %3 [c: (0i, $B2), c: (1i, $B3), c: (default, $B4)] { # switch_1
+ $B2: { # case
%4:i32 = load %i
ret %4
}
- %b3 = block { # case
+ $B3: { # case
%5:i32 = load %i
%6:i32 = add %5, 1i
%i_1:ptr<function, i32, read_write> = var, %6 # %i_1: 'i'
%8:i32 = load %i_1
ret %8
}
- %b4 = block { # case
+ $B4: { # case
%9:i32 = load %i
ret %9
}
@@ -784,21 +784,21 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%f = func():i32 {
- %b1 = block {
+ $B1: {
%i:ptr<function, i32, read_write> = var
%3:i32 = load %i
- switch %3 [c: (0i, %b2), c: (1i, %b3), c: (default, %b4)] { # switch_1
- %b2 = block { # case
+ switch %3 [c: (0i, $B2), c: (1i, $B3), c: (default, $B4)] { # switch_1
+ $B2: { # case
%4:i32 = load %i
ret %4
}
- %b3 = block { # case
+ $B3: { # case
%5:i32 = load %i
%6:i32 = add %5, 1i
%i_1:i32 = let %6 # %i_1: 'i'
ret %i_1
}
- %b4 = block { # case
+ $B4: { # case
%8:i32 = load %i
ret %8
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc
index 997e5d9..b2ac91e 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/store_test.cc
@@ -47,12 +47,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%a:ptr<private, u32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
store %a, 4u
ret
}
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc
index 24084e4..8342e48 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/unary_test.cc
@@ -47,12 +47,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():bool {
- %b1 = block {
+ $B1: {
ret false
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:bool = call %my_func
%4:bool = eq %3, false
%tint_symbol:bool = let %4
@@ -71,12 +71,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():vec4<bool> {
- %b1 = block {
+ $B1: {
ret vec4<bool>(false)
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:vec4<bool> = call %my_func
%4:vec4<bool> = eq %3, vec4<bool>(false)
%tint_symbol:vec4<bool> = let %4
@@ -95,12 +95,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():u32 {
- %b1 = block {
+ $B1: {
ret 1u
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:u32 = call %my_func
%4:u32 = complement %3
%tint_symbol:u32 = let %4
@@ -119,12 +119,12 @@
ASSERT_EQ(m, Success);
EXPECT_EQ(Disassemble(m.Get()), R"(%my_func = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%3:i32 = call %my_func
%4:i32 = negation %3
%tint_symbol:i32 = let %4
@@ -143,12 +143,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, i32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%v2:ptr<private, i32, read_write> = let %v1
ret
}
@@ -167,12 +167,12 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%v1:ptr<private, i32, read_write> = var
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%v3:ptr<private, i32, read_write> = let %v1
store %v3, 42i
ret
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc b/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc
index 690be95..c683285 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc
+++ b/src/tint/lang/wgsl/reader/program_to_ir/var_test.cc
@@ -45,7 +45,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%a:ptr<private, u32, read_write> = var
}
@@ -59,7 +59,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%a:ptr<private, u32, read_write> = var, 2u
}
@@ -72,7 +72,7 @@
auto m = Build();
ASSERT_EQ(m, Success);
- EXPECT_EQ(Disassemble(m.Get()), R"(%b1 = block { # root
+ EXPECT_EQ(Disassemble(m.Get()), R"($B1: { # root
%a:ptr<storage, u32, read> = var @binding_point(2, 3)
}
@@ -88,7 +88,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, u32, read_write> = var
ret
}
@@ -106,7 +106,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, u32, read_write> = var, 2u
ret
}
@@ -124,7 +124,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, u32, read_write> = var
%3:u32 = load %a
%4:u32 = add %3, 2u
@@ -144,7 +144,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, i32, read_write> = var
store %a, 42i
ret
@@ -181,12 +181,12 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = func(%p:i32):i32 {
- %b1 = block {
+ $B1: {
ret %p
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%a:ptr<function, array<array<array<i32, 5>, 5>, 5>, read_write> = var
%5:i32 = call %f, 1i
%6:i32 = call %f, 2i
@@ -227,12 +227,12 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = func(%p:i32):i32 {
- %b1 = block {
+ $B1: {
ret %p
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%a:ptr<function, array<vec4<f32>, 5>, read_write> = var
%5:i32 = call %f, 1i
%6:ptr<function, vec4<f32>, read_write> = access %a, %5
@@ -275,12 +275,12 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = func(%p:i32):i32 {
- %b1 = block {
+ $B1: {
ret %p
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%a:ptr<function, array<mat3x4<f32>, 5>, read_write> = var
%5:i32 = call %f, 1i
%6:i32 = call %f, 2i
@@ -307,7 +307,7 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b1 = block {
+ $B1: {
%a:ptr<function, i32, read_write> = var
%3:i32 = load %a
%4:i32 = add %3, 42i
@@ -346,12 +346,12 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = func(%p:i32):i32 {
- %b1 = block {
+ $B1: {
ret %p
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%a:ptr<function, array<array<array<i32, 5>, 5>, 5>, read_write> = var
%5:i32 = call %f, 1i
%6:i32 = call %f, 2i
@@ -398,12 +398,12 @@
EXPECT_EQ(Disassemble(m.Get()),
R"(%f = func(%p:i32):i32 {
- %b1 = block {
+ $B1: {
ret %p
}
}
%test_function = @compute @workgroup_size(1, 1, 1) func():void {
- %b2 = block {
+ $B2: {
%a:ptr<function, array<mat3x4<f32>, 5>, read_write> = var
%5:i32 = call %f, 1i
%6:i32 = call %f, 2i
diff --git a/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc b/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc
index ea176bb..b663af0 100644
--- a/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc
+++ b/src/tint/lang/wgsl/writer/raise/ptr_to_ref_test.cc
@@ -86,7 +86,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, i32, read_write>):void {
- %b1 = block {
+ $B1: {
ret
}
}
@@ -104,7 +104,7 @@
b.Append(mod.root_block, [&] { b.Var(ty.ptr<private_, i32>()); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, i32, read_write> = var
}
@@ -112,7 +112,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%1:ref<private, i32, read_write> = var
}
@@ -132,7 +132,7 @@
auto* src = R"(
%1 = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = load %2
ret %3
@@ -143,7 +143,7 @@
auto* expect = R"(
%1 = func():i32 {
- %b1 = block {
+ $B1: {
%2:ref<function, i32, read_write> = var
%3:i32 = load %2
ret %3
@@ -166,7 +166,7 @@
auto* src = R"(
%1 = func():void {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 42i
ret
@@ -177,7 +177,7 @@
auto* expect = R"(
%1 = func():void {
- %b1 = block {
+ $B1: {
%2:ref<function, i32, read_write> = var
store %2, 42i
ret
@@ -198,7 +198,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, i32, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = load %2
ret %3
}
@@ -208,7 +208,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, i32, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:ref<function, i32, read_write> = ptr-to-ref %2
%4:i32 = load %3
ret %4
@@ -232,7 +232,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, i32, read_write>):void {
- %b1 = block {
+ $B1: {
store %2, 42i
ret
}
@@ -242,7 +242,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, i32, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ref<function, i32, read_write> = ptr-to-ref %2
store %3, 42i
ret
@@ -268,12 +268,12 @@
auto* src = R"(
%1 = func(%p:ptr<function, i32, read_write>):void {
- %b1 = block {
+ $B1: {
ret
}
}
%3 = func():void {
- %b2 = block {
+ $B2: {
%4:ptr<function, i32, read_write> = var
%5:void = call %1, %4
ret
@@ -284,12 +284,12 @@
auto* expect = R"(
%1 = func(%p:ptr<function, i32, read_write>):void {
- %b1 = block {
+ $B1: {
ret
}
}
%3 = func():void {
- %b2 = block {
+ $B2: {
%4:ref<function, i32, read_write> = var
%5:ptr<function, i32, read_write> = ref-to-ptr %4
%6:void = call %1, %5
@@ -314,7 +314,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, i32, read_write>):i32 {
- %b1 = block {
+ $B1: {
%l:ptr<function, i32, read_write> = let %2
%4:i32 = load %l
ret %4
@@ -325,7 +325,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, i32, read_write>):i32 {
- %b1 = block {
+ $B1: {
%l:ptr<function, i32, read_write> = let %2
%4:ref<function, i32, read_write> = ptr-to-ref %l
%5:i32 = load %4
@@ -351,7 +351,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, i32, read_write>):void {
- %b1 = block {
+ $B1: {
%l:ptr<function, i32, read_write> = let %2
store %l, 42i
ret
@@ -362,7 +362,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, i32, read_write>):void {
- %b1 = block {
+ $B1: {
%l:ptr<function, i32, read_write> = let %2
%4:ref<function, i32, read_write> = ptr-to-ref %l
store %4, 42i
@@ -387,7 +387,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:ptr<function, i32, read_write> = access %2, 2i
%4:i32 = load %3
ret %4
@@ -398,7 +398,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:ref<function, array<i32, 4>, read_write> = ptr-to-ref %2
%4:ref<function, i32, read_write> = access %3, 2i
%5:i32 = load %4
@@ -424,7 +424,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, i32, read_write> = access %2, 2i
store %3, 42i
ret
@@ -435,7 +435,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ref<function, array<i32, 4>, read_write> = ptr-to-ref %2
%4:ref<function, i32, read_write> = access %3, 2i
store %4, 42i
@@ -461,7 +461,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:ptr<function, i32, read_write> = access %2, 2i
%l:ptr<function, i32, read_write> = let %3
%5:i32 = load %l
@@ -473,7 +473,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:ref<function, array<i32, 4>, read_write> = ptr-to-ref %2
%4:ref<function, i32, read_write> = access %3, 2i
%5:ptr<function, i32, read_write> = ref-to-ptr %4
@@ -503,7 +503,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, i32, read_write> = access %2, 2i
%l:ptr<function, i32, read_write> = let %3
store %l, 42i
@@ -515,7 +515,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, array<i32, 4>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ref<function, array<i32, 4>, read_write> = ptr-to-ref %2
%4:ref<function, i32, read_write> = access %3, 2i
%5:ptr<function, i32, read_write> = ref-to-ptr %4
@@ -540,7 +540,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, vec3<i32>, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:i32 = load_vector_element %2, 2i
ret %3
}
@@ -550,7 +550,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, vec3<i32>, read_write>):i32 {
- %b1 = block {
+ $B1: {
%3:ref<function, vec3<i32>, read_write> = ptr-to-ref %2
%4:i32 = load_vector_element %3, 2i
ret %4
@@ -574,7 +574,7 @@
auto* src = R"(
%1 = func(%2:ptr<function, vec3<i32>, read_write>):void {
- %b1 = block {
+ $B1: {
store_vector_element %2, 2i, 42i
ret
}
@@ -584,7 +584,7 @@
auto* expect = R"(
%1 = func(%2:ptr<function, vec3<i32>, read_write>):void {
- %b1 = block {
+ $B1: {
%3:ref<function, vec3<i32>, read_write> = ptr-to-ref %2
store_vector_element %3, 2i, 42i
ret
diff --git a/src/tint/lang/wgsl/writer/raise/raise_test.cc b/src/tint/lang/wgsl/writer/raise/raise_test.cc
index 251ae66..645361c 100644
--- a/src/tint/lang/wgsl/writer/raise/raise_test.cc
+++ b/src/tint/lang/wgsl/writer/raise/raise_test.cc
@@ -52,7 +52,7 @@
auto* src = R"(
%f = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = max 1i, 2i
ret
}
@@ -62,7 +62,7 @@
auto* expect = R"(
%f = func():void {
- %b1 = block {
+ $B1: {
%2:i32 = wgsl.max 1i, 2i
%3:i32 = let %2
ret
@@ -87,12 +87,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:void = workgroupBarrier
%4:i32 = load %W
%5:void = workgroupBarrier
@@ -103,12 +103,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%W:ref<workgroup, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<workgroup, i32, read_write> = ref-to-ptr %W
%4:i32 = wgsl.workgroupUniformLoad %3
ret %4
@@ -134,12 +134,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%W:ptr<workgroup, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:void = workgroupBarrier
store %W, 42i
%4:i32 = load %W
@@ -151,12 +151,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%W:ref<workgroup, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:void = wgsl.workgroupBarrier
store %W, 42i
%4:i32 = load %W
diff --git a/src/tint/lang/wgsl/writer/raise/rename_conflicts_test.cc b/src/tint/lang/wgsl/writer/raise/rename_conflicts_test.cc
index 37e1b18..4e687aa 100644
--- a/src/tint/lang/wgsl/writer/raise/rename_conflicts_test.cc
+++ b/src/tint/lang/wgsl/writer/raise/rename_conflicts_test.cc
@@ -83,7 +83,7 @@
b.Append(mod.root_block, [&] { b.ir.SetName(b.Var(ty.ptr<private_, i32>()), "v"); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
}
@@ -104,7 +104,7 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
%v_1:ptr<private, u32, read_write> = var # %v_1: 'v'
}
@@ -113,7 +113,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
%v_1:ptr<private, u32, read_write> = var
}
@@ -134,7 +134,7 @@
x:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%v:ptr<function, v, read_write> = var
}
@@ -146,7 +146,7 @@
x:i32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%v_1:ptr<function, v, read_write> = var
}
@@ -164,12 +164,12 @@
b.Append(fn->Block(), [&] { b.Return(fn); });
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
}
%v_1 = func():void { # %v_1: 'v'
- %b2 = block {
+ $B2: {
ret
}
}
@@ -177,12 +177,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
}
%v_1 = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -211,12 +211,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = load %v
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%5:i32 = load %v_1
@@ -251,12 +251,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%4:i32 = load %v
%5:i32 = load %v_1
@@ -268,12 +268,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%v:ptr<private, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%v_1:ptr<function, i32, read_write> = var
%4:i32 = load %v
%5:i32 = load %v_1
@@ -310,10 +310,10 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
%3:i32 = load %v
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%5:i32 = load %v_1
@@ -355,10 +355,10 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%4:i32 = load %v
%5:i32 = load %v_1
@@ -374,10 +374,10 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%v:ptr<function, i32, read_write> = var
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
%v_1:ptr<function, i32, read_write> = var
%4:i32 = load %v
%5:i32 = load %v_1
@@ -420,13 +420,13 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ $B1: {
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%v:ptr<function, i32, read_write> = var
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%3:i32 = load %v
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%5:i32 = load %v_1
@@ -471,13 +471,13 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ $B1: {
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%v:ptr<function, i32, read_write> = var
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%4:i32 = load %v
%5:i32 = load %v_1
@@ -493,13 +493,13 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ $B1: {
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%v:ptr<function, i32, read_write> = var
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%v_1:ptr<function, i32, read_write> = var
%4:i32 = load %v
%5:i32 = load %v_1
@@ -543,16 +543,16 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
- next_iteration %b3
+ $B1: {
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%v:ptr<function, i32, read_write> = var
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%3:i32 = load %v
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%5:i32 = load %v_1
@@ -598,16 +598,16 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
- next_iteration %b3
+ $B1: {
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%v:ptr<function, i32, read_write> = var
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%v_1:ptr<function, i32, read_write> = var # %v_1: 'v'
%4:i32 = load %v
%5:i32 = load %v_1
@@ -623,16 +623,16 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
- next_iteration %b3
+ $B1: {
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%v:ptr<function, i32, read_write> = var
- continue %b4
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%v_1:ptr<function, i32, read_write> = var
%4:i32 = load %v
%5:i32 = load %v_1
@@ -663,7 +663,7 @@
auto* src = R"(
%f = func(%i32:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, i32, read_write> = var
ret
}
@@ -673,7 +673,7 @@
auto* expect = R"(
%f = func(%i32_1:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, i32, read_write> = var
ret
}
@@ -698,7 +698,7 @@
auto* src = R"(
%f = func(%vec2:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, vec3<i32>, read_write> = var
ret
}
@@ -726,7 +726,7 @@
auto* src = R"(
%f = func(%vec3:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, vec3<i32>, read_write> = var
ret
}
@@ -736,7 +736,7 @@
auto* expect = R"(
%f = func(%vec3_1:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, vec3<i32>, read_write> = var
ret
}
@@ -761,7 +761,7 @@
auto* src = R"(
%f = func(%mat3x2:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, mat2x4<f32>, read_write> = var
ret
}
@@ -789,7 +789,7 @@
auto* src = R"(
%f = func(%mat2x4:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, mat2x4<f32>, read_write> = var
ret
}
@@ -799,7 +799,7 @@
auto* expect = R"(
%f = func(%mat2x4_1:i32):void {
- %b1 = block {
+ $B1: {
%3:ptr<function, mat2x4<f32>, read_write> = var
ret
}
@@ -822,7 +822,7 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%f32:ptr<function, i32, read_write> = var
%3:i32 = construct
ret %3
@@ -849,7 +849,7 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%i32:ptr<function, i32, read_write> = var
%3:i32 = construct
ret %3
@@ -860,7 +860,7 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%i32_1:ptr<function, i32, read_write> = var
%3:i32 = construct
ret %3
@@ -884,7 +884,7 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%i32:i32 = add 1i, 2i
ret %i32
}
@@ -910,7 +910,7 @@
auto* src = R"(
%f = func():f32 {
- %b1 = block {
+ $B1: {
%f32:i32 = add 1i, 2i
%3:f32 = construct %f32
ret %3
@@ -921,7 +921,7 @@
auto* expect = R"(
%f = func():f32 {
- %b1 = block {
+ $B1: {
%f32_1:i32 = add 1i, 2i
%3:f32 = construct %f32_1
ret %3
@@ -940,7 +940,7 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%function:ptr<private, i32, read_write> = var
}
@@ -960,7 +960,7 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%private:ptr<private, i32, read_write> = var
}
@@ -968,7 +968,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%private_1:ptr<private, i32, read_write> = var
}
@@ -985,7 +985,7 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%read:ptr<private, i32, read_write> = var
}
@@ -1005,7 +1005,7 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%read_write:ptr<private, i32, read_write> = var
}
@@ -1013,7 +1013,7 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%read_write_1:ptr<private, i32, read_write> = var
}
@@ -1037,12 +1037,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%min:ptr<private, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = max 1i, 2i
ret %3
}
@@ -1070,12 +1070,12 @@
});
auto* src = R"(
-%b1 = block { # root
+$B1: { # root
%max:ptr<private, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = max 1i, 2i
ret %3
}
@@ -1084,12 +1084,12 @@
EXPECT_EQ(src, str());
auto* expect = R"(
-%b1 = block { # root
+$B1: { # root
%max_1:ptr<private, i32, read_write> = var
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:i32 = max 1i, 2i
ret %3
}
@@ -1118,12 +1118,12 @@
f:f32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, s, read_write> = var
}
%f32 = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
@@ -1135,12 +1135,12 @@
f:f32 @offset(0)
}
-%b1 = block { # root
+$B1: { # root
%1:ptr<private, s, read_write> = var
}
%f32_1 = func():void {
- %b2 = block {
+ $B2: {
ret
}
}
diff --git a/src/tint/lang/wgsl/writer/raise/value_to_let_test.cc b/src/tint/lang/wgsl/writer/raise/value_to_let_test.cc
index 8e974f3..3d7408a 100644
--- a/src/tint/lang/wgsl/writer/raise/value_to_let_test.cc
+++ b/src/tint/lang/wgsl/writer/raise/value_to_let_test.cc
@@ -63,7 +63,7 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
@@ -77,7 +77,7 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
@@ -111,12 +111,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = add 1i, 2i
%5:i32 = add 3i, 4i
%6:i32 = add %4, %5
@@ -149,12 +149,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = call %a, 1i
%5:i32 = add 2i, 3i
%6:i32 = add %4, %5
@@ -187,12 +187,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = add 1i, 2i
%5:i32 = call %a, 3i
%6:i32 = add %4, %5
@@ -225,12 +225,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = call %a, 1i
%5:i32 = call %a, 2i
%6:i32 = add %4, %5
@@ -263,12 +263,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = add 3i, 4i
%5:i32 = add 1i, 2i
%6:i32 = add %5, %4
@@ -301,12 +301,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = add 2i, 3i
%5:i32 = call %a, 1i
%6:i32 = add %5, %4
@@ -339,12 +339,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = call %a, 3i
%5:i32 = add 1i, 2i
%6:i32 = add %5, %4
@@ -377,12 +377,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = call %a, 2i
%5:i32 = call %a, 1i
%6:i32 = add %5, %4
@@ -395,12 +395,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func():i32 {
- %b2 = block {
+ $B2: {
%4:i32 = call %a, 2i
%5:i32 = let %4
%6:i32 = call %a, 1i
@@ -439,17 +439,17 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 1i
%9:i32 = call %a, 2i
%10:i32 = call %a, 3i
@@ -489,17 +489,17 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 2i
%9:i32 = call %a, 1i
%10:i32 = call %a, 3i
@@ -513,17 +513,17 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 2i
%9:i32 = let %8
%10:i32 = call %a, 1i
@@ -560,17 +560,17 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 1i
%9:i32 = call %a, 3i
%10:i32 = call %a, 2i
@@ -584,17 +584,17 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 1i
%9:i32 = let %8
%10:i32 = call %a, 3i
@@ -632,17 +632,17 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 3i
%9:i32 = call %a, 1i
%10:i32 = call %a, 2i
@@ -656,17 +656,17 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 3i
%9:i32 = let %8
%10:i32 = call %a, 1i
@@ -703,17 +703,17 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 2i
%9:i32 = call %a, 3i
%10:i32 = call %a, 1i
@@ -727,17 +727,17 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 2i
%9:i32 = let %8
%10:i32 = call %a, 3i
@@ -775,17 +775,17 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 3i
%9:i32 = call %a, 2i
%10:i32 = call %a, 1i
@@ -799,17 +799,17 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 0i
}
}
%b = func(%4:i32, %5:i32, %6:i32):i32 {
- %b2 = block {
+ $B2: {
ret 0i
}
}
%c = func():i32 {
- %b3 = block {
+ $B3: {
%8:i32 = call %a, 3i
%9:i32 = let %8
%10:i32 = call %a, 2i
@@ -841,12 +841,12 @@
auto* src = R"(
%a = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -860,12 +860,12 @@
auto* expect = R"(
%a = func():void {
- %b1 = block {
+ $B1: {
ret
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -896,12 +896,12 @@
auto* src = R"(
%a = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -915,12 +915,12 @@
auto* expect = R"(
%a = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -951,12 +951,12 @@
auto* src = R"(
%a = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -971,12 +971,12 @@
auto* expect = R"(
%a = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -1007,12 +1007,12 @@
auto* src = R"(
%a = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -1027,12 +1027,12 @@
auto* expect = R"(
%a = func():i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%3:ptr<function, i32, read_write> = var
store %3, 1i
%4:i32 = load %3
@@ -1069,12 +1069,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 1i
%6:i32 = call %a, 2i
@@ -1090,12 +1090,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 1i
%6:i32 = call %a, 2i
@@ -1129,12 +1129,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 2i
%6:i32 = call %a, 1i
@@ -1150,12 +1150,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 2i
%6:i32 = let %5
@@ -1190,12 +1190,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 3i
%6:i32 = call %a, 1i
@@ -1211,12 +1211,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 3i
%6:i32 = let %5
@@ -1251,12 +1251,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 3i
%6:i32 = call %a, 2i
@@ -1272,12 +1272,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():i32 {
- %b2 = block {
+ $B2: {
%4:ptr<function, array<array<array<i32, 3>, 4>, 5>, read_write> = var
%5:i32 = call %a, 3i
%6:i32 = let %5
@@ -1313,12 +1313,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 1i
%6:i32 = call %a, 2i
@@ -1333,12 +1333,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 1i
%6:i32 = call %a, 2i
@@ -1371,12 +1371,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 2i
%6:i32 = call %a, 1i
@@ -1391,12 +1391,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 2i
%6:i32 = let %5
@@ -1430,12 +1430,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 3i
%6:i32 = call %a, 1i
@@ -1450,12 +1450,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 3i
%6:i32 = let %5
@@ -1489,12 +1489,12 @@
auto* src = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 3i
%6:i32 = call %a, 2i
@@ -1509,12 +1509,12 @@
auto* expect = R"(
%a = func(%2:i32):i32 {
- %b1 = block {
+ $B1: {
ret 1i
}
}
%f = func():f32 {
- %b2 = block {
+ $B2: {
%4:array<mat3x4<f32>, 5> = construct
%5:i32 = call %a, 3i
%6:i32 = let %5
@@ -1546,10 +1546,10 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:i32 = add 1i, 2i
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
ret %2
}
}
@@ -1581,12 +1581,12 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
%4:i32 = add %3, 2i
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
ret %4
}
}
@@ -1599,13 +1599,13 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
%4:i32 = add %3, 2i
%5:i32 = let %4
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
ret %5
}
}
@@ -1630,10 +1630,10 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:bool = eq 1i, 2i
- if %2 [t: %b2] { # if_1
- %b2 = block { # true
+ if %2 [t: $B2] { # if_1
+ $B2: { # true
ret 3i
}
}
@@ -1646,10 +1646,10 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:bool = eq 1i, 2i
- if %2 [t: %b2] { # if_1
- %b2 = block { # true
+ if %2 [t: $B2] { # if_1
+ $B2: { # true
ret 3i
}
}
@@ -1677,12 +1677,12 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
%4:bool = eq %3, 2i
- if %4 [t: %b2] { # if_1
- %b2 = block { # true
+ if %4 [t: $B2] { # if_1
+ $B2: { # true
ret 3i
}
}
@@ -1695,12 +1695,12 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
%4:bool = eq %3, 2i
- if %4 [t: %b2] { # if_1
- %b2 = block { # true
+ if %4 [t: $B2] { # if_1
+ $B2: { # true
ret 3i
}
}
@@ -1730,12 +1730,12 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
store %2, 2i
exit_if # if_1
}
@@ -1749,13 +1749,13 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
%4:i32 = let %3
- if true [t: %b2] { # if_1
- %b2 = block { # true
+ if true [t: $B2] { # if_1
+ $B2: { # true
store %2, 2i
exit_if # if_1
}
@@ -1785,10 +1785,10 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:i32 = add 1i, 2i
- switch 3i [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch 3i [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret %2
}
}
@@ -1821,12 +1821,12 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
%4:i32 = add %3, 2i
- switch 3i [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch 3i [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret %4
}
}
@@ -1839,13 +1839,13 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
%4:i32 = add %3, 2i
%5:i32 = let %4
- switch 3i [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch 3i [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret %5
}
}
@@ -1871,10 +1871,10 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:i32 = add 1i, 2i
- switch %2 [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch %2 [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret 3i
}
}
@@ -1887,10 +1887,10 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:i32 = add 1i, 2i
- switch %2 [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch %2 [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret 3i
}
}
@@ -1918,11 +1918,11 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
- switch %3 [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch %3 [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret 3i
}
}
@@ -1935,11 +1935,11 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var, 1i
%3:i32 = load %2
- switch %3 [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch %3 [c: (default, $B2)] { # switch_1
+ $B2: { # case
ret 3i
}
}
@@ -1970,12 +1970,12 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
- switch 1i [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch 1i [c: (default, $B2)] { # switch_1
+ $B2: { # case
store %2, 2i
exit_switch # switch_1
}
@@ -1989,13 +1989,13 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
%4:i32 = let %3
- switch 1i [c: (default, %b2)] { # switch_1
- %b2 = block { # case
+ switch 1i [c: (default, $B2)] { # switch_1
+ $B2: { # case
store %2, 2i
exit_switch # switch_1
}
@@ -2029,15 +2029,15 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = add 1i, 2i
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
store %2, %3
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
exit_loop # loop_1
}
}
@@ -2072,16 +2072,16 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = load %2
%4:i32 = add %3, 2i
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
store %2, %4
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
exit_loop # loop_1
}
}
@@ -2094,17 +2094,17 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = load %2
%4:i32 = add %3, 2i
%5:i32 = let %4
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
store %2, %5
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
exit_loop # loop_1
}
}
@@ -2135,16 +2135,16 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
store %2, 2i
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
exit_loop # loop_1
}
}
@@ -2157,17 +2157,17 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
%4:i32 = let %3
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
store %2, 2i
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
exit_loop # loop_1
}
}
@@ -2192,10 +2192,10 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:i32 = add 1i, 2i
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ loop [b: $B2] { # loop_1
+ $B2: { # body
ret %2
}
}
@@ -2226,12 +2226,12 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = load %2
%4:i32 = add %3, 2i
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ loop [b: $B2] { # loop_1
+ $B2: { # body
ret %4
}
}
@@ -2244,13 +2244,13 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = load %2
%4:i32 = add %3, 2i
%5:i32 = let %4
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ loop [b: $B2] { # loop_1
+ $B2: { # body
ret %5
}
}
@@ -2280,12 +2280,12 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ loop [b: $B2] { # loop_1
+ $B2: { # body
store %2, 2i
exit_loop # loop_1
}
@@ -2299,13 +2299,13 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
%4:i32 = let %3
- loop [b: %b2] { # loop_1
- %b2 = block { # body
+ loop [b: $B2] { # loop_1
+ $B2: { # body
store %2, 2i
exit_loop # loop_1
}
@@ -2332,15 +2332,15 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:i32 = add 1i, 2i
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
%3:bool = eq %2, 3i
- break_if %3 %b2
+ break_if %3 $B2
}
}
ret 0i
@@ -2371,17 +2371,17 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = load %2
%4:i32 = add %3, 2i
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
%5:bool = eq %4, 3i
- break_if %5 %b2
+ break_if %5 $B2
}
}
ret 0i
@@ -2395,18 +2395,18 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
%3:i32 = load %2
%4:i32 = add %3, 2i
%5:i32 = let %4
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
%6:bool = eq %5, 3i
- break_if %6 %b2
+ break_if %6 $B2
}
}
ret 0i
@@ -2434,17 +2434,17 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
store %2, 2i
- break_if true %b2
+ break_if true $B2
}
}
ret %3
@@ -2456,18 +2456,18 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
%3:i32 = load %2
%4:i32 = let %3
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
- continue %b3
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
store %2, 2i
- break_if true %b2
+ break_if true $B2
}
}
ret %4
@@ -2499,15 +2499,15 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%3:i32 = load %2
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%4:i32 = add %3, 1i
store %2, %4
exit_loop # loop_1
@@ -2522,16 +2522,16 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
- loop [i: %b2, b: %b3] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3] { # loop_1
+ $B2: { # initializer
%3:i32 = load %2
%4:i32 = let %3
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
+ $B3: { # body
%5:i32 = add %4, 1i
store %2, %5
exit_loop # loop_1
@@ -2567,21 +2567,21 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
%3:i32 = load %2
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
- continue %b4
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%4:i32 = add %3, 1i
store %2, %4
- break_if true %b3
+ break_if true $B3
}
}
ret 3i
@@ -2593,22 +2593,22 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
- loop [i: %b2, b: %b3, c: %b4] { # loop_1
- %b2 = block { # initializer
+ loop [i: $B2, b: $B3, c: $B4] { # loop_1
+ $B2: { # initializer
%3:i32 = load %2
%4:i32 = let %3
- next_iteration %b3
+ next_iteration $B3
}
- %b3 = block { # body
- continue %b4
+ $B3: { # body
+ continue $B4
}
- %b4 = block { # continuing
+ $B4: { # continuing
%5:i32 = add %4, 1i
store %2, %5
- break_if true %b3
+ break_if true $B3
}
}
ret 3i
@@ -2641,18 +2641,18 @@
auto* src = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %2
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
%4:i32 = add %3, 1i
store %2, %4
- break_if true %b2
+ break_if true $B2
}
}
ret 3i
@@ -2664,19 +2664,19 @@
auto* expect = R"(
%f = func():i32 {
- %b1 = block {
+ $B1: {
%2:ptr<function, i32, read_write> = var
store %2, 1i
- loop [b: %b2, c: %b3] { # loop_1
- %b2 = block { # body
+ loop [b: $B2, c: $B3] { # loop_1
+ $B2: { # body
%3:i32 = load %2
%4:i32 = let %3
- continue %b3
+ continue $B3
}
- %b3 = block { # continuing
+ $B3: { # continuing
%5:i32 = add %4, 1i
store %2, %5
- break_if true %b2
+ break_if true $B2
}
}
ret 3i