[msl] Fix host-shareable struct padding

The struct usages are not kept up-to-date through transforms, so we
need to determine which structs are used in host-shareable address
spaces by inspecting the entry point parameters instead.

Bug: 42251016
Change-Id: Ia88720e52674e212b4f889de9c7ee45f026da3bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/203635
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/msl/writer/printer/printer.cc b/src/tint/lang/msl/writer/printer/printer.cc
index 7b51791..4d72b79 100644
--- a/src/tint/lang/msl/writer/printer/printer.cc
+++ b/src/tint/lang/msl/writer/printer/printer.cc
@@ -138,6 +138,9 @@
         // Module-scope declarations should have all been moved into the entry points.
         TINT_ASSERT(ir_.root_block->IsEmpty());
 
+        // Determine which structures will need to be emitted with host-shareable memory layouts.
+        FindHostShareableStructs();
+
         // Emit functions.
         for (auto* func : ir_.DependencyOrderedFunctions()) {
             EmitFunction(func);
@@ -169,6 +172,7 @@
     /// Non-empty only if an invariant attribute has been generated.
     std::string invariant_define_name_;
 
+    Hashset<const core::type::Struct*, 16> host_shareable_structs_;
     std::unordered_set<const core::type::Struct*> emitted_structs_;
 
     /// The current function being emitted
@@ -213,6 +217,38 @@
         return array_template_name_;
     }
 
+    /// Find all structures that are used in host-shareable address spaces and mark them as such so
+    /// that we know to pad the properly when we emit them.
+    void FindHostShareableStructs() {
+        // We only look at function parameters of entry points, since this is how binding resources
+        // are handled in MSL.
+        for (auto func : ir_.functions) {
+            if (func->Stage() == core::ir::Function::PipelineStage::kUndefined) {
+                continue;
+            }
+            for (auto* param : func->Params()) {
+                auto* ptr = param->Type()->As<core::type::Pointer>();
+                if (ptr && core::IsHostShareable(ptr->AddressSpace())) {
+                    // Look for structures at any nesting depth of this parameter's type.
+                    Vector<const core::type::Type*, 8> type_queue;
+                    type_queue.Push(ptr->StoreType());
+                    while (!type_queue.IsEmpty()) {
+                        auto* next = type_queue.Pop();
+                        if (auto* str = next->As<core::type::Struct>()) {
+                            // Record this structure as host-shareable.
+                            host_shareable_structs_.Add(str);
+                            for (auto* member : str->Members()) {
+                                type_queue.Push(member->Type());
+                            }
+                        } else if (auto* arr = next->As<core::type::Array>()) {
+                            type_queue.Push(arr->ElemType());
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     /// Check if a value is emitted as an actual pointer (instead of a reference).
     /// @param value the value to check
     /// @returns true if @p value will be emitted as an actual pointer
@@ -1363,7 +1399,7 @@
         TextBuffer str_buf;
         Line(&str_buf) << "\n" << "struct " << StructName(str) << " {";
 
-        bool is_host_shareable = str->IsHostShareable();
+        bool is_host_shareable = host_shareable_structs_.Contains(str);
 
         // Emits a `/* 0xnnnn */` byte offset comment for a struct member.
         auto add_byte_offset_comment = [&](StringStream& out, uint32_t offset) {
diff --git a/src/tint/lang/msl/writer/type_test.cc b/src/tint/lang/msl/writer/type_test.cc
index d58b464..9d4009e 100644
--- a/src/tint/lang/msl/writer/type_test.cc
+++ b/src/tint/lang/msl/writer/type_test.cc
@@ -479,7 +479,6 @@
                                    {mod.symbols.Register("z"), ty.f32()}};
 
     auto* s = MkStruct(mod, ty, "S", data);
-    s->AddUsage(core::AddressSpace::kStorage);
 
     // ALL_FIELDS() calls the macro FIELD(ADDR, TYPE, ARRAY_COUNT, NAME)
     // for each field of the structure s.
@@ -532,20 +531,20 @@
     ALL_FIELDS()
 #undef FIELD
     expect << R"(};
-
-void foo() {
-  thread S a = {};
-}
 )";
 
-    auto* func = b.Function("foo", ty.void_());
+    auto* var = b.Var("a", ty.ptr(core::AddressSpace::kStorage, s));
+    var->SetBindingPoint(0, 0);
+    mod.root_block->Append(var);
+    auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute,
+                            std::array<uint32_t, 3>{1u, 1u, 1u});
     b.Append(func->Block(), [&] {
-        b.Var("a", ty.ptr(core::AddressSpace::kPrivate, s));
+        b.Load(var);
         b.Return(func);
     });
 
     ASSERT_TRUE(Generate()) << err_ << output_.msl;
-    EXPECT_EQ(output_.msl, expect.str());
+    EXPECT_THAT(output_.msl, testing::HasSubstr(expect.str()));
 
     // 1.4 Metal and C++14
     // The Metal programming language is a C++14-based Specification with
@@ -587,7 +586,6 @@
                                                {mod.symbols.Register("c"), ty.f32()},
                                                {mod.symbols.Register("d"), inner_y},
                                                {mod.symbols.Register("e"), ty.f32()}});
-    const_cast<core::type::Struct*>(s)->AddUsage(core::AddressSpace::kStorage);
 
 // ALL_FIELDS() calls the macro FIELD(ADDR, TYPE, ARRAY_COUNT, NAME)
 // for each field of the structure s.
@@ -598,19 +596,22 @@
     FIELD(0x0600, float, 0, c)           \
     FIELD(0x0604, inner_y, 0, d)         \
     FIELD(0x0808, float, 0, e)           \
-    FIELD(0x080c, int8_t, 500, tint_pad_1)
+    FIELD(0x080c, int8_t, 500, tint_pad_4)
 
     // Check that the generated string is as expected.
     StringStream expect;
     expect << MetalHeader() << MetalArray() << R"(
 struct inner_x {
-  int a;
-  float b;
+  /* 0x0000 */ int a;
+  /* 0x0004 */ tint_array<int8_t, 508> tint_pad_1;
+  /* 0x0200 */ float b;
+  /* 0x0204 */ tint_array<int8_t, 508> tint_pad_2;
 };
 
 struct inner_y {
-  int a;
-  float b;
+  /* 0x0000 */ int a;
+  /* 0x0004 */ tint_array<int8_t, 508> tint_pad_3;
+  /* 0x0200 */ float b;
 };
 
 )";
@@ -621,20 +622,20 @@
     ALL_FIELDS()
 #undef FIELD
     expect << R"(};
-
-void foo() {
-  thread S a = {};
-}
 )";
 
-    auto* func = b.Function("foo", ty.void_());
+    auto* var = b.Var("a", ty.ptr(core::AddressSpace::kStorage, s));
+    var->SetBindingPoint(0, 0);
+    mod.root_block->Append(var);
+    auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute,
+                            std::array<uint32_t, 3>{1u, 1u, 1u});
     b.Append(func->Block(), [&] {
-        b.Var("a", ty.ptr(core::AddressSpace::kPrivate, s));
+        b.Load(var);
         b.Return(func);
     });
 
     ASSERT_TRUE(Generate()) << err_ << output_.msl;
-    EXPECT_EQ(output_.msl, expect.str());
+    EXPECT_THAT(output_.msl, testing::HasSubstr(expect.str()));
 
     // 1.4 Metal and C++14
     // The Metal programming language is a C++14-based Specification with
@@ -694,7 +695,6 @@
                                                {mod.symbols.Register("d"), array_y},
                                                {mod.symbols.Register("e"), ty.f32()},
                                                {mod.symbols.Register("f"), array_z}});
-    const_cast<core::type::Struct*>(s)->AddUsage(core::AddressSpace::kStorage);
 
     // ALL_FIELDS() calls the macro FIELD(ADDR, TYPE, ARRAY_COUNT, NAME)
     // for each field of the structure s.
@@ -706,15 +706,17 @@
     FIELD(0x0200, inner, 4, d)           \
     FIELD(0x1200, float, 0, e)           \
     FIELD(0x1204, float, 1, f)           \
-    FIELD(0x1208, int8_t, 504, tint_pad_1)
+    FIELD(0x1208, int8_t, 504, tint_pad_3)
 
     // Check that the generated string is as expected.
     StringStream expect;
 
     expect << MetalHeader() << MetalArray() << R"(
 struct inner {
-  int a;
-  float b;
+  /* 0x0000 */ int a;
+  /* 0x0004 */ tint_array<int8_t, 508> tint_pad_1;
+  /* 0x0200 */ float b;
+  /* 0x0204 */ tint_array<int8_t, 508> tint_pad_2;
 };
 
 )";
@@ -725,20 +727,20 @@
     ALL_FIELDS()
 #undef FIELD
     expect << R"(};
-
-void foo() {
-  thread S a = {};
-}
 )";
 
-    auto* func = b.Function("foo", ty.void_());
+    auto* var = b.Var("a", ty.ptr(core::AddressSpace::kStorage, s));
+    var->SetBindingPoint(0, 0);
+    mod.root_block->Append(var);
+    auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute,
+                            std::array<uint32_t, 3>{1u, 1u, 1u});
     b.Append(func->Block(), [&] {
-        b.Var("a", ty.ptr(core::AddressSpace::kPrivate, s));
+        b.Load(var);
         b.Return(func);
     });
 
     ASSERT_TRUE(Generate()) << err_ << output_.msl;
-    EXPECT_EQ(output_.msl, expect.str());
+    EXPECT_THAT(output_.msl, testing::HasSubstr(expect.str()));
 
     // 1.4 Metal and C++14
     // The Metal programming language is a C++14-based Specification with
@@ -791,7 +793,6 @@
                                                   {mod.symbols.Register("b"), array},
                                                   {mod.symbols.Register("c"), ty.i32()},
                                               });
-    const_cast<core::type::Struct*>(s)->AddUsage(core::AddressSpace::kStorage);
 
     // ALL_FIELDS() calls the macro FIELD(ADDR, TYPE, ARRAY_COUNT, NAME)
     // for each field of the structure s.
@@ -811,20 +812,20 @@
     ALL_FIELDS()
 #undef FIELD
     expect << R"(};
-
-void foo() {
-  thread S a = {};
-}
 )";
 
-    auto* func = b.Function("foo", ty.void_());
+    auto* var = b.Var("a", ty.ptr(core::AddressSpace::kStorage, s));
+    var->SetBindingPoint(0, 0);
+    mod.root_block->Append(var);
+    auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute,
+                            std::array<uint32_t, 3>{1u, 1u, 1u});
     b.Append(func->Block(), [&] {
-        b.Var("a", ty.ptr(core::AddressSpace::kPrivate, s));
+        b.Load(var);
         b.Return(func);
     });
 
     ASSERT_TRUE(Generate()) << err_ << output_.msl;
-    EXPECT_EQ(output_.msl, expect.str());
+    EXPECT_THAT(output_.msl, testing::HasSubstr(expect.str()));
 }
 
 TEST_F(MslWriterTest, AttemptTintPadSymbolCollision) {
@@ -857,7 +858,6 @@
                                    {mod.symbols.Register("tint_pad_21"), ty.f32()}};
 
     auto* s = MkStruct(mod, ty, "S", data);
-    s->AddUsage(core::AddressSpace::kStorage);
 
     auto expect = MetalHeader() + MetalArray() + R"(
 struct S {
@@ -901,20 +901,20 @@
   /* 0x0300 */ float tint_pad_21;
   /* 0x0304 */ tint_array<int8_t, 124> tint_pad_38;
 };
-
-void foo() {
-  thread S a = {};
-}
 )";
 
-    auto* func = b.Function("foo", ty.void_());
+    auto* var = b.Var("a", ty.ptr(core::AddressSpace::kStorage, s));
+    var->SetBindingPoint(0, 0);
+    mod.root_block->Append(var);
+    auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute,
+                            std::array<uint32_t, 3>{1u, 1u, 1u});
     b.Append(func->Block(), [&] {
-        b.Var("a", ty.ptr(core::AddressSpace::kPrivate, s));
+        b.Load(var);
         b.Return(func);
     });
 
     ASSERT_TRUE(Generate()) << err_ << output_.msl;
-    EXPECT_EQ(output_.msl, expect);
+    EXPECT_THAT(output_.msl, testing::HasSubstr(expect));
 }
 
 TEST_F(MslWriterTest, EmitType_Sampler) {
@@ -1075,7 +1075,7 @@
 TEST_P(MslWriterStorageTexturesTest, Emit) {
     auto params = GetParam();
 
-    auto* f32 = const_cast<core::type::F32*>(ty.f32());
+    auto* f32 = ty.f32();
     auto s = ty.Get<core::type::StorageTexture>(params.dim, core::TexelFormat::kR32Float,
                                                 core::Access::kWrite, f32);
     auto* func = b.Function("foo", ty.void_());
diff --git a/test/tint/array/assign_to_function_var.wgsl.expected.ir.msl b/test/tint/array/assign_to_function_var.wgsl.expected.ir.msl
index 876064c..978fdfb 100644
--- a/test/tint/array/assign_to_function_var.wgsl.expected.ir.msl
+++ b/test/tint/array/assign_to_function_var.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int4, 4> arr;
+  /* 0x0000 */ tint_array<int4, 4> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/array/assign_to_private_var.wgsl.expected.ir.msl b/test/tint/array/assign_to_private_var.wgsl.expected.ir.msl
index a9d8411..13c9933 100644
--- a/test/tint/array/assign_to_private_var.wgsl.expected.ir.msl
+++ b/test/tint/array/assign_to_private_var.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int4, 4> arr;
+  /* 0x0000 */ tint_array<int4, 4> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/array/assign_to_storage_var.wgsl.expected.ir.msl b/test/tint/array/assign_to_storage_var.wgsl.expected.ir.msl
index fc2028d..a5d2af7 100644
--- a/test/tint/array/assign_to_storage_var.wgsl.expected.ir.msl
+++ b/test/tint/array/assign_to_storage_var.wgsl.expected.ir.msl
@@ -14,11 +14,11 @@
 };
 
 struct S {
-  tint_array<int4, 4> arr;
+  /* 0x0000 */ tint_array<int4, 4> arr;
 };
 
 struct S_nested {
-  tint_array<tint_array<tint_array<int, 2>, 3>, 4> arr;
+  /* 0x0000 */ tint_array<tint_array<tint_array<int, 2>, 3>, 4> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/array/assign_to_workgroup_var.wgsl.expected.ir.msl b/test/tint/array/assign_to_workgroup_var.wgsl.expected.ir.msl
index 5ae2774..cade83f 100644
--- a/test/tint/array/assign_to_workgroup_var.wgsl.expected.ir.msl
+++ b/test/tint/array/assign_to_workgroup_var.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int4, 4> arr;
+  /* 0x0000 */ tint_array<int4, 4> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/array/strides.spvasm.expected.ir.msl b/test/tint/array/strides.spvasm.expected.ir.msl
index fa9a250..d84e88c 100644
--- a/test/tint/array/strides.spvasm.expected.ir.msl
+++ b/test/tint/array/strides.spvasm.expected.ir.msl
@@ -1,10 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct strided_arr {
-  float el;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -17,12 +13,18 @@
   T elements[N];
 };
 
+struct strided_arr {
+  /* 0x0000 */ float el;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+};
+
 struct strided_arr_1 {
-  tint_array<tint_array<strided_arr, 2>, 3> el;
+  /* 0x0000 */ tint_array<tint_array<strided_arr, 2>, 3> el;
+  /* 0x0030 */ tint_array<int8_t, 80> tint_pad_1;
 };
 
 struct S {
-  tint_array<strided_arr_1, 4> a;
+  /* 0x0000 */ tint_array<strided_arr_1, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.ir.msl b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.ir.msl
index 89096f8..da44528 100644
--- a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.ir.msl
@@ -14,32 +14,38 @@
 };
 
 struct Inner {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ tint_array<int8_t, 8> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ float4 vec4_f32;
+  /* 0x0070 */ int4 vec4_i32;
+  /* 0x0080 */ uint4 vec4_u32;
+  /* 0x0090 */ float2x2 mat2x2_f32;
+  /* 0x00a0 */ float2x3 mat2x3_f32;
+  /* 0x00c0 */ float2x4 mat2x4_f32;
+  /* 0x00e0 */ float3x2 mat3x2_f32;
+  /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5;
+  /* 0x0100 */ float3x3 mat3x3_f32;
+  /* 0x0130 */ float3x4 mat3x4_f32;
+  /* 0x0160 */ float4x2 mat4x2_f32;
+  /* 0x0180 */ float4x3 mat4x3_f32;
+  /* 0x01c0 */ float4x4 mat4x4_f32;
+  /* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32;
 };
 
 struct S {
-  tint_array<Inner, 1> arr;
+  /* 0x0000 */ tint_array<Inner, 1> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.ir.msl b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.ir.msl
index a9e4962..713fc4a 100644
--- a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.ir.msl
@@ -14,46 +14,56 @@
 };
 
 struct Inner {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  half scalar_f16;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  half2 vec2_f16;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  half3 vec3_f16;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  half4 vec4_f16;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  half2x2 mat2x2_f16;
-  half2x3 mat2x3_f16;
-  half2x4 mat2x4_f16;
-  half3x2 mat3x2_f16;
-  half3x3 mat3x3_f16;
-  half3x4 mat3x4_f16;
-  half4x2 mat4x2_f16;
-  half4x3 mat4x3_f16;
-  half4x4 mat4x4_f16;
-  tint_array<float3, 2> arr2_vec3_f32;
-  tint_array<half4x2, 2> arr2_mat4x2_f16;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ half scalar_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ half2 vec2_f16;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ half3 vec3_f16;
+  /* 0x0066 */ tint_array<int8_t, 10> tint_pad_5;
+  /* 0x0070 */ float4 vec4_f32;
+  /* 0x0080 */ int4 vec4_i32;
+  /* 0x0090 */ uint4 vec4_u32;
+  /* 0x00a0 */ half4 vec4_f16;
+  /* 0x00a8 */ float2x2 mat2x2_f32;
+  /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6;
+  /* 0x00c0 */ float2x3 mat2x3_f32;
+  /* 0x00e0 */ float2x4 mat2x4_f32;
+  /* 0x0100 */ float3x2 mat3x2_f32;
+  /* 0x0118 */ tint_array<int8_t, 8> tint_pad_7;
+  /* 0x0120 */ float3x3 mat3x3_f32;
+  /* 0x0150 */ float3x4 mat3x4_f32;
+  /* 0x0180 */ float4x2 mat4x2_f32;
+  /* 0x01a0 */ float4x3 mat4x3_f32;
+  /* 0x01e0 */ float4x4 mat4x4_f32;
+  /* 0x0220 */ half2x2 mat2x2_f16;
+  /* 0x0228 */ half2x3 mat2x3_f16;
+  /* 0x0238 */ half2x4 mat2x4_f16;
+  /* 0x0248 */ half3x2 mat3x2_f16;
+  /* 0x0254 */ tint_array<int8_t, 4> tint_pad_8;
+  /* 0x0258 */ half3x3 mat3x3_f16;
+  /* 0x0270 */ half3x4 mat3x4_f16;
+  /* 0x0288 */ half4x2 mat4x2_f16;
+  /* 0x0298 */ half4x3 mat4x3_f16;
+  /* 0x02b8 */ half4x4 mat4x4_f16;
+  /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9;
+  /* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
 };
 
 struct S {
-  tint_array<Inner, 1> arr;
+  /* 0x0000 */ tint_array<Inner, 1> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.ir.msl b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.ir.msl
index d85cad4..097f579 100644
--- a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.ir.msl
@@ -14,32 +14,38 @@
 };
 
 struct Inner {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ tint_array<int8_t, 8> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ float4 vec4_f32;
+  /* 0x0070 */ int4 vec4_i32;
+  /* 0x0080 */ uint4 vec4_u32;
+  /* 0x0090 */ float2x2 mat2x2_f32;
+  /* 0x00a0 */ float2x3 mat2x3_f32;
+  /* 0x00c0 */ float2x4 mat2x4_f32;
+  /* 0x00e0 */ float3x2 mat3x2_f32;
+  /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5;
+  /* 0x0100 */ float3x3 mat3x3_f32;
+  /* 0x0130 */ float3x4 mat3x4_f32;
+  /* 0x0160 */ float4x2 mat4x2_f32;
+  /* 0x0180 */ float4x3 mat4x3_f32;
+  /* 0x01c0 */ float4x4 mat4x4_f32;
+  /* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32;
 };
 
 struct S {
-  tint_array<Inner, 1> arr;
+  /* 0x0000 */ tint_array<Inner, 1> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.ir.msl b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.ir.msl
index c7d36bd..b828a06 100644
--- a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.ir.msl
@@ -14,46 +14,56 @@
 };
 
 struct Inner {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  half scalar_f16;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  half2 vec2_f16;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  half3 vec3_f16;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  half4 vec4_f16;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  half2x2 mat2x2_f16;
-  half2x3 mat2x3_f16;
-  half2x4 mat2x4_f16;
-  half3x2 mat3x2_f16;
-  half3x3 mat3x3_f16;
-  half3x4 mat3x4_f16;
-  half4x2 mat4x2_f16;
-  half4x3 mat4x3_f16;
-  half4x4 mat4x4_f16;
-  tint_array<float3, 2> arr2_vec3_f32;
-  tint_array<half4x2, 2> arr2_mat4x2_f16;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ half scalar_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ half2 vec2_f16;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ half3 vec3_f16;
+  /* 0x0066 */ tint_array<int8_t, 10> tint_pad_5;
+  /* 0x0070 */ float4 vec4_f32;
+  /* 0x0080 */ int4 vec4_i32;
+  /* 0x0090 */ uint4 vec4_u32;
+  /* 0x00a0 */ half4 vec4_f16;
+  /* 0x00a8 */ float2x2 mat2x2_f32;
+  /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6;
+  /* 0x00c0 */ float2x3 mat2x3_f32;
+  /* 0x00e0 */ float2x4 mat2x4_f32;
+  /* 0x0100 */ float3x2 mat3x2_f32;
+  /* 0x0118 */ tint_array<int8_t, 8> tint_pad_7;
+  /* 0x0120 */ float3x3 mat3x3_f32;
+  /* 0x0150 */ float3x4 mat3x4_f32;
+  /* 0x0180 */ float4x2 mat4x2_f32;
+  /* 0x01a0 */ float4x3 mat4x3_f32;
+  /* 0x01e0 */ float4x4 mat4x4_f32;
+  /* 0x0220 */ half2x2 mat2x2_f16;
+  /* 0x0228 */ half2x3 mat2x3_f16;
+  /* 0x0238 */ half2x4 mat2x4_f16;
+  /* 0x0248 */ half3x2 mat3x2_f16;
+  /* 0x0254 */ tint_array<int8_t, 4> tint_pad_8;
+  /* 0x0258 */ half3x3 mat3x3_f16;
+  /* 0x0270 */ half3x4 mat3x4_f16;
+  /* 0x0288 */ half4x2 mat4x2_f16;
+  /* 0x0298 */ half4x3 mat4x3_f16;
+  /* 0x02b8 */ half4x4 mat4x4_f16;
+  /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9;
+  /* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
 };
 
 struct S {
-  tint_array<Inner, 1> arr;
+  /* 0x0000 */ tint_array<Inner, 1> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/static_index/read.wgsl.expected.ir.msl b/test/tint/buffer/storage/static_index/read.wgsl.expected.ir.msl
index 9a17b45..295c663 100644
--- a/test/tint/buffer/storage/static_index/read.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/static_index/read.wgsl.expected.ir.msl
@@ -14,35 +14,42 @@
 };
 
 struct Inner {
-  int scalar_i32;
-  float scalar_f32;
+  /* 0x0000 */ int scalar_i32;
+  /* 0x0004 */ float scalar_f32;
 };
 
 struct S {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  tint_array<float3, 2> arr2_vec3_f32;
-  Inner struct_inner;
-  tint_array<Inner, 4> array_struct_inner;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ tint_array<int8_t, 8> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ float4 vec4_f32;
+  /* 0x0070 */ int4 vec4_i32;
+  /* 0x0080 */ uint4 vec4_u32;
+  /* 0x0090 */ float2x2 mat2x2_f32;
+  /* 0x00a0 */ float2x3 mat2x3_f32;
+  /* 0x00c0 */ float2x4 mat2x4_f32;
+  /* 0x00e0 */ float3x2 mat3x2_f32;
+  /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5;
+  /* 0x0100 */ float3x3 mat3x3_f32;
+  /* 0x0130 */ float3x4 mat3x4_f32;
+  /* 0x0160 */ float4x2 mat4x2_f32;
+  /* 0x0180 */ float4x3 mat4x3_f32;
+  /* 0x01c0 */ float4x4 mat4x4_f32;
+  /* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0220 */ Inner struct_inner;
+  /* 0x0228 */ tint_array<Inner, 4> array_struct_inner;
+  /* 0x0248 */ tint_array<int8_t, 8> tint_pad_6;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.ir.msl b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.ir.msl
index 3723e68..756a222 100644
--- a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.ir.msl
@@ -14,50 +14,62 @@
 };
 
 struct Inner {
-  int scalar_i32;
-  float scalar_f32;
-  half scalar_f16;
+  /* 0x0000 */ int scalar_i32;
+  /* 0x0004 */ float scalar_f32;
+  /* 0x0008 */ half scalar_f16;
+  /* 0x000a */ tint_array<int8_t, 2> tint_pad_10;
 };
 
 struct S {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  half scalar_f16;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  half2 vec2_f16;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  half3 vec3_f16;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  half4 vec4_f16;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  half2x2 mat2x2_f16;
-  half2x3 mat2x3_f16;
-  half2x4 mat2x4_f16;
-  half3x2 mat3x2_f16;
-  half3x3 mat3x3_f16;
-  half3x4 mat3x4_f16;
-  half4x2 mat4x2_f16;
-  half4x3 mat4x3_f16;
-  half4x4 mat4x4_f16;
-  tint_array<float3, 2> arr2_vec3_f32;
-  tint_array<half4x2, 2> arr2_mat4x2_f16;
-  Inner struct_inner;
-  tint_array<Inner, 4> array_struct_inner;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ half scalar_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ half2 vec2_f16;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ half3 vec3_f16;
+  /* 0x0066 */ tint_array<int8_t, 10> tint_pad_5;
+  /* 0x0070 */ float4 vec4_f32;
+  /* 0x0080 */ int4 vec4_i32;
+  /* 0x0090 */ uint4 vec4_u32;
+  /* 0x00a0 */ half4 vec4_f16;
+  /* 0x00a8 */ float2x2 mat2x2_f32;
+  /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6;
+  /* 0x00c0 */ float2x3 mat2x3_f32;
+  /* 0x00e0 */ float2x4 mat2x4_f32;
+  /* 0x0100 */ float3x2 mat3x2_f32;
+  /* 0x0118 */ tint_array<int8_t, 8> tint_pad_7;
+  /* 0x0120 */ float3x3 mat3x3_f32;
+  /* 0x0150 */ float3x4 mat3x4_f32;
+  /* 0x0180 */ float4x2 mat4x2_f32;
+  /* 0x01a0 */ float4x3 mat4x3_f32;
+  /* 0x01e0 */ float4x4 mat4x4_f32;
+  /* 0x0220 */ half2x2 mat2x2_f16;
+  /* 0x0228 */ half2x3 mat2x3_f16;
+  /* 0x0238 */ half2x4 mat2x4_f16;
+  /* 0x0248 */ half3x2 mat3x2_f16;
+  /* 0x0254 */ tint_array<int8_t, 4> tint_pad_8;
+  /* 0x0258 */ half3x3 mat3x3_f16;
+  /* 0x0270 */ half3x4 mat3x4_f16;
+  /* 0x0288 */ half4x2 mat4x2_f16;
+  /* 0x0298 */ half4x3 mat4x3_f16;
+  /* 0x02b8 */ half4x4 mat4x4_f16;
+  /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9;
+  /* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
+  /* 0x0320 */ Inner struct_inner;
+  /* 0x032c */ tint_array<Inner, 4> array_struct_inner;
+  /* 0x035c */ tint_array<int8_t, 4> tint_pad_11;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/static_index/write.wgsl.expected.ir.msl b/test/tint/buffer/storage/static_index/write.wgsl.expected.ir.msl
index 27e17a1..2d0de34 100644
--- a/test/tint/buffer/storage/static_index/write.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/static_index/write.wgsl.expected.ir.msl
@@ -14,35 +14,42 @@
 };
 
 struct Inner {
-  int scalar_i32;
-  float scalar_f32;
+  /* 0x0000 */ int scalar_i32;
+  /* 0x0004 */ float scalar_f32;
 };
 
 struct S {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  tint_array<float3, 2> arr2_vec3_f32;
-  Inner struct_inner;
-  tint_array<Inner, 4> array_struct_inner;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ tint_array<int8_t, 8> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ float4 vec4_f32;
+  /* 0x0070 */ int4 vec4_i32;
+  /* 0x0080 */ uint4 vec4_u32;
+  /* 0x0090 */ float2x2 mat2x2_f32;
+  /* 0x00a0 */ float2x3 mat2x3_f32;
+  /* 0x00c0 */ float2x4 mat2x4_f32;
+  /* 0x00e0 */ float3x2 mat3x2_f32;
+  /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5;
+  /* 0x0100 */ float3x3 mat3x3_f32;
+  /* 0x0130 */ float3x4 mat3x4_f32;
+  /* 0x0160 */ float4x2 mat4x2_f32;
+  /* 0x0180 */ float4x3 mat4x3_f32;
+  /* 0x01c0 */ float4x4 mat4x4_f32;
+  /* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0220 */ Inner struct_inner;
+  /* 0x0228 */ tint_array<Inner, 4> array_struct_inner;
+  /* 0x0248 */ tint_array<int8_t, 8> tint_pad_6;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.ir.msl b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.ir.msl
index cef5b52..16a5ff5 100644
--- a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct Inner {
-  int scalar_i32;
-  float scalar_f32;
-  half scalar_f16;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,45 +13,63 @@
   T elements[N];
 };
 
+struct Inner {
+  /* 0x0000 */ int scalar_i32;
+  /* 0x0004 */ float scalar_f32;
+  /* 0x0008 */ half scalar_f16;
+  /* 0x000a */ tint_array<int8_t, 2> tint_pad;
+};
+
 struct S {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  half scalar_f16;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  half2 vec2_f16;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  half3 vec3_f16;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  half4 vec4_f16;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  half2x2 mat2x2_f16;
-  half2x3 mat2x3_f16;
-  half2x4 mat2x4_f16;
-  half3x2 mat3x2_f16;
-  half3x3 mat3x3_f16;
-  half3x4 mat3x4_f16;
-  half4x2 mat4x2_f16;
-  half4x3 mat4x3_f16;
-  half4x4 mat4x4_f16;
-  tint_array<float3, 2> arr2_vec3_f32;
-  tint_array<half4x2, 2> arr2_mat4x2_f16;
-  Inner struct_inner;
-  tint_array<Inner, 4> array_struct_inner;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ half scalar_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad_1;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ half2 vec2_f16;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_5;
+  /* 0x0060 */ half3 vec3_f16;
+  /* 0x0066 */ tint_array<int8_t, 10> tint_pad_6;
+  /* 0x0070 */ float4 vec4_f32;
+  /* 0x0080 */ int4 vec4_i32;
+  /* 0x0090 */ uint4 vec4_u32;
+  /* 0x00a0 */ half4 vec4_f16;
+  /* 0x00a8 */ float2x2 mat2x2_f32;
+  /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_7;
+  /* 0x00c0 */ float2x3 mat2x3_f32;
+  /* 0x00e0 */ float2x4 mat2x4_f32;
+  /* 0x0100 */ float3x2 mat3x2_f32;
+  /* 0x0118 */ tint_array<int8_t, 8> tint_pad_8;
+  /* 0x0120 */ float3x3 mat3x3_f32;
+  /* 0x0150 */ float3x4 mat3x4_f32;
+  /* 0x0180 */ float4x2 mat4x2_f32;
+  /* 0x01a0 */ float4x3 mat4x3_f32;
+  /* 0x01e0 */ float4x4 mat4x4_f32;
+  /* 0x0220 */ half2x2 mat2x2_f16;
+  /* 0x0228 */ half2x3 mat2x3_f16;
+  /* 0x0238 */ half2x4 mat2x4_f16;
+  /* 0x0248 */ half3x2 mat3x2_f16;
+  /* 0x0254 */ tint_array<int8_t, 4> tint_pad_9;
+  /* 0x0258 */ half3x3 mat3x3_f16;
+  /* 0x0270 */ half3x4 mat3x4_f16;
+  /* 0x0288 */ half4x2 mat4x2_f16;
+  /* 0x0298 */ half4x3 mat4x3_f16;
+  /* 0x02b8 */ half4x4 mat4x4_f16;
+  /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_10;
+  /* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
+  /* 0x0320 */ Inner struct_inner;
+  /* 0x032c */ tint_array<Inner, 4> array_struct_inner;
+  /* 0x035c */ tint_array<int8_t, 4> tint_pad_11;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/types/struct_f16.wgsl.expected.ir.msl b/test/tint/buffer/storage/types/struct_f16.wgsl.expected.ir.msl
index 4096535..8172e34d 100644
--- a/test/tint/buffer/storage/types/struct_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/types/struct_f16.wgsl.expected.ir.msl
@@ -1,14 +1,28 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct Inner {
-  half scalar_f16;
-  half3 vec3_f16;
-  half2x4 mat2x4_f16;
+  /* 0x0000 */ half scalar_f16;
+  /* 0x0002 */ tint_array<int8_t, 6> tint_pad;
+  /* 0x0008 */ half3 vec3_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad_1;
+  /* 0x0010 */ half2x4 mat2x4_f16;
 };
 
 struct S {
-  Inner inner;
+  /* 0x0000 */ Inner inner;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/storage/types/struct_f32.wgsl.expected.ir.msl b/test/tint/buffer/storage/types/struct_f32.wgsl.expected.ir.msl
index 4fc7b79..2b901b4 100644
--- a/test/tint/buffer/storage/types/struct_f32.wgsl.expected.ir.msl
+++ b/test/tint/buffer/storage/types/struct_f32.wgsl.expected.ir.msl
@@ -1,14 +1,28 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct Inner {
-  float scalar_f32;
-  float3 vec3_f32;
-  float2x4 mat2x4_f32;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3 vec3_f32;
+  /* 0x001c */ tint_array<int8_t, 4> tint_pad_1;
+  /* 0x0020 */ float2x4 mat2x4_f32;
 };
 
 struct S {
-  Inner inner;
+  /* 0x0000 */ Inner inner;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.msl b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.msl
index 9ec4c3a..d7200db 100644
--- a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.msl
@@ -14,32 +14,38 @@
 };
 
 struct Inner {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ tint_array<int8_t, 8> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ float4 vec4_f32;
+  /* 0x0070 */ int4 vec4_i32;
+  /* 0x0080 */ uint4 vec4_u32;
+  /* 0x0090 */ float2x2 mat2x2_f32;
+  /* 0x00a0 */ float2x3 mat2x3_f32;
+  /* 0x00c0 */ float2x4 mat2x4_f32;
+  /* 0x00e0 */ float3x2 mat3x2_f32;
+  /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5;
+  /* 0x0100 */ float3x3 mat3x3_f32;
+  /* 0x0130 */ float3x4 mat3x4_f32;
+  /* 0x0160 */ float4x2 mat4x2_f32;
+  /* 0x0180 */ float4x3 mat4x3_f32;
+  /* 0x01c0 */ float4x4 mat4x4_f32;
+  /* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32;
 };
 
 struct S {
-  tint_array<Inner, 8> arr;
+  /* 0x0000 */ tint_array<Inner, 8> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.msl b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.msl
index be12dd7..5fda946 100644
--- a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.msl
@@ -14,46 +14,56 @@
 };
 
 struct Inner {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  half scalar_f16;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  half2 vec2_f16;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  half3 vec3_f16;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  half4 vec4_f16;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  half2x2 mat2x2_f16;
-  half2x3 mat2x3_f16;
-  half2x4 mat2x4_f16;
-  half3x2 mat3x2_f16;
-  half3x3 mat3x3_f16;
-  half3x4 mat3x4_f16;
-  half4x2 mat4x2_f16;
-  half4x3 mat4x3_f16;
-  half4x4 mat4x4_f16;
-  tint_array<float3, 2> arr2_vec3_f32;
-  tint_array<half4x2, 2> arr2_mat4x2_f16;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ half scalar_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ half2 vec2_f16;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ half3 vec3_f16;
+  /* 0x0066 */ tint_array<int8_t, 10> tint_pad_5;
+  /* 0x0070 */ float4 vec4_f32;
+  /* 0x0080 */ int4 vec4_i32;
+  /* 0x0090 */ uint4 vec4_u32;
+  /* 0x00a0 */ half4 vec4_f16;
+  /* 0x00a8 */ float2x2 mat2x2_f32;
+  /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6;
+  /* 0x00c0 */ float2x3 mat2x3_f32;
+  /* 0x00e0 */ float2x4 mat2x4_f32;
+  /* 0x0100 */ float3x2 mat3x2_f32;
+  /* 0x0118 */ tint_array<int8_t, 8> tint_pad_7;
+  /* 0x0120 */ float3x3 mat3x3_f32;
+  /* 0x0150 */ float3x4 mat3x4_f32;
+  /* 0x0180 */ float4x2 mat4x2_f32;
+  /* 0x01a0 */ float4x3 mat4x3_f32;
+  /* 0x01e0 */ float4x4 mat4x4_f32;
+  /* 0x0220 */ half2x2 mat2x2_f16;
+  /* 0x0228 */ half2x3 mat2x3_f16;
+  /* 0x0238 */ half2x4 mat2x4_f16;
+  /* 0x0248 */ half3x2 mat3x2_f16;
+  /* 0x0254 */ tint_array<int8_t, 4> tint_pad_8;
+  /* 0x0258 */ half3x3 mat3x3_f16;
+  /* 0x0270 */ half3x4 mat3x4_f16;
+  /* 0x0288 */ half4x2 mat4x2_f16;
+  /* 0x0298 */ half4x3 mat4x3_f16;
+  /* 0x02b8 */ half4x4 mat4x4_f16;
+  /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9;
+  /* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
 };
 
 struct S {
-  tint_array<Inner, 8> arr;
+  /* 0x0000 */ tint_array<Inner, 8> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/static_index/read.wgsl.expected.ir.msl b/test/tint/buffer/uniform/static_index/read.wgsl.expected.ir.msl
index b334c0c..a7dd82f 100644
--- a/test/tint/buffer/uniform/static_index/read.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/static_index/read.wgsl.expected.ir.msl
@@ -14,35 +14,43 @@
 };
 
 struct Inner {
-  int scalar_i32;
-  float scalar_f32;
+  /* 0x0000 */ int scalar_i32;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad_6;
+  /* 0x0010 */ float scalar_f32;
+  /* 0x0014 */ tint_array<int8_t, 12> tint_pad_7;
 };
 
 struct S {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  tint_array<float3, 2> arr2_vec3_f32;
-  Inner struct_inner;
-  tint_array<Inner, 4> array_struct_inner;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ tint_array<int8_t, 8> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ float4 vec4_f32;
+  /* 0x0070 */ int4 vec4_i32;
+  /* 0x0080 */ uint4 vec4_u32;
+  /* 0x0090 */ float2x2 mat2x2_f32;
+  /* 0x00a0 */ float2x3 mat2x3_f32;
+  /* 0x00c0 */ float2x4 mat2x4_f32;
+  /* 0x00e0 */ float3x2 mat3x2_f32;
+  /* 0x00f8 */ tint_array<int8_t, 8> tint_pad_5;
+  /* 0x0100 */ float3x3 mat3x3_f32;
+  /* 0x0130 */ float3x4 mat3x4_f32;
+  /* 0x0160 */ float4x2 mat4x2_f32;
+  /* 0x0180 */ float4x3 mat4x3_f32;
+  /* 0x01c0 */ float4x4 mat4x4_f32;
+  /* 0x0200 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0220 */ Inner struct_inner;
+  /* 0x0240 */ tint_array<Inner, 4> array_struct_inner;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.ir.msl b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.ir.msl
index 7d9458b..722cf1d 100644
--- a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.ir.msl
@@ -14,50 +14,61 @@
 };
 
 struct Inner {
-  int scalar_i32;
-  float scalar_f32;
-  half scalar_f16;
+  /* 0x0000 */ int scalar_i32;
+  /* 0x0004 */ float scalar_f32;
+  /* 0x0008 */ half scalar_f16;
+  /* 0x000a */ tint_array<int8_t, 6> tint_pad_10;
 };
 
 struct S {
-  float scalar_f32;
-  int scalar_i32;
-  uint scalar_u32;
-  half scalar_f16;
-  float2 vec2_f32;
-  int2 vec2_i32;
-  uint2 vec2_u32;
-  half2 vec2_f16;
-  float3 vec3_f32;
-  int3 vec3_i32;
-  uint3 vec3_u32;
-  half3 vec3_f16;
-  float4 vec4_f32;
-  int4 vec4_i32;
-  uint4 vec4_u32;
-  half4 vec4_f16;
-  float2x2 mat2x2_f32;
-  float2x3 mat2x3_f32;
-  float2x4 mat2x4_f32;
-  float3x2 mat3x2_f32;
-  float3x3 mat3x3_f32;
-  float3x4 mat3x4_f32;
-  float4x2 mat4x2_f32;
-  float4x3 mat4x3_f32;
-  float4x4 mat4x4_f32;
-  half2x2 mat2x2_f16;
-  half2x3 mat2x3_f16;
-  half2x4 mat2x4_f16;
-  half3x2 mat3x2_f16;
-  half3x3 mat3x3_f16;
-  half3x4 mat3x4_f16;
-  half4x2 mat4x2_f16;
-  half4x3 mat4x3_f16;
-  half4x4 mat4x4_f16;
-  tint_array<float3, 2> arr2_vec3_f32;
-  tint_array<half4x2, 2> arr2_mat4x2_f16;
-  Inner struct_inner;
-  tint_array<Inner, 4> array_struct_inner;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ int scalar_i32;
+  /* 0x0008 */ uint scalar_u32;
+  /* 0x000c */ half scalar_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad;
+  /* 0x0010 */ float2 vec2_f32;
+  /* 0x0018 */ int2 vec2_i32;
+  /* 0x0020 */ uint2 vec2_u32;
+  /* 0x0028 */ half2 vec2_f16;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
+  /* 0x0030 */ float3 vec3_f32;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad_2;
+  /* 0x0040 */ int3 vec3_i32;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad_3;
+  /* 0x0050 */ uint3 vec3_u32;
+  /* 0x005c */ tint_array<int8_t, 4> tint_pad_4;
+  /* 0x0060 */ half3 vec3_f16;
+  /* 0x0066 */ tint_array<int8_t, 10> tint_pad_5;
+  /* 0x0070 */ float4 vec4_f32;
+  /* 0x0080 */ int4 vec4_i32;
+  /* 0x0090 */ uint4 vec4_u32;
+  /* 0x00a0 */ half4 vec4_f16;
+  /* 0x00a8 */ float2x2 mat2x2_f32;
+  /* 0x00b8 */ tint_array<int8_t, 8> tint_pad_6;
+  /* 0x00c0 */ float2x3 mat2x3_f32;
+  /* 0x00e0 */ float2x4 mat2x4_f32;
+  /* 0x0100 */ float3x2 mat3x2_f32;
+  /* 0x0118 */ tint_array<int8_t, 8> tint_pad_7;
+  /* 0x0120 */ float3x3 mat3x3_f32;
+  /* 0x0150 */ float3x4 mat3x4_f32;
+  /* 0x0180 */ float4x2 mat4x2_f32;
+  /* 0x01a0 */ float4x3 mat4x3_f32;
+  /* 0x01e0 */ float4x4 mat4x4_f32;
+  /* 0x0220 */ half2x2 mat2x2_f16;
+  /* 0x0228 */ half2x3 mat2x3_f16;
+  /* 0x0238 */ half2x4 mat2x4_f16;
+  /* 0x0248 */ half3x2 mat3x2_f16;
+  /* 0x0254 */ tint_array<int8_t, 4> tint_pad_8;
+  /* 0x0258 */ half3x3 mat3x3_f16;
+  /* 0x0270 */ half3x4 mat3x4_f16;
+  /* 0x0288 */ half4x2 mat4x2_f16;
+  /* 0x0298 */ half4x3 mat4x3_f16;
+  /* 0x02b8 */ half4x4 mat4x4_f16;
+  /* 0x02d8 */ tint_array<int8_t, 8> tint_pad_9;
+  /* 0x02e0 */ tint_array<float3, 2> arr2_vec3_f32;
+  /* 0x0300 */ tint_array<half4x2, 2> arr2_mat4x2_f16;
+  /* 0x0320 */ Inner struct_inner;
+  /* 0x0330 */ tint_array<Inner, 4> array_struct_inner;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 39479ac..b70a649 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half2x2 m;
+  /* 0x0000 */ half2x2 m;
+  /* 0x0008 */ tint_array<int8_t, 56> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
index cb9f365..77214d9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half2x2 m;
+  /* 0x0000 */ half2x2 m;
+  /* 0x0008 */ tint_array<int8_t, 56> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.ir.msl
index 9079bed..5595ca9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half2x2 m;
+  /* 0x000c */ tint_array<int8_t, 52> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.ir.msl
index e2ae252..c1314b3 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half2x2 m;
+  /* 0x000c */ tint_array<int8_t, 52> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.ir.msl
index 83a4a23..fcdcb3f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half2x2 m;
+  /* 0x000c */ tint_array<int8_t, 52> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.ir.msl
index 5f66bba..ef86daa 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half2x2 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,14 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half2x2 m;
+  /* 0x000c */ tint_array<int8_t, 52> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.ir.msl
index 92040e5..cdb0a34 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half2x2 m;
+  /* 0x000c */ tint_array<int8_t, 52> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 1da47a4..7c94e1f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float2x2 m;
+  /* 0x0000 */ float2x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
index 473a983..92805a4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float2x2 m;
+  /* 0x0000 */ float2x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.ir.msl
index 91082a4..c0f5b1a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float2x2 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.ir.msl
index da77881..5d023ae 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float2x2 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.ir.msl
index e770acb..be7d908 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float2x2 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.ir.msl
index 1a6a427..e4e4e10 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float2x2 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float2x2 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.ir.msl
index 5623f58..aae5830 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float2x2 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index cedb2a8..77769fe 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half2x3 m;
+  /* 0x0000 */ half2x3 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
index 44ba5af..6260d4b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half2x3 m;
+  /* 0x0000 */ half2x3 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.ir.msl
index f004ef6..9e016a4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x3 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.ir.msl
index f0cdc2f..840ae7f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x3 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.ir.msl
index 81904bb..339001a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x3 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.ir.msl
index aeec4b6..7f315fa 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half2x3 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x3 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.ir.msl
index 7c6f091..acf116b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x3 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 7b1880e..d877c20 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float2x3 m;
+  /* 0x0000 */ float2x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
index 37d8e2f..b4fdc9b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float2x3 m;
+  /* 0x0000 */ float2x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.ir.msl
index 61a1308..445c08f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x3 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.ir.msl
index 7a277e9..14b8246 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x3 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.ir.msl
index fba6d2e..8a5f953 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x3 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.ir.msl
index 20308d4..26feea5 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float2x3 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x3 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.ir.msl
index 8ae084f..80b6e89 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x3 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index c102345..a15644d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half2x4 m;
+  /* 0x0000 */ half2x4 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
index 7c7f1f7..56d0493 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half2x4 m;
+  /* 0x0000 */ half2x4 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.ir.msl
index f2ef74f..c597a29 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x4 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.ir.msl
index d9129a8..58d0e91 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x4 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.ir.msl
index 0862296..5a67939 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x4 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.ir.msl
index 53a80a6..4ae220e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half2x4 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x4 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.ir.msl
index 978149f..2af3623 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half2x4 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 52572c5..56775c4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float2x4 m;
+  /* 0x0000 */ float2x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
index 8adc472..b54f1c4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float2x4 m;
+  /* 0x0000 */ float2x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.ir.msl
index 278f487..e769daa 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x4 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.ir.msl
index 559ab6e..ef2c5bf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x4 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.ir.msl
index 3c4b2c0..dc401fb 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x4 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.ir.msl
index 54427fe..64214a6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float2x4 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x4 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.ir.msl
index 2d22e4d..21c7386 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float2x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float2x4 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 95a3891..6eb3d24 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half3x2 m;
+  /* 0x0000 */ half3x2 m;
+  /* 0x000c */ tint_array<int8_t, 52> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
index e190937..c45a971 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half3x2 m;
+  /* 0x0000 */ half3x2 m;
+  /* 0x000c */ tint_array<int8_t, 52> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.ir.msl
index 94a490d..72493af 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half3x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.ir.msl
index 50c3102..96c72ed 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half3x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.ir.msl
index 60d4653..778c53d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half3x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.ir.msl
index 3102857..c1ce431 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half3x2 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,14 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half3x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.ir.msl
index 8a2d4e0..3e4e0ec 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half3x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 0ca720b..4f82715 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float3x2 m;
+  /* 0x0000 */ float3x2 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
index 2377e6a..883a557 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float3x2 m;
+  /* 0x0000 */ float3x2 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.ir.msl
index 8d4dbd5..88216b7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float3x2 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.ir.msl
index 89d842e..4a8fe9a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float3x2 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.ir.msl
index dc5ddc8..4c5de79 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float3x2 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.ir.msl
index 0016ba1..07922c7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float3x2 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float3x2 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.ir.msl
index 72350e1..ec49517 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float3x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float3x2 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 265ec00..4701892 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half3x3 m;
+  /* 0x0000 */ half3x3 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
index f80af31..c370db7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half3x3 m;
+  /* 0x0000 */ half3x3 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.ir.msl
index 26ee5f4..3cf0846 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.ir.msl
index efd6b0b..6f7f37d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.ir.msl
index 9385f2a..77ccb0d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.ir.msl
index cae3cd1..7ce9b56 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half3x3 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.ir.msl
index 7ac95d5..23eddf5 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index eb51045..7ab3f75 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float3x3 m;
+  /* 0x0000 */ float3x3 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
index 498d5b9..5cb64f7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float3x3 m;
+  /* 0x0000 */ float3x3 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.ir.msl
index ac13d10..52dcaa5 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x3 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.ir.msl
index 14b9672..6371eb7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x3 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.ir.msl
index f01b646..2d6b734 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x3 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.ir.msl
index 3bdd119..a10b8b1 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float3x3 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,14 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x3 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.ir.msl
index bea5446..d8ac7cc 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x3 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 8d11573..d3baa63 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half3x4 m;
+  /* 0x0000 */ half3x4 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
index 71ac2e3..7984819 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half3x4 m;
+  /* 0x0000 */ half3x4 m;
+  /* 0x0018 */ tint_array<int8_t, 40> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.ir.msl
index 0bb7c7e..b0bba90 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.ir.msl
index a63f209..940e6b6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.ir.msl
index 5dfce54..f396b47 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.ir.msl
index 97bb0af..b9e1126 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half3x4 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.ir.msl
index d707274..8713553 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half3x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 1896611..27325bd 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float3x4 m;
+  /* 0x0000 */ float3x4 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
index b55edb3..413fb0a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float3x4 m;
+  /* 0x0000 */ float3x4 m;
+  /* 0x0030 */ tint_array<int8_t, 16> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.ir.msl
index 185e686..a7710b4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x4 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.ir.msl
index 31914ee..bec14bf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x4 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.ir.msl
index a3d516b..265eba8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x4 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.ir.msl
index 5295be9..6565537 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float3x4 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,14 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x4 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.ir.msl
index 8ff5228..0b30ecf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  float3x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3x4 m;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index c23ff65..c63d015 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half4x2 m;
+  /* 0x0000 */ half4x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
index e71f9d5..435b6b2 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half4x2 m;
+  /* 0x0000 */ half4x2 m;
+  /* 0x0010 */ tint_array<int8_t, 48> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.ir.msl
index bd59c67..6606bc6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half4x2 m;
+  /* 0x0014 */ tint_array<int8_t, 44> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.ir.msl
index 69c753e..f7e5ca4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half4x2 m;
+  /* 0x0014 */ tint_array<int8_t, 44> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.ir.msl
index d9ebd85..c65d312 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half4x2 m;
+  /* 0x0014 */ tint_array<int8_t, 44> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.ir.msl
index ebd7423..72c17d4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half4x2 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,14 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half4x2 m;
+  /* 0x0014 */ tint_array<int8_t, 44> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.ir.msl
index c5dbc94..83dee0c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,11 @@
 };
 
 struct S {
-  int before;
-  half4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ half4x2 m;
+  /* 0x0014 */ tint_array<int8_t, 44> tint_pad;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 5b04186..d29fc5c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float4x2 m;
+  /* 0x0000 */ float4x2 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
index bbd29b8..22ca36c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  float4x2 m;
+  /* 0x0000 */ float4x2 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.ir.msl
index 91fa340..64f2632 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float4x2 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.ir.msl
index 9932584..676abc9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float4x2 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.ir.msl
index 0d5e0c9..cc27fbf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float4x2 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.ir.msl
index eec13e0..5953e94 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float4x2 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float4x2 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.ir.msl
index f4a20d0..4a0d100 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x2 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ float4x2 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 6d8ef14..866f2f5 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half4x3 m;
+  /* 0x0000 */ half4x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
index 2fcf59a..52ea0a9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half4x3 m;
+  /* 0x0000 */ half4x3 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.ir.msl
index ee613e1..4295135 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x3 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.ir.msl
index bb1bdd1..91fd5a9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x3 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.ir.msl
index 58a945d..a6cc42e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x3 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.ir.msl
index 35fb9e0..9ce5250 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half4x3 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x3 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.ir.msl
index 65c0987..1fce5cf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x3 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 1ee44ae..39beb2c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,11 @@
 };
 
 struct Inner {
-  float4x3 m;
+  /* 0x0000 */ float4x3 m;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
index cb86acc..f247f0f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,11 @@
 };
 
 struct Inner {
-  float4x3 m;
+  /* 0x0000 */ float4x3 m;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.ir.msl
index 28c7e93..d555819 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x3 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.ir.msl
index f5c4025..77294f6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x3 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.ir.msl
index d0e7d96..d962529 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x3 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.ir.msl
index b47dfec..4c077a8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float4x3 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x3 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.ir.msl
index 5218a7d..e0037a7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x3 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x3 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
index e329180..3ce237e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half4x4 m;
+  /* 0x0000 */ half4x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
index bebe003..2c98d30 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct Inner {
-  half4x4 m;
+  /* 0x0000 */ half4x4 m;
+  /* 0x0020 */ tint_array<int8_t, 32> tint_pad;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.ir.msl
index 64a58c5..cb1bf53 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x4 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.ir.msl
index cd04b24..01780d2 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x4 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.ir.msl
index 8b543ef..2610d2b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x4 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.ir.msl
index c3ca02f..a867e72 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  half4x4 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x4 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.ir.msl
index 35bec2f..47f3faf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  half4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0008 */ half4x4 m;
+  /* 0x0028 */ tint_array<int8_t, 24> tint_pad_1;
+  /* 0x0040 */ int after;
+  /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
index 907ea79..434ba94 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,11 @@
 };
 
 struct Inner {
-  float4x4 m;
+  /* 0x0000 */ float4x4 m;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
index 8beb212..14605b6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.ir.msl
@@ -14,11 +14,11 @@
 };
 
 struct Inner {
-  float4x4 m;
+  /* 0x0000 */ float4x4 m;
 };
 
 struct Outer {
-  tint_array<Inner, 4> a;
+  /* 0x0000 */ tint_array<Inner, 4> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.ir.msl
index 845af8a..fb7b896 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x4 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.ir.msl
index 99f6ab4..d31c269 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x4 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.ir.msl
index 7320d2e..c712668 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x4 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.ir.msl
index 014220a..10fb498 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.ir.msl
@@ -1,12 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct S {
-  int before;
-  float4x4 m;
-  int after;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -19,6 +13,15 @@
   T elements[N];
 };
 
+struct S {
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x4 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
+};
+
 struct tint_module_vars_struct {
   const constant tint_array<S, 4>* u;
   device tint_array<S, 4>* s;
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.ir.msl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.ir.msl
index d265cf1..714b11d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.ir.msl
@@ -14,9 +14,12 @@
 };
 
 struct S {
-  int before;
-  float4x4 m;
-  int after;
+  /* 0x0000 */ int before;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float4x4 m;
+  /* 0x0050 */ tint_array<int8_t, 48> tint_pad_1;
+  /* 0x0080 */ int after;
+  /* 0x0084 */ tint_array<int8_t, 60> tint_pad_2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.ir.msl b/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.ir.msl
index f15a93d..7d35707 100644
--- a/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.ir.msl
@@ -1,14 +1,28 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct Inner {
-  half scalar_f16;
-  half3 vec3_f16;
-  half2x4 mat2x4_f16;
+  /* 0x0000 */ half scalar_f16;
+  /* 0x0002 */ tint_array<int8_t, 6> tint_pad;
+  /* 0x0008 */ half3 vec3_f16;
+  /* 0x000e */ tint_array<int8_t, 2> tint_pad_1;
+  /* 0x0010 */ half2x4 mat2x4_f16;
 };
 
 struct S {
-  Inner inner;
+  /* 0x0000 */ Inner inner;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.ir.msl b/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.ir.msl
index 53edec4..63945a7 100644
--- a/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.ir.msl
+++ b/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.ir.msl
@@ -1,14 +1,28 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct Inner {
-  float scalar_f32;
-  float3 vec3_f32;
-  float2x4 mat2x4_f32;
+  /* 0x0000 */ float scalar_f32;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0010 */ float3 vec3_f32;
+  /* 0x001c */ tint_array<int8_t, 4> tint_pad_1;
+  /* 0x0020 */ float2x4 mat2x4_f32;
 };
 
 struct S {
-  Inner inner;
+  /* 0x0000 */ Inner inner;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/chromium/1273230.wgsl.expected.ir.msl b/test/tint/bug/chromium/1273230.wgsl.expected.ir.msl
index b1d9129..3dbad7e 100644
--- a/test/tint/bug/chromium/1273230.wgsl.expected.ir.msl
+++ b/test/tint/bug/chromium/1273230.wgsl.expected.ir.msl
@@ -1,15 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct Uniforms {
-  uint numTriangles;
-  uint gridSize;
-  uint puuuuuuuuuuuuuuuuad1;
-  uint pad2;
-  float3 bbMin;
-  float3 bbMax;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -22,35 +13,46 @@
   T elements[N];
 };
 
+struct Uniforms {
+  /* 0x0000 */ uint numTriangles;
+  /* 0x0004 */ uint gridSize;
+  /* 0x0008 */ uint puuuuuuuuuuuuuuuuad1;
+  /* 0x000c */ uint pad2;
+  /* 0x0010 */ float3 bbMin;
+  /* 0x001c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0020 */ float3 bbMax;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
+};
+
 struct U32s {
-  tint_array<uint, 1> values;
+  /* 0x0000 */ tint_array<uint, 1> values;
 };
 
 struct F32s {
-  tint_array<float, 1> values;
+  /* 0x0000 */ tint_array<float, 1> values;
 };
 
 struct AU32s {
-  tint_array<atomic_uint, 1> values;
+  /* 0x0000 */ tint_array<atomic_uint, 1> values;
 };
 
 struct AI32s {
-  tint_array<atomic_int, 1> values;
+  /* 0x0000 */ tint_array<atomic_int, 1> values;
 };
 
 struct Dbg {
-  atomic_uint offsetCounter;
-  uint pad0;
-  uint pad1;
-  uint pad2;
-  uint value0;
-  uint value1;
-  uint value2;
-  uint value3;
-  float value_f32_0;
-  float value_f32_1;
-  float value_f32_2;
-  float value_f32_3;
+  /* 0x0000 */ atomic_uint offsetCounter;
+  /* 0x0004 */ uint pad0;
+  /* 0x0008 */ uint pad1;
+  /* 0x000c */ uint pad2;
+  /* 0x0010 */ uint value0;
+  /* 0x0014 */ uint value1;
+  /* 0x0018 */ uint value2;
+  /* 0x001c */ uint value3;
+  /* 0x0020 */ float value_f32_0;
+  /* 0x0024 */ float value_f32_1;
+  /* 0x0028 */ float value_f32_2;
+  /* 0x002c */ float value_f32_3;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.msl
index 328acac..499af21 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.msl
index 86ecac1..58ed7d8 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/storage.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/read/storage.wgsl.expected.ir.msl
index 1b3d7af..22ad4ff 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/storage.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/storage.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 template<typename T, size_t N>
@@ -22,7 +22,7 @@
 };
 
 struct SSBO {
-  tint_array<int, 4> data;
+  /* 0x0000 */ tint_array<int, 4> data;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/uniform.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/read/uniform.wgsl.expected.ir.msl
index 39d850f..d183f35 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/uniform.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/uniform.wgsl.expected.ir.msl
@@ -14,12 +14,13 @@
 };
 
 struct UBO {
-  tint_array<int4, 4> data;
-  int dynamic_idx;
+  /* 0x0000 */ tint_array<int4, 4> data;
+  /* 0x0040 */ int dynamic_idx;
+  /* 0x0044 */ tint_array<int8_t, 12> tint_pad;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.msl
index 1e161de..955f46a 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.msl
index 697d905..ddd9a85 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.msl
index a5bc504..a22555e 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.msl
@@ -18,11 +18,11 @@
 };
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.msl
index d4e7c6a..2137798 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.msl
index 78ac2cd..a92b547 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.msl
@@ -18,11 +18,11 @@
 };
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/storage.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/write/storage.wgsl.expected.ir.msl
index 7403c0b..8f5df4d 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/storage.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/storage.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 template<typename T, size_t N>
@@ -22,7 +22,7 @@
 };
 
 struct SSBO {
-  tint_array<int, 4> data;
+  /* 0x0000 */ tint_array<int, 4> data;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.msl b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.msl
index b663c19..6808f32 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct UBO {
-  int dynamic_idx;
+  /* 0x0000 */ int dynamic_idx;
 };
 
 struct Result {
-  int out;
+  /* 0x0000 */ int out;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.msl b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.msl
index 6223bc7..057aeaf 100644
--- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.msl
@@ -14,18 +14,20 @@
 };
 
 struct Particle {
-  tint_array<float3, 8> position;
-  float lifetime;
-  float4 color;
-  float3 velocity;
+  /* 0x0000 */ tint_array<float3, 8> position;
+  /* 0x0080 */ float lifetime;
+  /* 0x0084 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0090 */ float4 color;
+  /* 0x00a0 */ float3 velocity;
+  /* 0x00ac */ tint_array<int8_t, 4> tint_pad_1;
 };
 
 struct Particles {
-  tint_array<Particle, 1> p;
+  /* 0x0000 */ tint_array<Particle, 1> p;
 };
 
 struct Simulation {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.msl
index cbacb1d..d0393ac 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.msl
index 59c74be..ba672da 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl.expected.ir.msl
index 1b063a3..51aeb13 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_y.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.msl
index cda31ad..fb81238 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.msl
index 8734af8..e59f055 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.msl
index c733180..e08cdbb 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl.expected.ir.msl
index 1b063a3..51aeb13 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_y.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.msl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.msl
index 320373d..1fecf66 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.msl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1046.wgsl.expected.ir.msl b/test/tint/bug/tint/1046.wgsl.expected.ir.msl
index 19fbef4..b70f800 100644
--- a/test/tint/bug/tint/1046.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1046.wgsl.expected.ir.msl
@@ -9,14 +9,6 @@
   float4 color;
 };
 
-struct Uniforms {
-  float4x4 worldView;
-  float4x4 proj;
-  uint numPointLights;
-  uint color_source;
-  float4 color;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -29,6 +21,15 @@
   T elements[N];
 };
 
+struct Uniforms {
+  /* 0x0000 */ float4x4 worldView;
+  /* 0x0040 */ float4x4 proj;
+  /* 0x0080 */ uint numPointLights;
+  /* 0x0084 */ uint color_source;
+  /* 0x0088 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0090 */ float4 color;
+};
+
 struct PointLight {
   float4 position;
 };
diff --git a/test/tint/bug/tint/1061.spvasm.expected.ir.msl b/test/tint/bug/tint/1061.spvasm.expected.ir.msl
index 31848d1..ff2751e 100644
--- a/test/tint/bug/tint/1061.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/1061.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct buf0 {
-  float4 r;
+  /* 0x0000 */ float4 r;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1088.spvasm.expected.ir.msl b/test/tint/bug/tint/1088.spvasm.expected.ir.msl
index c29125e..9cd7296 100644
--- a/test/tint/bug/tint/1088.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/1088.spvasm.expected.ir.msl
@@ -14,14 +14,16 @@
 };
 
 struct strided_arr {
-  float el;
+  /* 0x0000 */ float el;
+  /* 0x0004 */ tint_array<int8_t, 12> tint_pad_1;
 };
 
 struct LeftOver {
-  float4x4 worldViewProjection;
-  float time;
-  tint_array<float4x4, 2> test2;
-  tint_array<strided_arr, 4> test;
+  /* 0x0000 */ float4x4 worldViewProjection;
+  /* 0x0040 */ float time;
+  /* 0x0044 */ tint_array<int8_t, 12> tint_pad;
+  /* 0x0050 */ tint_array<float4x4, 2> test2;
+  /* 0x00d0 */ tint_array<strided_arr, 4> test;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1113.wgsl.expected.ir.msl b/test/tint/bug/tint/1113.wgsl.expected.ir.msl
index 39c6522..aadbc56 100644
--- a/test/tint/bug/tint/1113.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1113.wgsl.expected.ir.msl
@@ -1,15 +1,6 @@
 #include <metal_stdlib>
 using namespace metal;
 
-struct Uniforms {
-  uint numTriangles;
-  uint gridSize;
-  uint pad1;
-  uint pad2;
-  float3 bbMin;
-  float3 bbMax;
-};
-
 template<typename T, size_t N>
 struct tint_array {
   const constant T& operator[](size_t i) const constant { return elements[i]; }
@@ -22,35 +13,46 @@
   T elements[N];
 };
 
+struct Uniforms {
+  /* 0x0000 */ uint numTriangles;
+  /* 0x0004 */ uint gridSize;
+  /* 0x0008 */ uint pad1;
+  /* 0x000c */ uint pad2;
+  /* 0x0010 */ float3 bbMin;
+  /* 0x001c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0020 */ float3 bbMax;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
+};
+
 struct U32s {
-  tint_array<uint, 1> values;
+  /* 0x0000 */ tint_array<uint, 1> values;
 };
 
 struct F32s {
-  tint_array<float, 1> values;
+  /* 0x0000 */ tint_array<float, 1> values;
 };
 
 struct AU32s {
-  tint_array<atomic_uint, 1> values;
+  /* 0x0000 */ tint_array<atomic_uint, 1> values;
 };
 
 struct AI32s {
-  tint_array<atomic_int, 1> values;
+  /* 0x0000 */ tint_array<atomic_int, 1> values;
 };
 
 struct Dbg {
-  atomic_uint offsetCounter;
-  uint pad0;
-  uint pad1;
-  uint pad2;
-  uint value0;
-  uint value1;
-  uint value2;
-  uint value3;
-  float value_f32_0;
-  float value_f32_1;
-  float value_f32_2;
-  float value_f32_3;
+  /* 0x0000 */ atomic_uint offsetCounter;
+  /* 0x0004 */ uint pad0;
+  /* 0x0008 */ uint pad1;
+  /* 0x000c */ uint pad2;
+  /* 0x0010 */ uint value0;
+  /* 0x0014 */ uint value1;
+  /* 0x0018 */ uint value2;
+  /* 0x001c */ uint value3;
+  /* 0x0020 */ float value_f32_0;
+  /* 0x0024 */ float value_f32_1;
+  /* 0x0028 */ float value_f32_2;
+  /* 0x002c */ float value_f32_3;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1118.wgsl.expected.ir.msl b/test/tint/bug/tint/1118.wgsl.expected.ir.msl
index 5abbad2..e68178c 100644
--- a/test/tint/bug/tint/1118.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1118.wgsl.expected.ir.msl
@@ -2,19 +2,19 @@
 using namespace metal;
 
 struct Scene {
-  float4 vEyePosition;
+  /* 0x0000 */ float4 vEyePosition;
 };
 
 struct Material {
-  float4 vDiffuseColor;
-  float3 vAmbientColor;
-  float placeholder;
-  float3 vEmissiveColor;
-  float placeholder2;
+  /* 0x0000 */ float4 vDiffuseColor;
+  /* 0x0010 */ float3 vAmbientColor;
+  /* 0x001c */ float placeholder;
+  /* 0x0020 */ float3 vEmissiveColor;
+  /* 0x002c */ float placeholder2;
 };
 
 struct Mesh {
-  float visibility;
+  /* 0x0000 */ float visibility;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1121.wgsl.expected.ir.msl b/test/tint/bug/tint/1121.wgsl.expected.ir.msl
index b49754a..b65ee40 100644
--- a/test/tint/bug/tint/1121.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1121.wgsl.expected.ir.msl
@@ -14,39 +14,39 @@
 };
 
 struct LightData {
-  float4 position;
-  float3 color;
-  float radius;
+  /* 0x0000 */ float4 position;
+  /* 0x0010 */ float3 color;
+  /* 0x001c */ float radius;
 };
 
 struct LightsBuffer {
-  tint_array<LightData, 1> lights;
+  /* 0x0000 */ tint_array<LightData, 1> lights;
 };
 
 struct TileLightIdData {
-  atomic_uint count;
-  tint_array<uint, 64> lightId;
+  /* 0x0000 */ atomic_uint count;
+  /* 0x0004 */ tint_array<uint, 64> lightId;
 };
 
 struct Tiles {
-  tint_array<TileLightIdData, 4> data;
+  /* 0x0000 */ tint_array<TileLightIdData, 4> data;
 };
 
 struct Config {
-  uint numLights;
-  uint numTiles;
-  uint tileCountX;
-  uint tileCountY;
-  uint numTileLightSlot;
-  uint tileSize;
+  /* 0x0000 */ uint numLights;
+  /* 0x0004 */ uint numTiles;
+  /* 0x0008 */ uint tileCountX;
+  /* 0x000c */ uint tileCountY;
+  /* 0x0010 */ uint numTileLightSlot;
+  /* 0x0014 */ uint tileSize;
 };
 
 struct Uniforms {
-  float4 min;
-  float4 max;
-  float4x4 viewMatrix;
-  float4x4 projectionMatrix;
-  float4 fullScreenSize;
+  /* 0x0000 */ float4 min;
+  /* 0x0010 */ float4 max;
+  /* 0x0020 */ float4x4 viewMatrix;
+  /* 0x0060 */ float4x4 projectionMatrix;
+  /* 0x00a0 */ float4 fullScreenSize;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1520.spvasm.expected.ir.msl b/test/tint/bug/tint/1520.spvasm.expected.ir.msl
index e8a7c2a..3ea9488 100644
--- a/test/tint/bug/tint/1520.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/1520.spvasm.expected.ir.msl
@@ -1,11 +1,25 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct UniformBuffer {
-  float unknownInput_S1_c0;
-  float4 ucolorRed_S1_c0;
-  float4 ucolorGreen_S1_c0;
-  float3x3 umatrix_S1;
+  /* 0x0000 */ tint_array<int8_t, 16> tint_pad;
+  /* 0x0010 */ float unknownInput_S1_c0;
+  /* 0x0014 */ tint_array<int8_t, 12> tint_pad_1;
+  /* 0x0020 */ float4 ucolorRed_S1_c0;
+  /* 0x0030 */ float4 ucolorGreen_S1_c0;
+  /* 0x0040 */ float3x3 umatrix_S1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1534.wgsl.expected.ir.msl b/test/tint/bug/tint/1534.wgsl.expected.ir.msl
index d763121..a55cabe1 100644
--- a/test/tint/bug/tint/1534.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1534.wgsl.expected.ir.msl
@@ -1,12 +1,25 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct g {
-  uint3 a;
+  /* 0x0000 */ uint3 a;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
 };
 
 struct h {
-  uint a;
+  /* 0x0000 */ uint a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1542.wgsl.expected.ir.msl b/test/tint/bug/tint/1542.wgsl.expected.ir.msl
index eb74b03..2102c35 100644
--- a/test/tint/bug/tint/1542.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1542.wgsl.expected.ir.msl
@@ -1,8 +1,21 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct UniformBuffer {
-  int3 d;
+  /* 0x0000 */ int3 d;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1677.wgsl.expected.ir.msl b/test/tint/bug/tint/1677.wgsl.expected.ir.msl
index 0d5d5a1..378e5c0 100644
--- a/test/tint/bug/tint/1677.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1677.wgsl.expected.ir.msl
@@ -1,8 +1,21 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct Input {
-  int3 position;
+  /* 0x0000 */ int3 position;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1735.wgsl.expected.ir.msl b/test/tint/bug/tint/1735.wgsl.expected.ir.msl
index 51cf63a..44e2147 100644
--- a/test/tint/bug/tint/1735.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1735.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct S {
-  float f;
+  /* 0x0000 */ float f;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1739.wgsl.expected.ir.msl b/test/tint/bug/tint/1739.wgsl.expected.ir.msl
index 358f52e..04cc0c5 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1739.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1776.spvasm.expected.ir.msl b/test/tint/bug/tint/1776.spvasm.expected.ir.msl
index dfd67d0..43ac809 100644
--- a/test/tint/bug/tint/1776.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/1776.spvasm.expected.ir.msl
@@ -14,12 +14,13 @@
 };
 
 struct S {
-  float4 a;
-  int b;
+  /* 0x0000 */ float4 a;
+  /* 0x0010 */ int b;
+  /* 0x0014 */ tint_array<int8_t, 12> tint_pad;
 };
 
 struct sb_block {
-  tint_array<S, 1> inner;
+  /* 0x0000 */ tint_array<S, 1> inner;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1776.wgsl.expected.ir.msl b/test/tint/bug/tint/1776.wgsl.expected.ir.msl
index e1917e6..37ee21d 100644
--- a/test/tint/bug/tint/1776.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1776.wgsl.expected.ir.msl
@@ -14,8 +14,9 @@
 };
 
 struct S {
-  float4 a;
-  int b;
+  /* 0x0000 */ float4 a;
+  /* 0x0010 */ int b;
+  /* 0x0014 */ tint_array<int8_t, 12> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1860.wgsl.expected.ir.msl b/test/tint/bug/tint/1860.wgsl.expected.ir.msl
index 1b6d775..1818ab6 100644
--- a/test/tint/bug/tint/1860.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1860.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct DeclaredAfterUsage {
-  float f;
+  /* 0x0000 */ float f;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1875.wgsl.expected.ir.msl b/test/tint/bug/tint/1875.wgsl.expected.ir.msl
index 4f715b3..4200fee 100644
--- a/test/tint/bug/tint/1875.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1875.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct Outputs {
-  tint_array<uint, 1> data;
+  /* 0x0000 */ tint_array<uint, 1> data;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/1976.wgsl.expected.ir.msl b/test/tint/bug/tint/1976.wgsl.expected.ir.msl
index ef30dca..f8f0209 100644
--- a/test/tint/bug/tint/1976.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/1976.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct Results {
-  tint_array<float, 4> colorSamples;
+  /* 0x0000 */ tint_array<float, 4> colorSamples;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/2010.spvasm.expected.ir.msl b/test/tint/bug/tint/2010.spvasm.expected.ir.msl
index b3388ff..57eed71 100644
--- a/test/tint/bug/tint/2010.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/2010.spvasm.expected.ir.msl
@@ -19,19 +19,19 @@
 };
 
 struct S_1 {
-  uint field0;
+  /* 0x0000 */ uint field0;
 };
 
 struct S_2 {
-  S_1 field0;
+  /* 0x0000 */ S_1 field0;
 };
 
 struct S_3 {
-  tint_array<float4, 1> field0;
+  /* 0x0000 */ tint_array<float4, 1> field0;
 };
 
 struct S_4 {
-  tint_array<float4, 1> field0;
+  /* 0x0000 */ tint_array<float4, 1> field0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/2059.wgsl.expected.ir.msl b/test/tint/bug/tint/2059.wgsl.expected.ir.msl
index 80477ba..a511efa 100644
--- a/test/tint/bug/tint/2059.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/2059.wgsl.expected.ir.msl
@@ -14,19 +14,19 @@
 };
 
 struct S2 {
-  tint_array<float3x3, 1> m;
+  /* 0x0000 */ tint_array<float3x3, 1> m;
 };
 
 struct S {
-  float3x3 m;
+  /* 0x0000 */ float3x3 m;
 };
 
 struct S4 {
-  tint_array<S, 1> s;
+  /* 0x0000 */ tint_array<S, 1> s;
 };
 
 struct S3 {
-  S s;
+  /* 0x0000 */ S s;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/2100.wgsl.expected.ir.msl b/test/tint/bug/tint/2100.wgsl.expected.ir.msl
index d63526a..b71fd96 100644
--- a/test/tint/bug/tint/2100.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/2100.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct S {
-  float4x4 matrix_view;
-  float3x3 matrix_normal;
+  /* 0x0000 */ float4x4 matrix_view;
+  /* 0x0040 */ float3x3 matrix_normal;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/221.wgsl.expected.ir.msl b/test/tint/bug/tint/221.wgsl.expected.ir.msl
index 7b19427..f3e91c9 100644
--- a/test/tint/bug/tint/221.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/221.wgsl.expected.ir.msl
@@ -14,8 +14,8 @@
 };
 
 struct Buf {
-  uint count;
-  tint_array<uint, 50> data;
+  /* 0x0000 */ uint count;
+  /* 0x0004 */ tint_array<uint, 50> data;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/349310442.wgsl.expected.ir.msl b/test/tint/bug/tint/349310442.wgsl.expected.ir.msl
index 7be4a60..80be341 100644
--- a/test/tint/bug/tint/349310442.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/349310442.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/403.wgsl.expected.ir.msl b/test/tint/bug/tint/403.wgsl.expected.ir.msl
index ce7bb4c..dd6017e 100644
--- a/test/tint/bug/tint/403.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/403.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct vertexUniformBuffer1 {
-  float2x2 transform1;
+  /* 0x0000 */ float2x2 transform1;
 };
 
 struct vertexUniformBuffer2 {
-  float2x2 transform2;
+  /* 0x0000 */ float2x2 transform2;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/492.wgsl.expected.ir.msl b/test/tint/bug/tint/492.wgsl.expected.ir.msl
index 8d641c6..9419639 100644
--- a/test/tint/bug/tint/492.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/492.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct S {
-  int a;
+  /* 0x0000 */ int a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/534.wgsl.expected.ir.msl b/test/tint/bug/tint/534.wgsl.expected.ir.msl
index e843936..c008335 100644
--- a/test/tint/bug/tint/534.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/534.wgsl.expected.ir.msl
@@ -14,14 +14,14 @@
 };
 
 struct OutputBuf {
-  tint_array<uint, 1> result;
+  /* 0x0000 */ tint_array<uint, 1> result;
 };
 
 struct Uniforms {
-  uint dstTextureFlipY;
-  uint isFloat16;
-  uint isRGB10A2Unorm;
-  uint channelCount;
+  /* 0x0000 */ uint dstTextureFlipY;
+  /* 0x0004 */ uint isFloat16;
+  /* 0x0008 */ uint isRGB10A2Unorm;
+  /* 0x000c */ uint channelCount;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/744.wgsl.expected.ir.msl b/test/tint/bug/tint/744.wgsl.expected.ir.msl
index 372694a..b1d6f8d 100644
--- a/test/tint/bug/tint/744.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/744.wgsl.expected.ir.msl
@@ -14,13 +14,13 @@
 };
 
 struct Matrix {
-  tint_array<uint, 1> numbers;
+  /* 0x0000 */ tint_array<uint, 1> numbers;
 };
 
 struct Uniforms {
-  uint2 aShape;
-  uint2 bShape;
-  uint2 outShape;
+  /* 0x0000 */ uint2 aShape;
+  /* 0x0008 */ uint2 bShape;
+  /* 0x0010 */ uint2 outShape;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/757.wgsl.expected.ir.msl b/test/tint/bug/tint/757.wgsl.expected.ir.msl
index be953f7..12d3138 100644
--- a/test/tint/bug/tint/757.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/757.wgsl.expected.ir.msl
@@ -18,7 +18,7 @@
 };
 
 struct Result {
-  tint_array<float, 1> values;
+  /* 0x0000 */ tint_array<float, 1> values;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/827.wgsl.expected.ir.msl b/test/tint/bug/tint/827.wgsl.expected.ir.msl
index 2e73031..8aa648a 100644
--- a/test/tint/bug/tint/827.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/827.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct Result {
-  tint_array<float, 1> values;
+  /* 0x0000 */ tint_array<float, 1> values;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/870.spvasm.expected.ir.msl b/test/tint/bug/tint/870.spvasm.expected.ir.msl
index 133596e..2300f40 100644
--- a/test/tint/bug/tint/870.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/870.spvasm.expected.ir.msl
@@ -14,14 +14,15 @@
 };
 
 struct sspp962805860buildInformationS {
-  float4 footprint;
-  float4 offset;
-  int essence;
-  tint_array<int, 6> orientation;
+  /* 0x0000 */ float4 footprint;
+  /* 0x0010 */ float4 offset;
+  /* 0x0020 */ int essence;
+  /* 0x0024 */ tint_array<int, 6> orientation;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad;
 };
 
 struct x_B4_BuildInformation {
-  sspp962805860buildInformationS passthru;
+  /* 0x0000 */ sspp962805860buildInformationS passthru;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/913.wgsl.expected.ir.msl b/test/tint/bug/tint/913.wgsl.expected.ir.msl
index dc72df7..ca655b5 100644
--- a/test/tint/bug/tint/913.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/913.wgsl.expected.ir.msl
@@ -14,15 +14,15 @@
 };
 
 struct OutputBuf {
-  tint_array<uint, 1> result;
+  /* 0x0000 */ tint_array<uint, 1> result;
 };
 
 struct Uniforms {
-  uint dstTextureFlipY;
-  uint channelCount;
-  uint2 srcCopyOrigin;
-  uint2 dstCopyOrigin;
-  uint2 copySize;
+  /* 0x0000 */ uint dstTextureFlipY;
+  /* 0x0004 */ uint channelCount;
+  /* 0x0008 */ uint2 srcCopyOrigin;
+  /* 0x0010 */ uint2 dstCopyOrigin;
+  /* 0x0018 */ uint2 copySize;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/914.wgsl.expected.ir.msl b/test/tint/bug/tint/914.wgsl.expected.ir.msl
index ee544c2..0745782 100644
--- a/test/tint/bug/tint/914.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/914.wgsl.expected.ir.msl
@@ -14,13 +14,13 @@
 };
 
 struct Matrix {
-  tint_array<float, 1> numbers;
+  /* 0x0000 */ tint_array<float, 1> numbers;
 };
 
 struct Uniforms {
-  uint dimAOuter;
-  uint dimInner;
-  uint dimBOuter;
+  /* 0x0000 */ uint dimAOuter;
+  /* 0x0004 */ uint dimInner;
+  /* 0x0008 */ uint dimBOuter;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/922.wgsl.expected.ir.msl b/test/tint/bug/tint/922.wgsl.expected.ir.msl
index 5361ddb..9c7b76d 100644
--- a/test/tint/bug/tint/922.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/922.wgsl.expected.ir.msl
@@ -2,25 +2,25 @@
 using namespace metal;
 
 struct Mat4x3_ {
-  float4 mx;
-  float4 my;
-  float4 mz;
+  /* 0x0000 */ float4 mx;
+  /* 0x0010 */ float4 my;
+  /* 0x0020 */ float4 mz;
 };
 
 struct Mat4x4_ {
-  float4 mx;
-  float4 my;
-  float4 mz;
-  float4 mw;
+  /* 0x0000 */ float4 mx;
+  /* 0x0010 */ float4 my;
+  /* 0x0020 */ float4 mz;
+  /* 0x0030 */ float4 mw;
 };
 
 struct Mat4x2_ {
-  float4 mx;
-  float4 my;
+  /* 0x0000 */ float4 mx;
+  /* 0x0010 */ float4 my;
 };
 
 struct ub_SceneParams {
-  Mat4x4_ u_Projection;
+  /* 0x0000 */ Mat4x4_ u_Projection;
 };
 
 template<typename T, size_t N>
@@ -36,12 +36,12 @@
 };
 
 struct ub_MaterialParams {
-  tint_array<Mat4x2_, 1> u_TexMtx;
-  float4 u_Misc0_;
+  /* 0x0000 */ tint_array<Mat4x2_, 1> u_TexMtx;
+  /* 0x0020 */ float4 u_Misc0_;
 };
 
 struct ub_PacketParams {
-  tint_array<Mat4x3_, 32> u_PosMtx;
+  /* 0x0000 */ tint_array<Mat4x3_, 32> u_PosMtx;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/926.wgsl.expected.ir.msl b/test/tint/bug/tint/926.wgsl.expected.ir.msl
index fb274d4..564bb1c 100644
--- a/test/tint/bug/tint/926.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/926.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct DrawIndirectArgs {
-  atomic_uint vertexCount;
+  /* 0x0000 */ atomic_uint vertexCount;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/942.wgsl.expected.ir.msl b/test/tint/bug/tint/942.wgsl.expected.ir.msl
index f1655d5..b694881 100644
--- a/test/tint/bug/tint/942.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/942.wgsl.expected.ir.msl
@@ -2,12 +2,12 @@
 using namespace metal;
 
 struct Params {
-  uint filterDim;
-  uint blockDim;
+  /* 0x0000 */ uint filterDim;
+  /* 0x0004 */ uint blockDim;
 };
 
 struct Flip {
-  uint value;
+  /* 0x0000 */ uint value;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/bug/tint/948.wgsl.expected.ir.msl b/test/tint/bug/tint/948.wgsl.expected.ir.msl
index 2d0fd9c..16ffd48 100644
--- a/test/tint/bug/tint/948.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/948.wgsl.expected.ir.msl
@@ -1,16 +1,30 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct LeftOver {
-  float time;
-  uint padding;
-  float4x4 worldViewProjection;
-  float2 outputSize;
-  float2 stageSize;
-  float2 spriteMapSize;
-  float stageScale;
-  float spriteCount;
-  float3 colorMul;
+  /* 0x0000 */ float time;
+  /* 0x0004 */ uint padding;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float4x4 worldViewProjection;
+  /* 0x0050 */ float2 outputSize;
+  /* 0x0058 */ float2 stageSize;
+  /* 0x0060 */ float2 spriteMapSize;
+  /* 0x0068 */ float stageScale;
+  /* 0x006c */ float spriteCount;
+  /* 0x0070 */ float3 colorMul;
+  /* 0x007c */ tint_array<int8_t, 4> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/959.wgsl.expected.ir.msl b/test/tint/bug/tint/959.wgsl.expected.ir.msl
index 8d25b99..c40d666 100644
--- a/test/tint/bug/tint/959.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/959.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct S {
-  float a;
+  /* 0x0000 */ float a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/977.spvasm.expected.ir.msl b/test/tint/bug/tint/977.spvasm.expected.ir.msl
index 72d36a0..b5381ce 100644
--- a/test/tint/bug/tint/977.spvasm.expected.ir.msl
+++ b/test/tint/bug/tint/977.spvasm.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct ResultMatrix {
-  tint_array<float, 1> numbers;
+  /* 0x0000 */ tint_array<float, 1> numbers;
 };
 
 struct FirstMatrix {
diff --git a/test/tint/bug/tint/980.wgsl.expected.ir.msl b/test/tint/bug/tint/980.wgsl.expected.ir.msl
index b100667..ab03ff4 100644
--- a/test/tint/bug/tint/980.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/980.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct S {
-  float3 v;
-  uint i;
+  /* 0x0000 */ float3 v;
+  /* 0x000c */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/993.wgsl.expected.ir.msl b/test/tint/bug/tint/993.wgsl.expected.ir.msl
index 7ab34ed..5a17088 100644
--- a/test/tint/bug/tint/993.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/993.wgsl.expected.ir.msl
@@ -2,11 +2,11 @@
 using namespace metal;
 
 struct Constants {
-  uint zero;
+  /* 0x0000 */ uint zero;
 };
 
 struct Result {
-  uint value;
+  /* 0x0000 */ uint value;
 };
 
 template<typename T, size_t N>
@@ -22,7 +22,7 @@
 };
 
 struct TestData {
-  tint_array<atomic_int, 3> data;
+  /* 0x0000 */ tint_array<atomic_int, 3> data;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/bug/tint/998.wgsl.expected.ir.msl b/test/tint/bug/tint/998.wgsl.expected.ir.msl
index 31fbb04..d8a150d 100644
--- a/test/tint/bug/tint/998.wgsl.expected.ir.msl
+++ b/test/tint/bug/tint/998.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Constants {
-  uint zero;
+  /* 0x0000 */ uint zero;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/builtins/arrayLength/complex_via_let.wgsl.expected.ir.msl b/test/tint/builtins/arrayLength/complex_via_let.wgsl.expected.ir.msl
index 3f47f17..ea758f3 100644
--- a/test/tint/builtins/arrayLength/complex_via_let.wgsl.expected.ir.msl
+++ b/test/tint/builtins/arrayLength/complex_via_let.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int, 1> a;
+  /* 0x0000 */ tint_array<int, 1> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/arrayLength/deprecated.wgsl.expected.ir.msl b/test/tint/builtins/arrayLength/deprecated.wgsl.expected.ir.msl
index 21f6f0a..5e0fa7b 100644
--- a/test/tint/builtins/arrayLength/deprecated.wgsl.expected.ir.msl
+++ b/test/tint/builtins/arrayLength/deprecated.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int, 1> a;
+  /* 0x0000 */ tint_array<int, 1> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/arrayLength/simple.wgsl.expected.ir.msl b/test/tint/builtins/arrayLength/simple.wgsl.expected.ir.msl
index 46da449..66f2b71 100644
--- a/test/tint/builtins/arrayLength/simple.wgsl.expected.ir.msl
+++ b/test/tint/builtins/arrayLength/simple.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int, 1> a;
+  /* 0x0000 */ tint_array<int, 1> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/arrayLength/via_let.wgsl.expected.ir.msl b/test/tint/builtins/arrayLength/via_let.wgsl.expected.ir.msl
index f1540b6..5137c87 100644
--- a/test/tint/builtins/arrayLength/via_let.wgsl.expected.ir.msl
+++ b/test/tint/builtins/arrayLength/via_let.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int, 1> a;
+  /* 0x0000 */ tint_array<int, 1> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/arrayLength/via_let_complex.wgsl.expected.ir.msl b/test/tint/builtins/arrayLength/via_let_complex.wgsl.expected.ir.msl
index e9c7855..1c61388 100644
--- a/test/tint/builtins/arrayLength/via_let_complex.wgsl.expected.ir.msl
+++ b/test/tint/builtins/arrayLength/via_let_complex.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int, 1> a;
+  /* 0x0000 */ tint_array<int, 1> a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.ir.msl
index 3c754fd..be53b18 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.ir.msl
index 4b1bf8c..1e18e22 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.ir.msl
index 444a039..234ea2a 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.ir.msl
index 5f8c1e8..6a4749d 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl
index 5e32e2f..b3bd030 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl
index 73e2f1f..0b27f18 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.ir.msl
index a0cd367..ff0b3e5 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.ir.msl
index 1c4a8b2..b3b7b2d 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.ir.msl
index 82de26f..62c091e 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.ir.msl
index 0e5d5b0..49acd9d 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.ir.msl
index 8443c08..48f1eb9 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.ir.msl
index cab2952..f9a8f49 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.ir.msl
index 3fa68d7..76093d8 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.ir.msl
index dfd160f..54d4241 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.ir.msl
index 060f99b..a8ab97b 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.ir.msl
index 5add47f..666bcb1 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.ir.msl
index 4375c1e..b8d5d2b 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.ir.msl
index 4d39e50..e967fc7 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.ir.msl
index afd02e8..76d5e18 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.ir.msl
index 7f472e5..1f93b01 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.ir.msl
index 5b02ed5..d346cb6 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.ir.msl
index db3675c..01d7d14 100644
--- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl
index dbbbe61..2f524d4 100644
--- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl
index 7f02976..46072b3 100644
--- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl
index 3c754fd..be53b18 100644
--- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl
index 4b1bf8c..1e18e22 100644
--- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.ir.msl
index b94d748..663d94e 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.ir.msl
index f506fae..1ec28fa 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.ir.msl
index 38735a0..3881d68 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.ir.msl
index 107674c..240f452 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl
index 9636d71..b42ff58 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl
index 028ea60..947460c 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.ir.msl
index db63deb..18159f6 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.ir.msl
index afff228..b7b37d8 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.ir.msl
index 82de26f..62c091e 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.ir.msl
index 0e5d5b0..49acd9d 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.ir.msl
index ba51b47..24c4874 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.ir.msl
index 7cfba6b..9d6736c 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.ir.msl
index 710509f..b1b1245 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.ir.msl
index 1528844..cd33ff2 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.ir.msl
index 3a2890d..566d0f0 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.ir.msl
index 167cfef..d11e8fa 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.ir.msl
index 367e867..d89aed9 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.ir.msl
index a4ad115..d07b71c 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.ir.msl
index 6ab9339..4a418fd 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.ir.msl
index c576d2c..d270718 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.ir.msl
index 061f831..3444876 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.ir.msl
index e60d04f..7c589b0 100644
--- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl
index be29506..aaa9971 100644
--- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl
index bce91a8..ac2c7c9 100644
--- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl
index 9a980cb..424c835 100644
--- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl
index fa6e921..b120009 100644
--- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl
+++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW_atomic {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.ir.msl
index bb4c1ed..9ad2b34 100644
--- a/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/1588cd.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<int, 1> arg_0;
+  /* 0x0000 */ tint_array<int, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.ir.msl
index 333bef1..a9cdd42 100644
--- a/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/61b1c7.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<int, 1> arg_0;
+  /* 0x0000 */ tint_array<int, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.ir.msl
index e990af6..bad7c67 100644
--- a/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/8421b9.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<half, 1> arg_0;
+  /* 0x0000 */ tint_array<half, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.ir.msl
index 6865212..f411f3d 100644
--- a/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/a0f5ca.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<float, 1> arg_0;
+  /* 0x0000 */ tint_array<float, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.ir.msl
index dc05097..33d63cd 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/cbd6b5.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<half, 1> arg_0;
+  /* 0x0000 */ tint_array<half, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.ir.msl
index a112177..6d61850 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/cdd123.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<float, 1> arg_0;
+  /* 0x0000 */ tint_array<float, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.ir.msl
index f4b5f28..dd8b1dd 100644
--- a/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/cfca0a.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<uint, 1> arg_0;
+  /* 0x0000 */ tint_array<uint, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.ir.msl
index 9a7302b..d1c4e96 100644
--- a/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/arrayLength/eb510f.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<uint, 1> arg_0;
+  /* 0x0000 */ tint_array<uint, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.ir.msl
index 5dc7ca6..a31e606 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.ir.msl
index 66b04f5..9b135d5 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.ir.msl
index c765a5d..726cc59 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.ir.msl
index b6632a4..6f53835 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl
index 30e6bf0..7c3d71f 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl
index 9e2a21f..d0337b9 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.ir.msl
index 5bdebe1..92d023b 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.ir.msl
index 9d54aa4..d30d2ed 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.ir.msl
index 97bce3e..e0f5d35 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.ir.msl
index 2ca2601..21e2056 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.ir.msl
index 817e219..59f386a 100644
--- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.ir.msl
index f31ff37..abe332a 100644
--- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.ir.msl
index 1a153ca..a6c9a1d 100644
--- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.ir.msl
index 7ae726f..8d84b49 100644
--- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.ir.msl
index b146432..b729d9b 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.ir.msl
index b05a8ca..2ee8869 100644
--- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.ir.msl
index 923945a..32ec8eb 100644
--- a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.ir.msl
index 401722b..2a8c7a5 100644
--- a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.ir.msl
index 58ee6ef..750e723 100644
--- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.ir.msl
index 3facb1c..3dc1a5e 100644
--- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.ir.msl
index 6e6efae..f0afd32 100644
--- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.ir.msl
index 795548b..e051a48 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.ir.msl
index eabc376..21cb459 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.ir.msl
@@ -1,32 +1,45 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.ir.msl
index 007a3b5..b349245 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.ir.msl
index 3409c8d..3ad9925 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
index cfaab81..84a5d59 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.ir.msl
index bb4c1ed..9ad2b34 100644
--- a/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/1588cd.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<int, 1> arg_0;
+  /* 0x0000 */ tint_array<int, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.ir.msl
index 333bef1..a9cdd42 100644
--- a/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/61b1c7.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<int, 1> arg_0;
+  /* 0x0000 */ tint_array<int, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.ir.msl
index e990af6..bad7c67 100644
--- a/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/8421b9.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<half, 1> arg_0;
+  /* 0x0000 */ tint_array<half, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.ir.msl
index 6865212..f411f3d 100644
--- a/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/a0f5ca.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<float, 1> arg_0;
+  /* 0x0000 */ tint_array<float, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.ir.msl
index dc05097..33d63cd 100644
--- a/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/cbd6b5.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<half, 1> arg_0;
+  /* 0x0000 */ tint_array<half, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.ir.msl
index a112177..6d61850 100644
--- a/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/cdd123.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<float, 1> arg_0;
+  /* 0x0000 */ tint_array<float, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.ir.msl
index f4b5f28..dd8b1dd 100644
--- a/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/cfca0a.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RO {
-  tint_array<uint, 1> arg_0;
+  /* 0x0000 */ tint_array<uint, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.ir.msl
index 9a7302b..d1c4e96 100644
--- a/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/arrayLength/eb510f.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct SB_RW {
-  tint_array<uint, 1> arg_0;
+  /* 0x0000 */ tint_array<uint, 1> arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.ir.msl
index e50af22..2d721c0 100644
--- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.ir.msl
index 59b7d9b..ac538cc 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.ir.msl
index 37c005e..26d6f8b 100644
--- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.ir.msl
index ad84e65..d297e6d 100644
--- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl
index 5c7c288..0a8bef2 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl
index 74f8e73..3ab211d 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.ir.msl
@@ -7,7 +7,7 @@
 };
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.ir.msl
index af3fc7e..c3075fc 100644
--- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.ir.msl
index bf41aba..50e7f00 100644
--- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.ir.msl
index 97bce3e..e0f5d35 100644
--- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.ir.msl
index 2ca2601..21e2056 100644
--- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.ir.msl
index ac62ba7..b1e9a51 100644
--- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.ir.msl
index 46bc52a..5642c47 100644
--- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.ir.msl
index d3d8ce6..f27ff10 100644
--- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.ir.msl
index 24958e1..a2e0601 100644
--- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.ir.msl
index 0cf7246..3954439 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.ir.msl
index 3de174c..7414b10 100644
--- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.ir.msl
index 2ef8913..20270aa 100644
--- a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.ir.msl
index ceda928..acd1522 100644
--- a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.ir.msl
index 534153b..0a7eeab 100644
--- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.ir.msl
index f4ca029..a1dfdc1 100644
--- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.ir.msl
index 141734a..68e6d28 100644
--- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_uint arg_0;
+  /* 0x0000 */ atomic_uint arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.ir.msl
index 0a7f36a..8a5bd31 100644
--- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SB_RW {
-  atomic_int arg_0;
+  /* 0x0000 */ atomic_int arg_0;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.ir.msl
index eabc376..21cb459 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.ir.msl
@@ -1,32 +1,45 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.ir.msl
index ffbe539..d1e0be3 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.ir.msl
index b99e178..39f75f9 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
index fa4ac0c..f416161 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.ir.msl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.ir.msl
index 030f268..0a45840 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.ir.msl
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.ir.msl
@@ -2,31 +2,44 @@
 using namespace metal;
 
 struct tint_GammaTransferParams {
-  float G;
-  float A;
-  float B;
-  float C;
-  float D;
-  float E;
-  float F;
-  uint padding;
+  /* 0x0000 */ float G;
+  /* 0x0004 */ float A;
+  /* 0x0008 */ float B;
+  /* 0x000c */ float C;
+  /* 0x0010 */ float D;
+  /* 0x0014 */ float E;
+  /* 0x0018 */ float F;
+  /* 0x001c */ uint padding;
+};
+
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
 };
 
 struct tint_ExternalTextureParams {
-  uint numPlanes;
-  uint doYuvToRgbConversionOnly;
-  float3x4 yuvToRgbConversionMatrix;
-  tint_GammaTransferParams gammaDecodeParams;
-  tint_GammaTransferParams gammaEncodeParams;
-  float3x3 gamutConversionMatrix;
-  float3x2 sampleTransform;
-  float3x2 loadTransform;
-  float2 samplePlane0RectMin;
-  float2 samplePlane0RectMax;
-  float2 samplePlane1RectMin;
-  float2 samplePlane1RectMax;
-  uint2 visibleSize;
-  float2 plane1CoordFactor;
+  /* 0x0000 */ uint numPlanes;
+  /* 0x0004 */ uint doYuvToRgbConversionOnly;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0010 */ float3x4 yuvToRgbConversionMatrix;
+  /* 0x0040 */ tint_GammaTransferParams gammaDecodeParams;
+  /* 0x0060 */ tint_GammaTransferParams gammaEncodeParams;
+  /* 0x0080 */ float3x3 gamutConversionMatrix;
+  /* 0x00b0 */ float3x2 sampleTransform;
+  /* 0x00c8 */ float3x2 loadTransform;
+  /* 0x00e0 */ float2 samplePlane0RectMin;
+  /* 0x00e8 */ float2 samplePlane0RectMax;
+  /* 0x00f0 */ float2 samplePlane1RectMin;
+  /* 0x00f8 */ float2 samplePlane1RectMax;
+  /* 0x0100 */ uint2 visibleSize;
+  /* 0x0108 */ float2 plane1CoordFactor;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.ir.msl
index 00e18ac..c770f38 100644
--- a/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.ir.msl
@@ -1,9 +1,23 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  half3x2 tint_symbol;
-  half3 vector;
+  /* 0x0000 */ half3x2 tint_symbol;
+  /* 0x000c */ tint_array<int8_t, 4> tint_pad;
+  /* 0x0010 */ half3 vector;
+  /* 0x0016 */ tint_array<int8_t, 2> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.ir.msl
index 1362eb2..dfab2a7 100644
--- a/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.ir.msl
@@ -1,9 +1,23 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  float3x2 tint_symbol;
-  float3 vector;
+  /* 0x0000 */ float3x2 tint_symbol;
+  /* 0x0018 */ tint_array<int8_t, 8> tint_pad;
+  /* 0x0020 */ float3 vector;
+  /* 0x002c */ tint_array<int8_t, 4> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.ir.msl
index 17bc5d8..875233e 100644
--- a/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.ir.msl
@@ -1,9 +1,22 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  half3x3 tint_symbol;
-  half3 vector;
+  /* 0x0000 */ half3x3 tint_symbol;
+  /* 0x0018 */ half3 vector;
+  /* 0x001e */ tint_array<int8_t, 2> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.ir.msl
index 6b627de..00430eea 100644
--- a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.ir.msl
@@ -1,9 +1,22 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  float3x3 tint_symbol;
-  float3 vector;
+  /* 0x0000 */ float3x3 tint_symbol;
+  /* 0x0030 */ float3 vector;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.ir.msl
index e195972..0745d95 100644
--- a/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.ir.msl
@@ -1,9 +1,22 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  half3x3 tint_symbol;
-  half3 vector;
+  /* 0x0000 */ half3x3 tint_symbol;
+  /* 0x0018 */ half3 vector;
+  /* 0x001e */ tint_array<int8_t, 2> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.ir.msl
index 4702b86..d297590 100644
--- a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.ir.msl
@@ -1,9 +1,22 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  float3x3 tint_symbol;
-  float3 vector;
+  /* 0x0000 */ float3x3 tint_symbol;
+  /* 0x0030 */ float3 vector;
+  /* 0x003c */ tint_array<int8_t, 4> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.ir.msl
index 705ae34..f7cf4c7 100644
--- a/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.ir.msl
@@ -1,9 +1,22 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  half4x3 tint_symbol;
-  half3 vector;
+  /* 0x0000 */ half4x3 tint_symbol;
+  /* 0x0020 */ half3 vector;
+  /* 0x0026 */ tint_array<int8_t, 2> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.ir.msl b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.ir.msl
index a59152e..92d2212 100644
--- a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.ir.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.ir.msl
@@ -1,9 +1,22 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  float4x3 tint_symbol;
-  float3 vector;
+  /* 0x0000 */ float4x3 tint_symbol;
+  /* 0x0040 */ float3 vector;
+  /* 0x004c */ tint_array<int8_t, 4> tint_pad;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/layout/storage/mat2x2/f32.wgsl.expected.ir.msl b/test/tint/layout/storage/mat2x2/f32.wgsl.expected.ir.msl
index f39cf80..13e533e 100644
--- a/test/tint/layout/storage/mat2x2/f32.wgsl.expected.ir.msl
+++ b/test/tint/layout/storage/mat2x2/f32.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct SSBO {
-  float2x2 m;
+  /* 0x0000 */ float2x2 m;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.msl b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.msl
index 04c9f61..e23ac2f 100644
--- a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.msl
+++ b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.ir.msl
@@ -14,11 +14,12 @@
 };
 
 struct strided_arr {
-  float2 el;
+  /* 0x0000 */ float2 el;
+  /* 0x0008 */ tint_array<int8_t, 8> tint_pad;
 };
 
 struct SSBO {
-  tint_array<strided_arr, 2> m;
+  /* 0x0000 */ tint_array<strided_arr, 2> m;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/local/ptr_storage.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/local/ptr_storage.wgsl.expected.ir.msl
index e094cd6..150eb1c 100644
--- a/test/tint/ptr_ref/load/local/ptr_storage.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/local/ptr_storage.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct S {
-  int a;
+  /* 0x0000 */ int a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/local/ptr_uniform.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/local/ptr_uniform.wgsl.expected.ir.msl
index 49c51f7..153f6c8 100644
--- a/test/tint/ptr_ref/load/local/ptr_uniform.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/local/ptr_uniform.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct S {
-  int a;
+  /* 0x0000 */ int a;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.ir.msl
index 2058825..fcd6736 100644
--- a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct str {
-  tint_array<int, 4> arr;
+  /* 0x0000 */ tint_array<int, 4> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/param/storage/i32_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/storage/i32_in_struct.wgsl.expected.ir.msl
index 4325281..55858cd 100644
--- a/test/tint/ptr_ref/load/param/storage/i32_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/storage/i32_in_struct.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  int i;
+  /* 0x0000 */ int i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.ir.msl
index 89d9b3a..621667c 100644
--- a/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  int i;
+  /* 0x0000 */ int i;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/ptr_ref/load/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl
index f8e27d8..2f36053 100644
--- a/test/tint/ptr_ref/load/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  float4 i;
+  /* 0x0000 */ float4 i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.ir.msl
index d865889..f230b7e 100644
--- a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct str {
-  tint_array<int4, 4> arr;
+  /* 0x0000 */ tint_array<int4, 4> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/param/uniform/i32_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/uniform/i32_in_struct.wgsl.expected.ir.msl
index a3c0790..eb715b0 100644
--- a/test/tint/ptr_ref/load/param/uniform/i32_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/uniform/i32_in_struct.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  int i;
+  /* 0x0000 */ int i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.ir.msl
index 5eca1fc..5c99fa3 100644
--- a/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  int4 i;
+  /* 0x0000 */ int4 i;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_struct.wgsl.expected.ir.msl
index 00add01..d72db23 100644
--- a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_struct.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  float4 i;
+  /* 0x0000 */ float4 i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.ir.msl
index 57592d3..e46394e 100644
--- a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct str {
-  tint_array<int, 4> arr;
+  /* 0x0000 */ tint_array<int, 4> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/store/param/storage/i32_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/store/param/storage/i32_in_struct.wgsl.expected.ir.msl
index 333bffd..92a5fbe 100644
--- a/test/tint/ptr_ref/store/param/storage/i32_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/store/param/storage/i32_in_struct.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  int i;
+  /* 0x0000 */ int i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.ir.msl b/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.ir.msl
index 311ba61..8fa57fc 100644
--- a/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  int i;
+  /* 0x0000 */ int i;
 };
 
 template<typename T, size_t N>
diff --git a/test/tint/ptr_ref/store/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl b/test/tint/ptr_ref/store/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl
index 5fc87f2..baaf6c6 100644
--- a/test/tint/ptr_ref/store/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl
+++ b/test/tint/ptr_ref/store/param/storage/vec4_f32_in_struct.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct str {
-  float4 i;
+  /* 0x0000 */ float4 i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/samples/compute_boids.wgsl.expected.ir.msl b/test/tint/samples/compute_boids.wgsl.expected.ir.msl
index 547e870..1b4125b 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.ir.msl
+++ b/test/tint/samples/compute_boids.wgsl.expected.ir.msl
@@ -2,13 +2,13 @@
 using namespace metal;
 
 struct SimParams {
-  float deltaT;
-  float rule1Distance;
-  float rule2Distance;
-  float rule3Distance;
-  float rule1Scale;
-  float rule2Scale;
-  float rule3Scale;
+  /* 0x0000 */ float deltaT;
+  /* 0x0004 */ float rule1Distance;
+  /* 0x0008 */ float rule2Distance;
+  /* 0x000c */ float rule3Distance;
+  /* 0x0010 */ float rule1Scale;
+  /* 0x0014 */ float rule2Scale;
+  /* 0x0018 */ float rule3Scale;
 };
 
 template<typename T, size_t N>
@@ -24,12 +24,12 @@
 };
 
 struct Particle {
-  float2 pos;
-  float2 vel;
+  /* 0x0000 */ float2 pos;
+  /* 0x0008 */ float2 vel;
 };
 
 struct Particles {
-  tint_array<Particle, 5> particles;
+  /* 0x0000 */ tint_array<Particle, 5> particles;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/samples/cube.wgsl.expected.ir.msl b/test/tint/samples/cube.wgsl.expected.ir.msl
index 1623db9..3a6ce7d 100644
--- a/test/tint/samples/cube.wgsl.expected.ir.msl
+++ b/test/tint/samples/cube.wgsl.expected.ir.msl
@@ -12,7 +12,7 @@
 };
 
 struct Uniforms {
-  float4x4 modelViewProjectionMatrix;
+  /* 0x0000 */ float4x4 modelViewProjectionMatrix;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.msl
index 955a8a0..1c0c0c2 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.msl
index c4ebe43..69d664d 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.msl
index b719bf8..f7c2674 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.msl
index a5bf992..10279cf 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.msl
index 24d8c12..0a5b721 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.msl
index b461acb..57968d0 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.msl
index 372b7de..38514da 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.msl
index 78db215..f7ac301 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.ir.msl
index c38b101..e9e2700 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 template<typename T, size_t N>
@@ -18,11 +18,11 @@
 };
 
 struct InnerS {
-  int v;
+  /* 0x0000 */ int v;
 };
 
 struct OuterS {
-  tint_array<InnerS, 1> a1;
+  /* 0x0000 */ tint_array<InnerS, 1> a1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.ir.msl
index 95aa5b0..46d6374 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.ir.msl
@@ -2,8 +2,8 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
-  uint j;
+  /* 0x0000 */ uint i;
+  /* 0x0004 */ uint j;
 };
 
 template<typename T, size_t N>
@@ -19,15 +19,15 @@
 };
 
 struct InnerS {
-  int v;
+  /* 0x0000 */ int v;
 };
 
 struct S1 {
-  tint_array<InnerS, 8> a2;
+  /* 0x0000 */ tint_array<InnerS, 8> a2;
 };
 
 struct OuterS {
-  tint_array<S1, 1> a1;
+  /* 0x0000 */ tint_array<S1, 1> a1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.msl
index b963b95..284e042 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.msl
index 3d4254c..22693ac 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.msl
index 8e39e22..854e40a 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.ir.msl
index c9831af..c1e8455 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_vector.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.msl
index 5f58e2f..cdd9c6b 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.msl
index d9cab6a..e209539 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.msl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.msl
index aab0312..a1f4df3 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.msl
@@ -22,7 +22,7 @@
 };
 
 struct Uniforms {
-  uint i;
+  /* 0x0000 */ uint i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/phony/addr_of_runtime_array.wgsl.expected.ir.msl b/test/tint/statements/assign/phony/addr_of_runtime_array.wgsl.expected.ir.msl
index f44bb86..9b13c27 100644
--- a/test/tint/statements/assign/phony/addr_of_runtime_array.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/phony/addr_of_runtime_array.wgsl.expected.ir.msl
@@ -14,7 +14,7 @@
 };
 
 struct S {
-  tint_array<int, 1> arr;
+  /* 0x0000 */ tint_array<int, 1> arr;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/phony/storage_buffer.wgsl.expected.ir.msl b/test/tint/statements/assign/phony/storage_buffer.wgsl.expected.ir.msl
index 748cc03..be578f6 100644
--- a/test/tint/statements/assign/phony/storage_buffer.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/phony/storage_buffer.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct S {
-  int i;
+  /* 0x0000 */ int i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/statements/assign/phony/uniform_buffer.wgsl.expected.ir.msl b/test/tint/statements/assign/phony/uniform_buffer.wgsl.expected.ir.msl
index 40eb0ee..f90d812 100644
--- a/test/tint/statements/assign/phony/uniform_buffer.wgsl.expected.ir.msl
+++ b/test/tint/statements/assign/phony/uniform_buffer.wgsl.expected.ir.msl
@@ -2,7 +2,7 @@
 using namespace metal;
 
 struct S {
-  int i;
+  /* 0x0000 */ int i;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/types/functions/shader_io/attributes_on_struct_not_used_for_interface.wgsl.expected.ir.msl b/test/tint/types/functions/shader_io/attributes_on_struct_not_used_for_interface.wgsl.expected.ir.msl
index d572f69..eb6fb25 100644
--- a/test/tint/types/functions/shader_io/attributes_on_struct_not_used_for_interface.wgsl.expected.ir.msl
+++ b/test/tint/types/functions/shader_io/attributes_on_struct_not_used_for_interface.wgsl.expected.ir.msl
@@ -1,10 +1,24 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  float f;
-  uint u;
-  float4 v;
+  /* 0x0000 */ float f;
+  /* 0x0004 */ uint u;
+  /* 0x0008 */ tint_array<int8_t, 120> tint_pad;
+  /* 0x0080 */ float4 v;
+  /* 0x0090 */ tint_array<int8_t, 112> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.ir.msl b/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.ir.msl
index 883172d..1f28e94 100644
--- a/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.ir.msl
+++ b/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.ir.msl
@@ -1,10 +1,24 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  float f;
-  uint u;
-  float4 v;
+  /* 0x0000 */ float f;
+  /* 0x0004 */ uint u;
+  /* 0x0008 */ tint_array<int8_t, 120> tint_pad;
+  /* 0x0080 */ float4 v;
+  /* 0x0090 */ tint_array<int8_t, 112> tint_pad_1;
 };
 
 struct tint_module_vars_struct {
diff --git a/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.ir.msl b/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.ir.msl
index a515cc8..2e298b4 100644
--- a/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.ir.msl
+++ b/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.ir.msl
@@ -1,12 +1,28 @@
 #include <metal_stdlib>
 using namespace metal;
 
+template<typename T, size_t N>
+struct tint_array {
+  const constant T& operator[](size_t i) const constant { return elements[i]; }
+  device T& operator[](size_t i) device { return elements[i]; }
+  const device T& operator[](size_t i) const device { return elements[i]; }
+  thread T& operator[](size_t i) thread { return elements[i]; }
+  const thread T& operator[](size_t i) const thread { return elements[i]; }
+  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
+  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
+  T elements[N];
+};
+
 struct S {
-  float f;
-  uint u;
-  float4 v;
-  half x;
-  half3 y;
+  /* 0x0000 */ float f;
+  /* 0x0004 */ uint u;
+  /* 0x0008 */ tint_array<int8_t, 120> tint_pad;
+  /* 0x0080 */ float4 v;
+  /* 0x0090 */ tint_array<int8_t, 16> tint_pad_1;
+  /* 0x00a0 */ half x;
+  /* 0x00a2 */ tint_array<int8_t, 30> tint_pad_2;
+  /* 0x00c0 */ half3 y;
+  /* 0x00c6 */ tint_array<int8_t, 58> tint_pad_3;
 };
 
 struct tint_module_vars_struct {