[spirv-writer] Make block emission non-recursive.

Change the spirv-writer to not recurse through blocks during emission.
Instead, blocks are stored into the functions and a list of blocks to
emit is maintained. We then emit from the list.

Bug: 409346479
Change-Id: Ibc6fad2ac2a4845e1ec952b62bb01dd0bce2a8c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/235916
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/spirv/writer/common/function.cc b/src/tint/lang/spirv/writer/common/function.cc
index 5ec0eb2..ba133c3 100644
--- a/src/tint/lang/spirv/writer/common/function.cc
+++ b/src/tint/lang/spirv/writer/common/function.cc
@@ -27,8 +27,24 @@
 
 #include "src/tint/lang/spirv/writer/common/function.h"
 
-namespace tint::spirv::writer {
+#include <unordered_map>
+#include <unordered_set>
 
+#include "src/tint/utils/ice/ice.h"
+
+namespace tint::spirv::writer {
+namespace {
+
+bool IsFunctionTerminator(spv::Op op) {
+    return op == spv::Op::OpReturn || op == spv::Op::OpReturnValue || op == spv::Op::OpKill ||
+           op == spv::Op::OpUnreachable || op == spv::Op::OpTerminateInvocation;
+}
+
+bool IsBranchTerminator(spv::Op op) {
+    return op == spv::Op::OpBranch || op == spv::Op::OpBranchConditional || op == spv::Op::OpSwitch;
+}
+
+}  // namespace
 Function::Function() : declaration_(Instruction{spv::Op::OpNop, {}}), label_op_(Operand(0u)) {}
 
 Function::Function(const Instruction& declaration,
@@ -54,7 +70,99 @@
     for (const auto& var : vars_) {
         cb(var);
     }
-    for (const auto& blk : blocks_) {
+
+    std::vector<uint32_t> block_order;
+    block_order.reserve(blocks_.size());
+
+    std::unordered_set<uint32_t> seen_blocks;
+
+    std::vector<uint32_t> block_idx_stack;
+    block_idx_stack.push_back(0);
+    seen_blocks.insert(0);
+
+    auto idx_for_id = [&](uint32_t id) -> uint32_t {
+        auto iter = block_id_to_block_.find(id);
+        TINT_ASSERT(iter != block_id_to_block_.end());
+        return iter->second;
+    };
+
+    auto push_id = [&](const Instruction& inst, size_t idx) {
+        auto id = idx_for_id(std::get<uint32_t>(inst.Operands()[idx]));
+
+        if (seen_blocks.find(id) != seen_blocks.end()) {
+            return;
+        }
+        seen_blocks.insert(id);
+
+        block_idx_stack.push_back(id);
+    };
+
+    while (!block_idx_stack.empty()) {
+        auto idx = block_idx_stack.back();
+        block_idx_stack.pop_back();
+
+        block_order.push_back(idx);
+
+        auto& blk = blocks_[idx];
+        auto& term = blk.back();
+        if (IsFunctionTerminator(term.Opcode())) {
+            continue;
+        }
+
+        TINT_ASSERT(IsBranchTerminator(term.Opcode()));
+
+        // The initial block doesn't have a label, so can end up with 1
+        // instruction.
+        if (blk.size() >= 2) {
+            auto& pre_term = blk[blk.size() - 2];
+
+            // Push the merges first so the emit after the branch conditional.
+            switch (pre_term.Opcode()) {
+                case spv::Op::OpSelectionMerge: {
+                    push_id(pre_term, 0);
+                    break;
+                }
+                case spv::Op::OpLoopMerge: {
+                    // Push merge first, then continuing
+                    push_id(pre_term, 0);
+                    push_id(pre_term, 1);
+                    break;
+                }
+                default:
+                    break;
+            }
+        }
+
+        switch (term.Opcode()) {
+            case spv::Op::OpBranch: {
+                push_id(term, 0);
+                break;
+            }
+            case spv::Op::OpBranchConditional: {
+                // Push false then true as we'll emit in reversed order
+                push_id(term, 2);
+                push_id(term, 1);
+
+                break;
+            }
+            case spv::Op::OpSwitch: {
+                auto& ops = term.Operands();
+                for (size_t k = ops.size() - 1; k > 2; k -= 2) {
+                    push_id(term, k);
+                }
+                push_id(term, 1);
+                break;
+            }
+            default:
+                TINT_UNREACHABLE();
+        }
+    }
+
+    TINT_ASSERT(seen_blocks.size() == blocks_.size());
+
+    // Emit the blocks in block order
+    for (const auto& idx : block_order) {
+        auto& blk = blocks_[idx];
         for (const auto& inst : blk) {
             cb(inst);
         }
diff --git a/src/tint/lang/spirv/writer/common/function.h b/src/tint/lang/spirv/writer/common/function.h
index dd1fa7a..633f08a 100644
--- a/src/tint/lang/spirv/writer/common/function.h
+++ b/src/tint/lang/spirv/writer/common/function.h
@@ -29,6 +29,7 @@
 #define SRC_TINT_LANG_SPIRV_WRITER_COMMON_FUNCTION_H_
 
 #include <functional>
+#include <unordered_map>
 #include <vector>
 
 #include "src/tint/lang/spirv/writer/common/instruction.h"
@@ -79,9 +80,12 @@
     }
     /// Adds a new block to the block list
     /// @returns the index of the new block
-    size_t AppendBlock() {
+    size_t AppendBlock(uint32_t spv_id) {
         blocks_.push_back({});
-        return blocks_.size() - 1;
+
+        auto blk_id = blocks_.size() - 1;
+        block_id_to_block_[spv_id] = static_cast<uint32_t>(blk_id);
+        return blk_id;
     }
     /// Sets the block to insert into
     /// @param idx the index to set
@@ -124,6 +128,8 @@
     InstructionList vars_;
     std::vector<Block> blocks_;
     size_t current_block_idx_ = 0;
+
+    std::unordered_map<uint32_t, uint32_t> block_id_to_block_;
 };
 
 }  // namespace tint::spirv::writer
diff --git a/src/tint/lang/spirv/writer/discard_test.cc b/src/tint/lang/spirv/writer/discard_test.cc
index febaf8f..bf46c9d 100644
--- a/src/tint/lang/spirv/writer/discard_test.cc
+++ b/src/tint/lang/spirv/writer/discard_test.cc
@@ -65,21 +65,21 @@
                OpStore %continue_execution %false None
                OpBranch %18
          %18 = OpLabel
-         %21 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-         %25 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %26 None
-               OpBranchConditional %25 %27 %26
-         %27 = OpLabel
-               OpStore %21 %int_42 None
-               OpBranch %26
+         %20 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+         %24 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %25 None
+               OpBranchConditional %24 %26 %25
          %26 = OpLabel
-         %29 = OpLoad %bool %continue_execution None
-         %30 = OpLogicalNot %bool %29
-               OpSelectionMerge %31 None
-               OpBranchConditional %30 %32 %31
-         %32 = OpLabel
+               OpStore %20 %int_42 None
+               OpBranch %25
+         %25 = OpLabel
+         %27 = OpLoad %bool %continue_execution None
+         %28 = OpLogicalNot %bool %27
+               OpSelectionMerge %29 None
+               OpBranchConditional %28 %30 %29
+         %30 = OpLabel
                OpKill
-         %31 = OpLabel
+         %29 = OpLabel
                OpReturnValue %float_0_5
                OpFunctionEnd
 )");
@@ -118,24 +118,24 @@
                OpStore %continue_execution %false None
                OpBranch %18
          %18 = OpLabel
-         %21 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-         %25 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %26 None
-               OpBranchConditional %25 %27 %28
-         %27 = OpLabel
-         %29 = OpAtomicIAdd %int %21 %uint_1 %uint_0 %int_1
-               OpBranch %26
-         %28 = OpLabel
-               OpBranch %26
+         %20 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+         %24 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %25 None
+               OpBranchConditional %24 %26 %27
          %26 = OpLabel
-         %32 = OpPhi %int %29 %27 %33 %28
-         %34 = OpLoad %bool %continue_execution None
-         %35 = OpLogicalNot %bool %34
-               OpSelectionMerge %36 None
-               OpBranchConditional %35 %37 %36
-         %37 = OpLabel
+         %29 = OpAtomicIAdd %int %20 %uint_1 %uint_0 %int_1
+               OpBranch %25
+         %27 = OpLabel
+               OpBranch %25
+         %25 = OpLabel
+         %28 = OpPhi %int %29 %26 %30 %27
+         %31 = OpLoad %bool %continue_execution None
+         %32 = OpLogicalNot %bool %31
+               OpSelectionMerge %33 None
+               OpBranchConditional %32 %34 %33
+         %34 = OpLabel
                OpKill
-         %36 = OpLabel
+         %33 = OpLabel
                OpReturnValue %float_0_5
                OpFunctionEnd
 )");
diff --git a/src/tint/lang/spirv/writer/if_test.cc b/src/tint/lang/spirv/writer/if_test.cc
index 6538461..d9eae1e 100644
--- a/src/tint/lang/spirv/writer/if_test.cc
+++ b/src/tint/lang/spirv/writer/if_test.cc
@@ -102,6 +102,7 @@
 
     ASSERT_TRUE(Generate()) << Error() << output_;
     EXPECT_INST(R"(
+          %4 = OpLabel
                OpSelectionMerge %5 None
                OpBranchConditional %true %5 %6
           %6 = OpLabel
@@ -154,6 +155,7 @@
 
     ASSERT_TRUE(Generate()) << Error() << output_;
     EXPECT_INST(R"(
+          %4 = OpLabel
                OpSelectionMerge %5 None
                OpBranchConditional %true %6 %7
           %6 = OpLabel
@@ -182,7 +184,7 @@
     });
 
     ASSERT_TRUE(Generate()) << Error() << output_;
-    EXPECT_INST("%18 = OpUndef %int");
+    EXPECT_INST("%16 = OpUndef %int");
     EXPECT_INST(R"(
                OpSelectionMerge %12 None
                OpBranchConditional %true %13 %14
@@ -193,16 +195,16 @@
          %14 = OpLabel
                OpBranch %12
          %12 = OpLabel
-         %17 = OpPhi %int %18 %13 %int_20 %14
-         %20 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %21 None
-               OpBranchConditional %20 %22 %21
-         %22 = OpLabel
-               OpStore %return_value %17 None
-               OpBranch %21
-         %21 = OpLabel
-         %23 = OpLoad %int %return_value None
-               OpReturnValue %23
+         %15 = OpPhi %int %16 %13 %int_20 %14
+         %18 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %19 None
+               OpBranchConditional %18 %20 %19
+         %20 = OpLabel
+               OpStore %return_value %15 None
+               OpBranch %19
+         %19 = OpLabel
+         %21 = OpLoad %int %return_value None
+               OpReturnValue %21
                OpFunctionEnd
 )");
 }
@@ -222,7 +224,7 @@
     });
 
     ASSERT_TRUE(Generate()) << Error() << output_;
-    EXPECT_INST("%19 = OpUndef %int");
+    EXPECT_INST("%17 = OpUndef %int");
     EXPECT_INST(R"(
                OpSelectionMerge %12 None
                OpBranchConditional %true %13 %14
@@ -233,16 +235,16 @@
                OpStore %return_value %int_42 None
                OpBranch %12
          %12 = OpLabel
-         %17 = OpPhi %int %int_10 %13 %19 %14
-         %20 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %21 None
-               OpBranchConditional %20 %22 %21
-         %22 = OpLabel
-               OpStore %return_value %17 None
-               OpBranch %21
-         %21 = OpLabel
-         %23 = OpLoad %int %return_value None
-               OpReturnValue %23
+         %15 = OpPhi %int %int_10 %13 %17 %14
+         %18 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %19 None
+               OpBranchConditional %18 %20 %19
+         %20 = OpLabel
+               OpStore %return_value %15 None
+               OpBranch %19
+         %19 = OpLabel
+         %21 = OpLoad %int %return_value None
+               OpReturnValue %21
                OpFunctionEnd
 )");
 }
@@ -291,6 +293,7 @@
 
     ASSERT_TRUE(Generate()) << Error() << output_;
     EXPECT_INST(R"(
+          %4 = OpLabel
                OpSelectionMerge %5 None
                OpBranchConditional %true %6 %7
           %6 = OpLabel
@@ -321,6 +324,7 @@
 
     ASSERT_TRUE(Generate()) << Error() << output_;
     EXPECT_INST(R"(
+          %4 = OpLabel
                OpSelectionMerge %5 None
                OpBranchConditional %true %6 %7
           %6 = OpLabel
@@ -359,23 +363,25 @@
 
     ASSERT_TRUE(Generate()) << Error() << output_;
     EXPECT_INST(R"(
+          %4 = OpLabel
                OpSelectionMerge %5 None
                OpBranchConditional %true %6 %7
           %6 = OpLabel
                OpSelectionMerge %10 None
-               OpBranchConditional %true %11 %12
-         %11 = OpLabel
+               OpBranchConditional %true %14 %15
+         %14 = OpLabel
                OpBranch %10
-         %12 = OpLabel
+         %15 = OpLabel
                OpBranch %10
          %10 = OpLabel
-         %13 = OpPhi %int %int_10 %11 %int_20 %12
+         %13 = OpPhi %int %int_10 %14 %int_20 %15
                OpBranch %5
           %7 = OpLabel
                OpBranch %5
           %5 = OpLabel
-         %16 = OpPhi %int %int_30 %7 %13 %10
-               OpReturnValue %16
+         %11 = OpPhi %int %int_30 %7 %13 %10
+               OpReturnValue %11
+               OpFunctionEnd
 )");
 }
 
diff --git a/src/tint/lang/spirv/writer/loop_test.cc b/src/tint/lang/spirv/writer/loop_test.cc
index 125bb56..d4627ae 100644
--- a/src/tint/lang/spirv/writer/loop_test.cc
+++ b/src/tint/lang/spirv/writer/loop_test.cc
@@ -459,14 +459,14 @@
                OpLoopMerge %12 %10 None
                OpBranch %9
           %9 = OpLabel
-               OpSelectionMerge %13 None
-               OpBranchConditional %true %14 %15
-         %14 = OpLabel
+               OpSelectionMerge %15 None
+               OpBranchConditional %true %16 %17
+         %16 = OpLabel
+               OpBranch %12
+         %17 = OpLabel
                OpBranch %12
          %15 = OpLabel
                OpBranch %12
-         %13 = OpLabel
-               OpBranch %12
          %10 = OpLabel
                OpBranchConditional %true %12 %11
          %12 = OpLabel
@@ -514,6 +514,8 @@
     options.disable_robustness = true;
     ASSERT_TRUE(Generate(options)) << Error() << output_;
     EXPECT_INST(R"(
+               ; Function foo
+        %foo = OpFunction %int None %3
           %4 = OpLabel
                OpBranch %7
           %7 = OpLabel
@@ -522,27 +524,27 @@
           %5 = OpLabel
                OpBranch %6
           %6 = OpLabel
-               OpBranch %11
-         %11 = OpLabel
-               OpLoopMerge %12 %10 None
-               OpBranch %9
-          %9 = OpLabel
-               OpSelectionMerge %13 None
-               OpBranchConditional %true %14 %15
+               OpBranch %14
          %14 = OpLabel
+               OpLoopMerge %9 %13 None
                OpBranch %12
-         %15 = OpLabel
-               OpBranch %12
-         %13 = OpLabel
-               OpBranch %12
-         %10 = OpLabel
-               OpBranchConditional %true %12 %11
          %12 = OpLabel
-         %18 = OpPhi %int %int_3 %10 %20 %13 %int_1 %14 %int_2 %15
+               OpSelectionMerge %17 None
+               OpBranchConditional %true %15 %16
+         %15 = OpLabel
+               OpBranch %9
+         %16 = OpLabel
+               OpBranch %9
+         %17 = OpLabel
+               OpBranch %9
+         %13 = OpLabel
+               OpBranchConditional %true %9 %14
+          %9 = OpLabel
+         %11 = OpPhi %int %int_3 %13 %int_1 %15 %int_2 %16 %21 %17
                OpBranchConditional %true %8 %7
           %8 = OpLabel
-         %23 = OpPhi %int %18 %12
-               OpReturnValue %23
+         %10 = OpPhi %int %11 %9
+               OpReturnValue %10
                OpFunctionEnd
 
                ; Function unused_entry_point
@@ -707,17 +709,17 @@
                OpLoopMerge %9 %7 None
                OpBranch %6
           %6 = OpLabel
-               OpSelectionMerge %14 None
-               OpBranchConditional %true %15 %16
-         %15 = OpLabel
-               OpBranch %14
+               OpSelectionMerge %15 None
+               OpBranchConditional %true %16 %17
          %16 = OpLabel
-               OpBranch %14
-         %14 = OpLabel
-         %19 = OpPhi %int %int_10 %15 %int_20 %16
+               OpBranch %15
+         %17 = OpLabel
+               OpBranch %15
+         %15 = OpLabel
+         %14 = OpPhi %int %int_10 %16 %int_20 %17
                OpBranch %7
           %7 = OpLabel
-         %13 = OpPhi %int %19 %14
+         %13 = OpPhi %int %14 %15
          %22 = OpSGreaterThan %bool %13 %int_5
                OpBranchConditional %22 %9 %8
           %9 = OpLabel
@@ -775,22 +777,22 @@
                OpLoopMerge %9 %7 None
                OpBranch %6
           %6 = OpLabel
-               OpBranch %14
-         %14 = OpLabel
-               OpBranch %17
-         %17 = OpLabel
-               OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
+               OpBranch %18
+         %18 = OpLabel
+               OpLoopMerge %14 %17 None
                OpBranch %16
          %16 = OpLabel
-               OpBranchConditional %true %18 %17
-         %18 = OpLabel
+               OpBranch %17
+         %17 = OpLabel
+               OpBranchConditional %true %14 %18
+         %14 = OpLabel
                OpBranch %7
           %7 = OpLabel
-         %13 = OpPhi %int %11 %18
-         %21 = OpSGreaterThan %bool %13 %int_5
-               OpBranchConditional %21 %9 %8
+         %13 = OpPhi %int %11 %14
+         %19 = OpSGreaterThan %bool %13 %int_5
+               OpBranchConditional %19 %9 %8
           %9 = OpLabel
                OpReturn
                OpFunctionEnd
@@ -944,17 +946,17 @@
                OpLoopMerge %8 %6 None
                OpBranch %5
           %5 = OpLabel
-               OpSelectionMerge %9 None
-               OpBranchConditional %false %10 %9
-         %10 = OpLabel
-               OpBranch %8
+               OpSelectionMerge %13 None
+               OpBranchConditional %false %9 %13
           %9 = OpLabel
+               OpBranch %8
+         %13 = OpLabel
                OpBranch %6
           %6 = OpLabel
                OpBranchConditional %true %8 %7
           %8 = OpLabel
-         %14 = OpPhi %int %int_42 %6 %int_1 %10
-               OpReturnValue %14
+         %10 = OpPhi %int %int_42 %6 %int_1 %9
+               OpReturnValue %10
                OpFunctionEnd
 )");
 }
diff --git a/src/tint/lang/spirv/writer/printer/printer.cc b/src/tint/lang/spirv/writer/printer/printer.cc
index 7c323c8..75895cf 100644
--- a/src/tint/lang/spirv/writer/printer/printer.cc
+++ b/src/tint/lang/spirv/writer/printer/printer.cc
@@ -27,6 +27,7 @@
 
 #include "src/tint/lang/spirv/writer/printer/printer.h"
 
+#include <deque>
 #include <string>
 #include <utility>
 
@@ -217,6 +218,12 @@
 
     Output output_;
 
+    struct BlockInfo {
+        size_t idx;
+        core::ir::Block* block;
+    };
+    std::deque<BlockInfo> blocks_to_emit_;
+
     /// A function type used for an OpTypeFunction declaration.
     struct FunctionType {
         uint32_t return_type_id;
@@ -731,8 +738,15 @@
         TINT_DEFER(current_function_ = Function());
 
         // Emit the body of the function.
-        auto idx = current_function_.AppendBlock();
-        EmitBlockInternal(idx, func->Block());
+        auto idx = current_function_.AppendBlock(entry_block);
+        blocks_to_emit_.push_back({idx, func->Block()});
+
+        while (!blocks_to_emit_.empty()) {
+            auto blk = blocks_to_emit_.front();
+            blocks_to_emit_.pop_front();
+
+            EmitBlock(blk);
+        }
 
         // Add the function to the module.
         module_.PushFunction(current_function_);
@@ -841,19 +855,21 @@
     }
 
     size_t NewBlock(uint32_t id) {
-        auto idx = current_function_.AppendBlock();
+        auto idx = current_function_.AppendBlock(id);
         current_function_.SetCurrentBlockIndex(idx);
         current_function_.PushInst(spv::Op::OpLabel, {id});
         return idx;
     }
 
-    /// Emit a block, including the initial OpLabel, OpPhis and instructions.
+    /// Queue a block for emission. If the block contains comments a SPIR-V block will be created
+    /// and it will be added to the queue to be emitted later. If the block is empty, the
+    /// necessarily branch/unreachable instructions are added and no further processing is required.
     /// @param block the block to emit
-    void EmitBlock(core::ir::Block* block) {
+    void QueueBlock(core::ir::Block* block) {
         auto idx = NewBlock(Label(block));
 
         if (!block->IsEmpty()) {
-            EmitBlockInternal(idx, block);
+            blocks_to_emit_.push_back({idx, block});
             return;
         }
 
@@ -866,16 +882,11 @@
         }
     }
 
-    void EmitBlockInternal(size_t idx, core::ir::Block* block) {
-        current_function_.SetCurrentBlockIndex(idx);
-
-        if (auto* mib = block->As<core::ir::MultiInBlock>()) {
-            // Emit all OpPhi nodes for incoming branches to block.
-            EmitIncomingPhis(mib);
-        }
+    void EmitBlock(BlockInfo& blk) {
+        current_function_.SetCurrentBlockIndex(blk.idx);
 
         // Emit the block's statements.
-        EmitBlockInstructions(block);
+        EmitBlockInstructions(blk.block);
     }
 
     /// Emit all OpPhi nodes for incoming branches to @p block.
@@ -963,11 +974,13 @@
                 return;
             },
             [&](core::ir::BreakIf* breakif) {
+                auto true_idx = GetMergeLabel(breakif->Loop());
+                auto false_idx = GetLoopHeaderLabel(breakif->Loop());
                 current_function_.PushInst(spv::Op::OpBranchConditional,
                                            {
                                                Value(breakif->Condition()),
-                                               GetMergeLabel(breakif->Loop()),
-                                               GetLoopHeaderLabel(breakif->Loop()),
+                                               true_idx,
+                                               false_idx,
                                            });
             },
             [&](core::ir::Continue* cont) {
@@ -1035,10 +1048,10 @@
 
         // Emit the `true` and `false` blocks, if they're not being skipped.
         if (true_label != merge_label) {
-            EmitBlock(true_block);
+            QueueBlock(true_block);
         }
         if (false_label != merge_label) {
-            EmitBlock(false_block);
+            QueueBlock(false_block);
         }
 
         NewBlock(merge_label);
@@ -2262,7 +2275,7 @@
         if (init_label != 0) {
             // Emit the loop initializer.
             current_function_.PushInst(spv::Op::OpBranch, {init_label});
-            EmitBlock(loop->Initializer());
+            QueueBlock(loop->Initializer());
         } else {
             // No initializer. Branch to body.
             current_function_.PushInst(spv::Op::OpBranch, {header_label});
@@ -2270,27 +2283,29 @@
 
         // Emit the loop body header, which contains the OpLoopMerge and OpPhis.
         // This then unconditionally branches to body_label
-        [[maybe_unused]] auto header_idx = NewBlock(header_label);
+        NewBlock(header_label);
         EmitIncomingPhis(loop->Body());
         current_function_.PushInst(spv::Op::OpLoopMerge, {merge_label, continuing_label,
                                                           U32Operand(SpvLoopControlMaskNone)});
         current_function_.PushInst(spv::Op::OpBranch, {body_label});
 
         // Emit the loop body
-        [[maybe_unused]] auto body_blk = NewBlock(body_label);
-        EmitBlockInstructions(loop->Body());
+        auto body_blk = NewBlock(body_label);
+        blocks_to_emit_.push_back({body_blk, loop->Body()});
+
+        auto cont_blk = NewBlock(continuing_label);
+        EmitIncomingPhis(loop->Continuing());
 
         // Emit the loop continuing block.
         if (loop->Continuing()->Terminator()) {
-            EmitBlock(loop->Continuing());
+            blocks_to_emit_.push_back({cont_blk, loop->Continuing()});
         } else {
             // We still need to emit a continuing block with a back-edge, even if it is unreachable.
-            [[maybe_unused]] auto continuing_blk = NewBlock(continuing_label);
             current_function_.PushInst(spv::Op::OpBranch, {header_label});
         }
 
         // Emit the loop merge block.
-        [[maybe_unused]] auto merge_blk = NewBlock(merge_label);
+        NewBlock(merge_label);
 
         // Emit the OpPhis for the ExitLoops
         EmitExitPhis(loop);
@@ -2332,11 +2347,11 @@
 
         // Emit the cases.
         for (auto& c : swtch->Cases()) {
-            EmitBlock(c.block);
+            QueueBlock(c.block);
         }
 
         // Emit the switch merge block.
-        [[maybe_unused]] auto merge_blk = NewBlock(merge_label);
+        NewBlock(merge_label);
 
         // Emit the OpPhis for the ExitSwitches
         EmitExitPhis(swtch);
@@ -2620,7 +2635,11 @@
 
             Vector<Branch, 8> branches;
             branches.Reserve(inst->Exits().Count());
-            for (auto& exit : inst->Exits()) {
+
+            auto exits = inst->Exits().Vector();
+            exits.Sort([](auto a, auto b) -> bool { return a < b; });
+
+            for (auto& exit : exits) {
                 branches.Push(Branch{GetTerminatorBlockLabel(exit), exit->Args()[index]});
             }
             branches.Sort();  // Sort the branches by label to ensure deterministic output
@@ -2633,7 +2652,6 @@
                     }
                 });
             }
-
             OperandList ops{Type(ty), Value(result)};
             for (auto& branch : branches) {
                 if (branch.value == nullptr) {
diff --git a/src/tint/lang/spirv/writer/switch_test.cc b/src/tint/lang/spirv/writer/switch_test.cc
index 711c245..a7154c9 100644
--- a/src/tint/lang/spirv/writer/switch_test.cc
+++ b/src/tint/lang/spirv/writer/switch_test.cc
@@ -86,12 +86,12 @@
           %4 = OpLabel
                OpSelectionMerge %10 None
                OpSwitch %int_42 %5 1 %8 2 %9
+          %5 = OpLabel
+               OpBranch %10
           %8 = OpLabel
                OpBranch %10
           %9 = OpLabel
                OpBranch %10
-          %5 = OpLabel
-               OpBranch %10
          %10 = OpLabel
                OpReturn
                OpFunctionEnd
@@ -166,12 +166,12 @@
           %4 = OpLabel
                OpSelectionMerge %10 None
                OpSwitch %int_42 %5 1 %8 2 %9
+          %5 = OpLabel
+               OpBranch %10
           %8 = OpLabel
                OpBranch %10
           %9 = OpLabel
                OpBranch %10
-          %5 = OpLabel
-               OpBranch %10
          %10 = OpLabel
                OpReturn
                OpFunctionEnd
@@ -209,6 +209,8 @@
           %4 = OpLabel
                OpSelectionMerge %9 None
                OpSwitch %int_42 %5 1 %8
+          %5 = OpLabel
+               OpBranch %9
           %8 = OpLabel
                OpSelectionMerge %10 None
                OpBranchConditional %true %11 %10
@@ -216,8 +218,6 @@
                OpBranch %9
          %10 = OpLabel
                OpBranch %9
-          %5 = OpLabel
-               OpBranch %9
           %9 = OpLabel
                OpReturn
                OpFunctionEnd
@@ -291,18 +291,17 @@
          %14 = OpLabel
                OpBranch %15
          %15 = OpLabel
-         %18 = OpPhi %int %19 %12 %int_20 %14
-         %21 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %22 None
-               OpBranchConditional %21 %23 %22
-         %23 = OpLabel
-               OpStore %return_value %18 None
-               OpBranch %22
-         %22 = OpLabel
-         %24 = OpLoad %int %return_value None
-               OpReturnValue %24
+         %16 = OpPhi %int %17 %12 %int_20 %14
+         %19 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %20 None
+               OpBranchConditional %19 %21 %20
+         %21 = OpLabel
+               OpStore %return_value %16 None
+               OpBranch %20
+         %20 = OpLabel
+         %22 = OpLoad %int %return_value None
+               OpReturnValue %22
                OpFunctionEnd
-
 )");
 }
 
@@ -410,19 +409,19 @@
                OpSwitch %int_42 %5 1 %5 2 %7
           %5 = OpLabel
                OpSelectionMerge %9 None
-               OpBranchConditional %true %10 %11
-         %10 = OpLabel
+               OpBranchConditional %true %13 %14
+         %13 = OpLabel
                OpBranch %9
-         %11 = OpLabel
+         %14 = OpLabel
                OpBranch %9
           %9 = OpLabel
-         %14 = OpPhi %int %int_10 %10 %int_20 %11
+         %12 = OpPhi %int %int_10 %13 %int_20 %14
                OpBranch %8
           %7 = OpLabel
                OpBranch %8
           %8 = OpLabel
-         %17 = OpPhi %int %int_20 %7 %14 %9
-               OpReturnValue %17
+         %10 = OpPhi %int %int_20 %7 %12 %9
+               OpReturnValue %10
                OpFunctionEnd
 )");
 }
@@ -457,17 +456,17 @@
                OpSelectionMerge %8 None
                OpSwitch %int_42 %5 1 %5 2 %7
           %5 = OpLabel
-               OpSelectionMerge %10 None
-               OpSwitch %int_42 %9 2 %9
+               OpSelectionMerge %9 None
+               OpSwitch %int_42 %13 2 %13
+         %13 = OpLabel
+               OpBranch %9
           %9 = OpLabel
-               OpBranch %10
-         %10 = OpLabel
                OpBranch %8
           %7 = OpLabel
                OpBranch %8
           %8 = OpLabel
-         %11 = OpPhi %int %int_20 %7 %int_10 %10
-               OpReturnValue %11
+         %10 = OpPhi %int %int_20 %7 %int_10 %9
+               OpReturnValue %10
                OpFunctionEnd
 )");
 }
diff --git a/src/tint/lang/spirv/writer/var_test.cc b/src/tint/lang/spirv/writer/var_test.cc
index 1ee6b74..71359aa 100644
--- a/src/tint/lang/spirv/writer/var_test.cc
+++ b/src/tint/lang/spirv/writer/var_test.cc
@@ -333,8 +333,8 @@
                OpName %foo_local_invocation_index_Input "foo_local_invocation_index_Input"  ; id %4
                OpName %foo_inner "foo_inner"                                                ; id %7
                OpName %tint_local_index "tint_local_index"                                  ; id %9
-               OpName %load "load"                                                          ; id %21
-               OpName %add "add"                                                            ; id %22
+               OpName %load "load"                                                          ; id %20
+               OpName %add "add"                                                            ; id %21
                OpName %foo "foo"                                                            ; id %24
 
                ; Annotations
@@ -351,10 +351,10 @@
          %10 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
       %int_1 = OpConstant %int 1
+      %int_0 = OpConstant %int 0
          %25 = OpTypeFunction %void
 
                ; Function foo_inner
diff --git a/test/tint/access/ptr.wgsl.expected.spvasm b/test/tint/access/ptr.wgsl.expected.spvasm
index 4bbe212..af169c2 100644
--- a/test/tint/access/ptr.wgsl.expected.spvasm
+++ b/test/tint/access/ptr.wgsl.expected.spvasm
@@ -72,10 +72,10 @@
        %void = OpTypeVoid
          %74 = OpTypeFunction %void %uint
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
-         %86 = OpConstantNull %S
-         %88 = OpConstantNull %v3float
+      %int_0 = OpConstant %int 0
+         %85 = OpConstantNull %S
+         %87 = OpConstantNull %v3float
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
         %105 = OpTypeFunction %int %float
 %float_n2_14748365e_09 = OpConstant %float -2.14748365e+09
@@ -157,23 +157,23 @@
          %78 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
                OpStore %v1 %int_0
-               OpStore %v2 %86
-               OpStore %v4 %88
+               OpStore %v2 %85
+               OpStore %v4 %87
          %t1 = OpAtomicLoad %int %g1 %uint_2 %uint_0
-         %90 = OpFunctionCall %int %accept_ptr_deref_pass_through %v1
-         %91 = OpFunctionCall %int %accept_ptr_to_struct_and_access %v2
-         %92 = OpIAdd %int %90 %91
-         %93 = OpFunctionCall %int %accept_ptr_to_struct_and_access %v2
-         %94 = OpIAdd %int %92 %93
-         %95 = OpFunctionCall %int %accept_ptr_vec_access_elements %v4
-         %96 = OpIAdd %int %94 %95
-         %97 = OpFunctionCall %int %accept_ptr_to_struct_access_pass_ptr %v2
-         %98 = OpIAdd %int %96 %97
-         %99 = OpFunctionCall %int %call_builtin_with_mod_scope_ptr
-        %100 = OpIAdd %int %98 %99
-        %101 = OpIAdd %int %100 %t1
-        %102 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %102 %101 None
+         %89 = OpFunctionCall %int %accept_ptr_deref_pass_through %v1
+         %90 = OpFunctionCall %int %accept_ptr_to_struct_and_access %v2
+         %91 = OpIAdd %int %89 %90
+         %92 = OpFunctionCall %int %accept_ptr_to_struct_and_access %v2
+         %93 = OpIAdd %int %91 %92
+         %94 = OpFunctionCall %int %accept_ptr_vec_access_elements %v4
+         %95 = OpIAdd %int %93 %94
+         %96 = OpFunctionCall %int %accept_ptr_to_struct_access_pass_ptr %v2
+         %97 = OpIAdd %int %95 %96
+         %98 = OpFunctionCall %int %call_builtin_with_mod_scope_ptr
+         %99 = OpIAdd %int %97 %98
+        %100 = OpIAdd %int %99 %t1
+        %101 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %101 %100 None
                OpReturn
                OpFunctionEnd
 %tint_f32_to_i32 = OpFunction %int None %105
diff --git a/test/tint/array/assign_to_function_var.wgsl.expected.spvasm b/test/tint/array/assign_to_function_var.wgsl.expected.spvasm
index 8081d08..a5e90f0 100644
--- a/test/tint/array/assign_to_function_var.wgsl.expected.spvasm
+++ b/test/tint/array/assign_to_function_var.wgsl.expected.spvasm
@@ -91,11 +91,11 @@
 %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Function %_arr__arr__arr_int_uint_2_uint_3_uint_4
          %67 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4
          %72 = OpTypeFunction %void %uint
+   %uint_264 = OpConstant %uint 264
        %bool = OpTypeBool
 %_ptr_Workgroup_v4int = OpTypePointer Workgroup %v4int
-         %87 = OpConstantNull %v4int
+         %90 = OpConstantNull %v4int
      %uint_1 = OpConstant %uint 1
-   %uint_264 = OpConstant %uint 264
          %93 = OpTypeFunction %void
          %98 = OpTypeFunction %_arr_v4int_uint_4 %_arr_v4int_uint_4_0
 %_ptr_Function__arr_v4int_uint_4_0 = OpTypePointer Function %_arr_v4int_uint_4_0
@@ -152,21 +152,21 @@
                OpLoopMerge %78 %76 None
                OpBranch %75
          %75 = OpLabel
-         %81 = OpUGreaterThanEqual %bool %79 %uint_4
-               OpSelectionMerge %83 None
-               OpBranchConditional %81 %84 %83
-         %84 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %78
-         %83 = OpLabel
-         %85 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %79
-               OpStore %85 %87 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %79
+               OpStore %88 %90 None
                OpBranch %76
          %76 = OpLabel
          %80 = OpIAdd %uint %79 %uint_1
                OpBranch %77
          %78 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %91 = OpFunctionCall %void %foo %src_let
+         %83 = OpFunctionCall %void %foo %src_let
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %93
@@ -189,21 +189,21 @@
                OpLoopMerge %107 %105 None
                OpBranch %104
         %104 = OpLabel
-        %110 = OpUGreaterThanEqual %bool %108 %uint_4
-               OpSelectionMerge %111 None
-               OpBranchConditional %110 %112 %111
-        %112 = OpLabel
+        %111 = OpUGreaterThanEqual %bool %108 %uint_4
+               OpSelectionMerge %112 None
+               OpBranchConditional %111 %113 %112
+        %113 = OpLabel
                OpBranch %107
-        %111 = OpLabel
-        %113 = OpAccessChain %_ptr_Function_v4int %100 %108
-        %115 = OpLoad %v4int %113 None
-        %116 = OpAccessChain %_ptr_Function_v4int %102 %108
-               OpStore %116 %115 None
+        %112 = OpLabel
+        %114 = OpAccessChain %_ptr_Function_v4int %100 %108
+        %116 = OpLoad %v4int %114 None
+        %117 = OpAccessChain %_ptr_Function_v4int %102 %108
+               OpStore %117 %116 None
                OpBranch %105
         %105 = OpLabel
         %109 = OpIAdd %uint %108 %uint_1
                OpBranch %106
         %107 = OpLabel
-        %117 = OpLoad %_arr_v4int_uint_4 %102 None
-               OpReturnValue %117
+        %110 = OpLoad %_arr_v4int_uint_4 %102 None
+               OpReturnValue %110
                OpFunctionEnd
diff --git a/test/tint/array/assign_to_private_var.wgsl.expected.spvasm b/test/tint/array/assign_to_private_var.wgsl.expected.spvasm
index a49b008..fffbc1b 100644
--- a/test/tint/array/assign_to_private_var.wgsl.expected.spvasm
+++ b/test/tint/array/assign_to_private_var.wgsl.expected.spvasm
@@ -94,11 +94,11 @@
 %_ptr_StorageBuffer__arr_v4int_uint_4_0 = OpTypePointer StorageBuffer %_arr_v4int_uint_4_0
 %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Function %_arr__arr__arr_int_uint_2_uint_3_uint_4
          %73 = OpTypeFunction %void %uint
+   %uint_264 = OpConstant %uint 264
        %bool = OpTypeBool
 %_ptr_Workgroup_v4int = OpTypePointer Workgroup %v4int
-         %88 = OpConstantNull %v4int
+         %91 = OpConstantNull %v4int
      %uint_1 = OpConstant %uint 1
-   %uint_264 = OpConstant %uint 264
          %94 = OpTypeFunction %void
          %99 = OpTypeFunction %_arr_v4int_uint_4 %_arr_v4int_uint_4_0
 %_ptr_Function__arr_v4int_uint_4_0 = OpTypePointer Function %_arr_v4int_uint_4_0
@@ -153,21 +153,21 @@
                OpLoopMerge %79 %77 None
                OpBranch %76
          %76 = OpLabel
-         %82 = OpUGreaterThanEqual %bool %80 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %82 %85 %84
-         %85 = OpLabel
+         %85 = OpUGreaterThanEqual %bool %80 %uint_4
+               OpSelectionMerge %87 None
+               OpBranchConditional %85 %88 %87
+         %88 = OpLabel
                OpBranch %79
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %80
-               OpStore %86 %88 None
+         %87 = OpLabel
+         %89 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %80
+               OpStore %89 %91 None
                OpBranch %77
          %77 = OpLabel
          %81 = OpIAdd %uint %80 %uint_1
                OpBranch %78
          %79 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %92 = OpFunctionCall %void %foo %src_let
+         %84 = OpFunctionCall %void %foo %src_let
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %94
@@ -190,21 +190,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_v4int %101 %109
-        %116 = OpLoad %v4int %114 None
-        %117 = OpAccessChain %_ptr_Function_v4int %103 %109
-               OpStore %117 %116 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_v4int %101 %109
+        %117 = OpLoad %v4int %115 None
+        %118 = OpAccessChain %_ptr_Function_v4int %103 %109
+               OpStore %118 %117 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %118 = OpLoad %_arr_v4int_uint_4 %103 None
-               OpReturnValue %118
+        %111 = OpLoad %_arr_v4int_uint_4 %103 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/array/assign_to_storage_var.wgsl.expected.spvasm b/test/tint/array/assign_to_storage_var.wgsl.expected.spvasm
index df6b5a1..02c7e5d 100644
--- a/test/tint/array/assign_to_storage_var.wgsl.expected.spvasm
+++ b/test/tint/array/assign_to_storage_var.wgsl.expected.spvasm
@@ -128,11 +128,11 @@
          %97 = OpConstantNull %_arr__arr__arr_int_uint_2_0_uint_3_uint_4
 %_ptr_StorageBuffer__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer StorageBuffer %_arr__arr__arr_int_uint_2_uint_3_uint_4
         %105 = OpTypeFunction %void %uint
+   %uint_264 = OpConstant %uint 264
        %bool = OpTypeBool
 %_ptr_Workgroup_v4int = OpTypePointer Workgroup %v4int
-        %120 = OpConstantNull %v4int
+        %123 = OpConstantNull %v4int
      %uint_1 = OpConstant %uint 1
-   %uint_264 = OpConstant %uint 264
         %126 = OpTypeFunction %void
         %131 = OpTypeFunction %_arr_v4int_uint_4 %_arr_v4int_uint_4_0
 %_ptr_Function__arr_v4int_uint_4_0 = OpTypePointer Function %_arr_v4int_uint_4_0
@@ -223,21 +223,21 @@
                OpLoopMerge %111 %109 None
                OpBranch %108
         %108 = OpLabel
-        %114 = OpUGreaterThanEqual %bool %112 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %114 %117 %116
-        %117 = OpLabel
+        %117 = OpUGreaterThanEqual %bool %112 %uint_4
+               OpSelectionMerge %119 None
+               OpBranchConditional %117 %120 %119
+        %120 = OpLabel
                OpBranch %111
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %112
-               OpStore %118 %120 None
+        %119 = OpLabel
+        %121 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %112
+               OpStore %121 %123 None
                OpBranch %109
         %109 = OpLabel
         %113 = OpIAdd %uint %112 %uint_1
                OpBranch %110
         %111 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-        %124 = OpFunctionCall %void %foo %src_let
+        %116 = OpFunctionCall %void %foo %src_let
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %126
@@ -260,23 +260,23 @@
                OpLoopMerge %140 %138 None
                OpBranch %137
         %137 = OpLabel
-        %143 = OpUGreaterThanEqual %bool %141 %uint_4
-               OpSelectionMerge %144 None
-               OpBranchConditional %143 %145 %144
-        %145 = OpLabel
+        %144 = OpUGreaterThanEqual %bool %141 %uint_4
+               OpSelectionMerge %145 None
+               OpBranchConditional %144 %146 %145
+        %146 = OpLabel
                OpBranch %140
-        %144 = OpLabel
-        %146 = OpAccessChain %_ptr_Function_v4int %133 %141
-        %148 = OpLoad %v4int %146 None
-        %149 = OpAccessChain %_ptr_Function_v4int %135 %141
-               OpStore %149 %148 None
+        %145 = OpLabel
+        %147 = OpAccessChain %_ptr_Function_v4int %133 %141
+        %149 = OpLoad %v4int %147 None
+        %150 = OpAccessChain %_ptr_Function_v4int %135 %141
+               OpStore %150 %149 None
                OpBranch %138
         %138 = OpLabel
         %142 = OpIAdd %uint %141 %uint_1
                OpBranch %139
         %140 = OpLabel
-        %150 = OpLoad %_arr_v4int_uint_4 %135 None
-               OpReturnValue %150
+        %143 = OpLoad %_arr_v4int_uint_4 %135 None
+               OpReturnValue %143
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_v4int_uint_4_0 None %152
 %tint_source_0 = OpFunctionParameter %_arr_v4int_uint_4
@@ -292,23 +292,23 @@
                OpLoopMerge %161 %159 None
                OpBranch %158
         %158 = OpLabel
-        %164 = OpUGreaterThanEqual %bool %162 %uint_4
-               OpSelectionMerge %165 None
-               OpBranchConditional %164 %166 %165
-        %166 = OpLabel
+        %165 = OpUGreaterThanEqual %bool %162 %uint_4
+               OpSelectionMerge %166 None
+               OpBranchConditional %165 %167 %166
+        %167 = OpLabel
                OpBranch %161
-        %165 = OpLabel
-        %167 = OpAccessChain %_ptr_Function_v4int %154 %162
-        %168 = OpLoad %v4int %167 None
-        %169 = OpAccessChain %_ptr_Function_v4int %155 %162
-               OpStore %169 %168 None
+        %166 = OpLabel
+        %168 = OpAccessChain %_ptr_Function_v4int %154 %162
+        %169 = OpLoad %v4int %168 None
+        %170 = OpAccessChain %_ptr_Function_v4int %155 %162
+               OpStore %170 %169 None
                OpBranch %159
         %159 = OpLabel
         %163 = OpIAdd %uint %162 %uint_1
                OpBranch %160
         %161 = OpLabel
-        %170 = OpLoad %_arr_v4int_uint_4_0 %155 None
-               OpReturnValue %170
+        %164 = OpLoad %_arr_v4int_uint_4_0 %155 None
+               OpReturnValue %164
                OpFunctionEnd
 %tint_convert_explicit_layout_1 = OpFunction %_arr__arr__arr_int_uint_2_uint_3_uint_4 None %172
 %tint_source_1 = OpFunctionParameter %_arr__arr__arr_int_uint_2_0_uint_3_uint_4
@@ -324,24 +324,24 @@
                OpLoopMerge %182 %180 None
                OpBranch %179
         %179 = OpLabel
-        %185 = OpUGreaterThanEqual %bool %183 %uint_4
-               OpSelectionMerge %186 None
-               OpBranchConditional %185 %187 %186
-        %187 = OpLabel
+        %186 = OpUGreaterThanEqual %bool %183 %uint_4
+               OpSelectionMerge %187 None
+               OpBranchConditional %186 %188 %187
+        %188 = OpLabel
                OpBranch %182
-        %186 = OpLabel
-        %188 = OpAccessChain %_ptr_Function__arr__arr_int_uint_2_0_uint_3 %174 %183
-        %190 = OpLoad %_arr__arr_int_uint_2_0_uint_3 %188 None
-        %191 = OpFunctionCall %_arr__arr_int_uint_2_uint_3 %tint_convert_explicit_layout_2 %190
-        %193 = OpAccessChain %_ptr_Function__arr__arr_int_uint_2_uint_3 %175 %183
-               OpStore %193 %191 None
+        %187 = OpLabel
+        %189 = OpAccessChain %_ptr_Function__arr__arr_int_uint_2_0_uint_3 %174 %183
+        %191 = OpLoad %_arr__arr_int_uint_2_0_uint_3 %189 None
+        %192 = OpFunctionCall %_arr__arr_int_uint_2_uint_3 %tint_convert_explicit_layout_2 %191
+        %194 = OpAccessChain %_ptr_Function__arr__arr_int_uint_2_uint_3 %175 %183
+               OpStore %194 %192 None
                OpBranch %180
         %180 = OpLabel
         %184 = OpIAdd %uint %183 %uint_1
                OpBranch %181
         %182 = OpLabel
-        %195 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %175 None
-               OpReturnValue %195
+        %185 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %175 None
+               OpReturnValue %185
                OpFunctionEnd
 %tint_convert_explicit_layout_2 = OpFunction %_arr__arr_int_uint_2_uint_3 None %197
 %tint_source_2 = OpFunctionParameter %_arr__arr_int_uint_2_0_uint_3
@@ -357,24 +357,24 @@
                OpLoopMerge %206 %204 None
                OpBranch %203
         %203 = OpLabel
-        %209 = OpUGreaterThanEqual %bool %207 %uint_3
-               OpSelectionMerge %210 None
-               OpBranchConditional %209 %211 %210
-        %211 = OpLabel
+        %210 = OpUGreaterThanEqual %bool %207 %uint_3
+               OpSelectionMerge %211 None
+               OpBranchConditional %210 %212 %211
+        %212 = OpLabel
                OpBranch %206
-        %210 = OpLabel
-        %212 = OpAccessChain %_ptr_Function__arr_int_uint_2_0 %199 %207
-        %214 = OpLoad %_arr_int_uint_2_0 %212 None
-        %215 = OpFunctionCall %_arr_int_uint_2 %tint_convert_explicit_layout_3 %214
-        %217 = OpAccessChain %_ptr_Function__arr_int_uint_2 %200 %207
-               OpStore %217 %215 None
+        %211 = OpLabel
+        %213 = OpAccessChain %_ptr_Function__arr_int_uint_2_0 %199 %207
+        %215 = OpLoad %_arr_int_uint_2_0 %213 None
+        %216 = OpFunctionCall %_arr_int_uint_2 %tint_convert_explicit_layout_3 %215
+        %218 = OpAccessChain %_ptr_Function__arr_int_uint_2 %200 %207
+               OpStore %218 %216 None
                OpBranch %204
         %204 = OpLabel
         %208 = OpIAdd %uint %207 %uint_1
                OpBranch %205
         %206 = OpLabel
-        %219 = OpLoad %_arr__arr_int_uint_2_uint_3 %200 None
-               OpReturnValue %219
+        %209 = OpLoad %_arr__arr_int_uint_2_uint_3 %200 None
+               OpReturnValue %209
                OpFunctionEnd
 %tint_convert_explicit_layout_3 = OpFunction %_arr_int_uint_2 None %221
 %tint_source_3 = OpFunctionParameter %_arr_int_uint_2_0
@@ -390,21 +390,21 @@
                OpLoopMerge %230 %228 None
                OpBranch %227
         %227 = OpLabel
-        %233 = OpUGreaterThanEqual %bool %231 %uint_2
-               OpSelectionMerge %234 None
-               OpBranchConditional %233 %235 %234
-        %235 = OpLabel
+        %234 = OpUGreaterThanEqual %bool %231 %uint_2
+               OpSelectionMerge %235 None
+               OpBranchConditional %234 %236 %235
+        %236 = OpLabel
                OpBranch %230
-        %234 = OpLabel
-        %236 = OpAccessChain %_ptr_Function_int %223 %231
-        %238 = OpLoad %int %236 None
-        %239 = OpAccessChain %_ptr_Function_int %224 %231
-               OpStore %239 %238 None
+        %235 = OpLabel
+        %237 = OpAccessChain %_ptr_Function_int %223 %231
+        %239 = OpLoad %int %237 None
+        %240 = OpAccessChain %_ptr_Function_int %224 %231
+               OpStore %240 %239 None
                OpBranch %228
         %228 = OpLabel
         %232 = OpIAdd %uint %231 %uint_1
                OpBranch %229
         %230 = OpLabel
-        %240 = OpLoad %_arr_int_uint_2 %224 None
-               OpReturnValue %240
+        %233 = OpLoad %_arr_int_uint_2 %224 None
+               OpReturnValue %233
                OpFunctionEnd
diff --git a/test/tint/array/assign_to_workgroup_var.wgsl.expected.spvasm b/test/tint/array/assign_to_workgroup_var.wgsl.expected.spvasm
index 7900149..2b77a2c 100644
--- a/test/tint/array/assign_to_workgroup_var.wgsl.expected.spvasm
+++ b/test/tint/array/assign_to_workgroup_var.wgsl.expected.spvasm
@@ -94,15 +94,15 @@
 %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Function %_arr__arr__arr_int_uint_2_uint_3_uint_4
          %69 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4
          %73 = OpTypeFunction %void %uint
+   %uint_264 = OpConstant %uint 264
        %bool = OpTypeBool
 %_ptr_Workgroup_v4int = OpTypePointer Workgroup %v4int
-         %88 = OpConstantNull %v4int
+         %98 = OpConstantNull %v4int
      %uint_1 = OpConstant %uint 1
     %uint_24 = OpConstant %uint 24
      %uint_6 = OpConstant %uint 6
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %int_0 = OpConstant %int 0
-   %uint_264 = OpConstant %uint 264
         %114 = OpTypeFunction %void
         %119 = OpTypeFunction %_arr_v4int_uint_4 %_arr_v4int_uint_4_0
 %_ptr_Function__arr_v4int_uint_4_0 = OpTypePointer Function %_arr_v4int_uint_4_0
@@ -157,48 +157,48 @@
                OpLoopMerge %79 %77 None
                OpBranch %76
          %76 = OpLabel
-         %82 = OpUGreaterThanEqual %bool %80 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %82 %85 %84
-         %85 = OpLabel
+         %92 = OpUGreaterThanEqual %bool %80 %uint_4
+               OpSelectionMerge %94 None
+               OpBranchConditional %92 %95 %94
+         %95 = OpLabel
                OpBranch %79
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %80
-               OpStore %86 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v4int %dst %80
-               OpStore %89 %88 None
+         %94 = OpLabel
+         %96 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %80
+               OpStore %96 %98 None
+         %99 = OpAccessChain %_ptr_Workgroup_v4int %dst %80
+               OpStore %99 %98 None
                OpBranch %77
          %77 = OpLabel
          %81 = OpIAdd %uint %80 %uint_1
                OpBranch %78
          %79 = OpLabel
-               OpBranch %91
-         %91 = OpLabel
-               OpBranch %94
-         %94 = OpLabel
-         %96 = OpPhi %uint %tint_local_index %91 %97 %93
-               OpLoopMerge %95 %93 None
-               OpBranch %92
-         %92 = OpLabel
-         %98 = OpUGreaterThanEqual %bool %96 %uint_24
-               OpSelectionMerge %100 None
-               OpBranchConditional %98 %101 %100
-        %101 = OpLabel
-               OpBranch %95
-        %100 = OpLabel
-        %102 = OpUMod %uint %96 %uint_2
-        %103 = OpUDiv %uint %96 %uint_2
-        %104 = OpUMod %uint %103 %uint_3
-        %105 = OpUDiv %uint %96 %uint_6
-        %107 = OpAccessChain %_ptr_Workgroup_int %dst_nested %105 %104 %102
-               OpStore %107 %int_0 None
-               OpBranch %93
-         %93 = OpLabel
-         %97 = OpIAdd %uint %96 %uint_1
-               OpBranch %94
-         %95 = OpLabel
+               OpBranch %82
+         %82 = OpLabel
+               OpBranch %85
+         %85 = OpLabel
+         %87 = OpPhi %uint %tint_local_index %82 %88 %84
+               OpLoopMerge %86 %84 None
+               OpBranch %83
+         %83 = OpLabel
+        %101 = OpUGreaterThanEqual %bool %87 %uint_24
+               OpSelectionMerge %103 None
+               OpBranchConditional %101 %104 %103
+        %104 = OpLabel
+               OpBranch %86
+        %103 = OpLabel
+        %105 = OpUMod %uint %87 %uint_2
+        %106 = OpUDiv %uint %87 %uint_2
+        %107 = OpUMod %uint %106 %uint_3
+        %108 = OpUDiv %uint %87 %uint_6
+        %110 = OpAccessChain %_ptr_Workgroup_int %dst_nested %108 %107 %105
+               OpStore %110 %int_0 None
+               OpBranch %84
+         %84 = OpLabel
+         %88 = OpIAdd %uint %87 %uint_1
+               OpBranch %85
+         %86 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-        %112 = OpFunctionCall %void %foo %src_let
+         %91 = OpFunctionCall %void %foo %src_let
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %114
@@ -221,21 +221,21 @@
                OpLoopMerge %128 %126 None
                OpBranch %125
         %125 = OpLabel
-        %131 = OpUGreaterThanEqual %bool %129 %uint_4
-               OpSelectionMerge %132 None
-               OpBranchConditional %131 %133 %132
-        %133 = OpLabel
+        %132 = OpUGreaterThanEqual %bool %129 %uint_4
+               OpSelectionMerge %133 None
+               OpBranchConditional %132 %134 %133
+        %134 = OpLabel
                OpBranch %128
-        %132 = OpLabel
-        %134 = OpAccessChain %_ptr_Function_v4int %121 %129
-        %136 = OpLoad %v4int %134 None
-        %137 = OpAccessChain %_ptr_Function_v4int %123 %129
-               OpStore %137 %136 None
+        %133 = OpLabel
+        %135 = OpAccessChain %_ptr_Function_v4int %121 %129
+        %137 = OpLoad %v4int %135 None
+        %138 = OpAccessChain %_ptr_Function_v4int %123 %129
+               OpStore %138 %137 None
                OpBranch %126
         %126 = OpLabel
         %130 = OpIAdd %uint %129 %uint_1
                OpBranch %127
         %128 = OpLabel
-        %138 = OpLoad %_arr_v4int_uint_4 %123 None
-               OpReturnValue %138
+        %131 = OpLoad %_arr_v4int_uint_4 %123 None
+               OpReturnValue %131
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.spvasm b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.spvasm
index 1798efa..d416ab3 100644
--- a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.spvasm
@@ -440,21 +440,21 @@
                OpLoopMerge %310 %308 None
                OpBranch %307
         %307 = OpLabel
-        %313 = OpUGreaterThanEqual %bool %311 %uint_2
-               OpSelectionMerge %314 None
-               OpBranchConditional %313 %315 %314
-        %315 = OpLabel
+        %314 = OpUGreaterThanEqual %bool %311 %uint_2
+               OpSelectionMerge %315 None
+               OpBranchConditional %314 %316 %315
+        %316 = OpLabel
                OpBranch %310
-        %314 = OpLabel
-        %316 = OpAccessChain %_ptr_Function_v3float %301 %311
-        %318 = OpLoad %v3float %316 None
-        %319 = OpAccessChain %_ptr_Function_v3float %303 %311
-               OpStore %319 %318 None
+        %315 = OpLabel
+        %317 = OpAccessChain %_ptr_Function_v3float %301 %311
+        %319 = OpLoad %v3float %317 None
+        %320 = OpAccessChain %_ptr_Function_v3float %303 %311
+               OpStore %320 %319 None
                OpBranch %308
         %308 = OpLabel
         %312 = OpIAdd %uint %311 %uint_1
                OpBranch %309
         %310 = OpLabel
-        %320 = OpLoad %_arr_v3float_uint_2_0 %303 None
-               OpReturnValue %320
+        %313 = OpLoad %_arr_v3float_uint_2_0 %303 None
+               OpReturnValue %313
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.spvasm b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.spvasm
index e7bcfe8..4f45873 100644
--- a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.spvasm
@@ -697,23 +697,23 @@
                OpLoopMerge %491 %489 None
                OpBranch %488
         %488 = OpLabel
-        %494 = OpUGreaterThanEqual %bool %492 %uint_2
-               OpSelectionMerge %495 None
-               OpBranchConditional %494 %496 %495
-        %496 = OpLabel
+        %495 = OpUGreaterThanEqual %bool %492 %uint_2
+               OpSelectionMerge %496 None
+               OpBranchConditional %495 %497 %496
+        %497 = OpLabel
                OpBranch %491
-        %495 = OpLabel
-        %497 = OpAccessChain %_ptr_Function_v3float %482 %492
-        %499 = OpLoad %v3float %497 None
-        %500 = OpAccessChain %_ptr_Function_v3float %484 %492
-               OpStore %500 %499 None
+        %496 = OpLabel
+        %498 = OpAccessChain %_ptr_Function_v3float %482 %492
+        %500 = OpLoad %v3float %498 None
+        %501 = OpAccessChain %_ptr_Function_v3float %484 %492
+               OpStore %501 %500 None
                OpBranch %489
         %489 = OpLabel
         %493 = OpIAdd %uint %492 %uint_1
                OpBranch %490
         %491 = OpLabel
-        %501 = OpLoad %_arr_v3float_uint_2_0 %484 None
-               OpReturnValue %501
+        %494 = OpLoad %_arr_v3float_uint_2_0 %484 None
+               OpReturnValue %494
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4v2half_uint_2_0 None %503
 %tint_source_0 = OpFunctionParameter %_arr_mat4v2half_uint_2
@@ -729,21 +729,21 @@
                OpLoopMerge %514 %512 None
                OpBranch %511
         %511 = OpLabel
-        %517 = OpUGreaterThanEqual %bool %515 %uint_2
-               OpSelectionMerge %518 None
-               OpBranchConditional %517 %519 %518
-        %519 = OpLabel
+        %518 = OpUGreaterThanEqual %bool %515 %uint_2
+               OpSelectionMerge %519 None
+               OpBranchConditional %518 %520 %519
+        %520 = OpLabel
                OpBranch %514
-        %518 = OpLabel
-        %520 = OpAccessChain %_ptr_Function_mat4v2half %505 %515
-        %522 = OpLoad %mat4v2half %520 None
-        %523 = OpAccessChain %_ptr_Function_mat4v2half %507 %515
-               OpStore %523 %522 None
+        %519 = OpLabel
+        %521 = OpAccessChain %_ptr_Function_mat4v2half %505 %515
+        %523 = OpLoad %mat4v2half %521 None
+        %524 = OpAccessChain %_ptr_Function_mat4v2half %507 %515
+               OpStore %524 %523 None
                OpBranch %512
         %512 = OpLabel
         %516 = OpIAdd %uint %515 %uint_1
                OpBranch %513
         %514 = OpLabel
-        %524 = OpLoad %_arr_mat4v2half_uint_2_0 %507 None
-               OpReturnValue %524
+        %517 = OpLoad %_arr_mat4v2half_uint_2_0 %507 None
+               OpReturnValue %517
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.spvasm b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.spvasm
index 2acc0d6..14c1348 100644
--- a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.spvasm
@@ -696,21 +696,21 @@
                OpLoopMerge %455 %453 None
                OpBranch %452
         %452 = OpLabel
-        %458 = OpUGreaterThanEqual %bool %456 %uint_2
-               OpSelectionMerge %459 None
-               OpBranchConditional %458 %460 %459
-        %460 = OpLabel
+        %459 = OpUGreaterThanEqual %bool %456 %uint_2
+               OpSelectionMerge %460 None
+               OpBranchConditional %459 %461 %460
+        %461 = OpLabel
                OpBranch %455
-        %459 = OpLabel
-        %461 = OpAccessChain %_ptr_Function_mat4v2half %446 %456
-        %463 = OpLoad %mat4v2half %461 None
-        %464 = OpAccessChain %_ptr_Function_mat4v2half %448 %456
-               OpStore %464 %463 None
+        %460 = OpLabel
+        %462 = OpAccessChain %_ptr_Function_mat4v2half %446 %456
+        %464 = OpLoad %mat4v2half %462 None
+        %465 = OpAccessChain %_ptr_Function_mat4v2half %448 %456
+               OpStore %465 %464 None
                OpBranch %453
         %453 = OpLabel
         %457 = OpIAdd %uint %456 %uint_1
                OpBranch %454
         %455 = OpLabel
-        %465 = OpLoad %_arr_mat4v2half_uint_2 %448 None
-               OpReturnValue %465
+        %458 = OpLoad %_arr_mat4v2half_uint_2 %448 None
+               OpReturnValue %458
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/static_index/read.wgsl.expected.spvasm b/test/tint/buffer/storage/static_index/read.wgsl.expected.spvasm
index c649172..5b297f8 100644
--- a/test/tint/buffer/storage/static_index/read.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/static_index/read.wgsl.expected.spvasm
@@ -368,23 +368,23 @@
                OpLoopMerge %228 %226 None
                OpBranch %225
         %225 = OpLabel
-        %231 = OpUGreaterThanEqual %bool %229 %uint_2
-               OpSelectionMerge %232 None
-               OpBranchConditional %231 %233 %232
-        %233 = OpLabel
+        %232 = OpUGreaterThanEqual %bool %229 %uint_2
+               OpSelectionMerge %233 None
+               OpBranchConditional %232 %234 %233
+        %234 = OpLabel
                OpBranch %228
-        %232 = OpLabel
-        %234 = OpAccessChain %_ptr_Function_v3float %219 %229
-        %236 = OpLoad %v3float %234 None
-        %237 = OpAccessChain %_ptr_Function_v3float %221 %229
-               OpStore %237 %236 None
+        %233 = OpLabel
+        %235 = OpAccessChain %_ptr_Function_v3float %219 %229
+        %237 = OpLoad %v3float %235 None
+        %238 = OpAccessChain %_ptr_Function_v3float %221 %229
+               OpStore %238 %237 None
                OpBranch %226
         %226 = OpLabel
         %230 = OpIAdd %uint %229 %uint_1
                OpBranch %227
         %228 = OpLabel
-        %238 = OpLoad %_arr_v3float_uint_2_0 %221 None
-               OpReturnValue %238
+        %231 = OpLoad %_arr_v3float_uint_2_0 %221 None
+               OpReturnValue %231
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_Inner_uint_4_0 None %240
 %tint_source_0 = OpFunctionParameter %_arr_Inner_uint_4
@@ -400,21 +400,21 @@
                OpLoopMerge %251 %249 None
                OpBranch %248
         %248 = OpLabel
-        %254 = OpUGreaterThanEqual %bool %252 %uint_4
-               OpSelectionMerge %255 None
-               OpBranchConditional %254 %256 %255
-        %256 = OpLabel
+        %255 = OpUGreaterThanEqual %bool %252 %uint_4
+               OpSelectionMerge %256 None
+               OpBranchConditional %255 %257 %256
+        %257 = OpLabel
                OpBranch %251
-        %255 = OpLabel
-        %257 = OpAccessChain %_ptr_Function_Inner %242 %252
-        %259 = OpLoad %Inner %257 None
-        %260 = OpAccessChain %_ptr_Function_Inner %244 %252
-               OpStore %260 %259 None
+        %256 = OpLabel
+        %258 = OpAccessChain %_ptr_Function_Inner %242 %252
+        %260 = OpLoad %Inner %258 None
+        %261 = OpAccessChain %_ptr_Function_Inner %244 %252
+               OpStore %261 %260 None
                OpBranch %249
         %249 = OpLabel
         %253 = OpIAdd %uint %252 %uint_1
                OpBranch %250
         %251 = OpLabel
-        %261 = OpLoad %_arr_Inner_uint_4_0 %244 None
-               OpReturnValue %261
+        %254 = OpLoad %_arr_Inner_uint_4_0 %244 None
+               OpReturnValue %254
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.spvasm b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.spvasm
index a72a9c4..0d1f737 100644
--- a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.spvasm
@@ -571,23 +571,23 @@
                OpLoopMerge %353 %351 None
                OpBranch %350
         %350 = OpLabel
-        %356 = OpUGreaterThanEqual %bool %354 %uint_2
-               OpSelectionMerge %357 None
-               OpBranchConditional %356 %358 %357
-        %358 = OpLabel
+        %357 = OpUGreaterThanEqual %bool %354 %uint_2
+               OpSelectionMerge %358 None
+               OpBranchConditional %357 %359 %358
+        %359 = OpLabel
                OpBranch %353
-        %357 = OpLabel
-        %359 = OpAccessChain %_ptr_Function_v3float %344 %354
-        %361 = OpLoad %v3float %359 None
-        %362 = OpAccessChain %_ptr_Function_v3float %346 %354
-               OpStore %362 %361 None
+        %358 = OpLabel
+        %360 = OpAccessChain %_ptr_Function_v3float %344 %354
+        %362 = OpLoad %v3float %360 None
+        %363 = OpAccessChain %_ptr_Function_v3float %346 %354
+               OpStore %363 %362 None
                OpBranch %351
         %351 = OpLabel
         %355 = OpIAdd %uint %354 %uint_1
                OpBranch %352
         %353 = OpLabel
-        %363 = OpLoad %_arr_v3float_uint_2_0 %346 None
-               OpReturnValue %363
+        %356 = OpLoad %_arr_v3float_uint_2_0 %346 None
+               OpReturnValue %356
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4v2half_uint_2_0 None %365
 %tint_source_0 = OpFunctionParameter %_arr_mat4v2half_uint_2
@@ -603,23 +603,23 @@
                OpLoopMerge %376 %374 None
                OpBranch %373
         %373 = OpLabel
-        %379 = OpUGreaterThanEqual %bool %377 %uint_2
-               OpSelectionMerge %380 None
-               OpBranchConditional %379 %381 %380
-        %381 = OpLabel
+        %380 = OpUGreaterThanEqual %bool %377 %uint_2
+               OpSelectionMerge %381 None
+               OpBranchConditional %380 %382 %381
+        %382 = OpLabel
                OpBranch %376
-        %380 = OpLabel
-        %382 = OpAccessChain %_ptr_Function_mat4v2half %367 %377
-        %384 = OpLoad %mat4v2half %382 None
-        %385 = OpAccessChain %_ptr_Function_mat4v2half %369 %377
-               OpStore %385 %384 None
+        %381 = OpLabel
+        %383 = OpAccessChain %_ptr_Function_mat4v2half %367 %377
+        %385 = OpLoad %mat4v2half %383 None
+        %386 = OpAccessChain %_ptr_Function_mat4v2half %369 %377
+               OpStore %386 %385 None
                OpBranch %374
         %374 = OpLabel
         %378 = OpIAdd %uint %377 %uint_1
                OpBranch %375
         %376 = OpLabel
-        %386 = OpLoad %_arr_mat4v2half_uint_2_0 %369 None
-               OpReturnValue %386
+        %379 = OpLoad %_arr_mat4v2half_uint_2_0 %369 None
+               OpReturnValue %379
                OpFunctionEnd
 %tint_convert_explicit_layout_1 = OpFunction %_arr_Inner_uint_4_0 None %388
 %tint_source_1 = OpFunctionParameter %_arr_Inner_uint_4
@@ -635,21 +635,21 @@
                OpLoopMerge %399 %397 None
                OpBranch %396
         %396 = OpLabel
-        %402 = OpUGreaterThanEqual %bool %400 %uint_4
-               OpSelectionMerge %403 None
-               OpBranchConditional %402 %404 %403
-        %404 = OpLabel
+        %403 = OpUGreaterThanEqual %bool %400 %uint_4
+               OpSelectionMerge %404 None
+               OpBranchConditional %403 %405 %404
+        %405 = OpLabel
                OpBranch %399
-        %403 = OpLabel
-        %405 = OpAccessChain %_ptr_Function_Inner %390 %400
-        %407 = OpLoad %Inner %405 None
-        %408 = OpAccessChain %_ptr_Function_Inner %392 %400
-               OpStore %408 %407 None
+        %404 = OpLabel
+        %406 = OpAccessChain %_ptr_Function_Inner %390 %400
+        %408 = OpLoad %Inner %406 None
+        %409 = OpAccessChain %_ptr_Function_Inner %392 %400
+               OpStore %409 %408 None
                OpBranch %397
         %397 = OpLabel
         %401 = OpIAdd %uint %400 %uint_1
                OpBranch %398
         %399 = OpLabel
-        %409 = OpLoad %_arr_Inner_uint_4_0 %392 None
-               OpReturnValue %409
+        %402 = OpLoad %_arr_Inner_uint_4_0 %392 None
+               OpReturnValue %402
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/static_index/write.wgsl.expected.spvasm b/test/tint/buffer/storage/static_index/write.wgsl.expected.spvasm
index baf4cf8..d6c1af9 100644
--- a/test/tint/buffer/storage/static_index/write.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/static_index/write.wgsl.expected.spvasm
@@ -345,21 +345,21 @@
                OpLoopMerge %191 %189 None
                OpBranch %188
         %188 = OpLabel
-        %194 = OpUGreaterThanEqual %bool %192 %uint_4
-               OpSelectionMerge %195 None
-               OpBranchConditional %194 %196 %195
-        %196 = OpLabel
+        %195 = OpUGreaterThanEqual %bool %192 %uint_4
+               OpSelectionMerge %196 None
+               OpBranchConditional %195 %197 %196
+        %197 = OpLabel
                OpBranch %191
-        %195 = OpLabel
-        %197 = OpAccessChain %_ptr_Function_Inner %182 %192
-        %199 = OpLoad %Inner %197 None
-        %200 = OpAccessChain %_ptr_Function_Inner %184 %192
-               OpStore %200 %199 None
+        %196 = OpLabel
+        %198 = OpAccessChain %_ptr_Function_Inner %182 %192
+        %200 = OpLoad %Inner %198 None
+        %201 = OpAccessChain %_ptr_Function_Inner %184 %192
+               OpStore %201 %200 None
                OpBranch %189
         %189 = OpLabel
         %193 = OpIAdd %uint %192 %uint_1
                OpBranch %190
         %191 = OpLabel
-        %201 = OpLoad %_arr_Inner_uint_4 %184 None
-               OpReturnValue %201
+        %194 = OpLoad %_arr_Inner_uint_4 %184 None
+               OpReturnValue %194
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.spvasm b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.spvasm
index 0cde0ae..22f371c 100644
--- a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.spvasm
@@ -598,21 +598,21 @@
                OpLoopMerge %331 %329 None
                OpBranch %328
         %328 = OpLabel
-        %334 = OpUGreaterThanEqual %bool %332 %uint_2
-               OpSelectionMerge %335 None
-               OpBranchConditional %334 %336 %335
-        %336 = OpLabel
+        %335 = OpUGreaterThanEqual %bool %332 %uint_2
+               OpSelectionMerge %336 None
+               OpBranchConditional %335 %337 %336
+        %337 = OpLabel
                OpBranch %331
-        %335 = OpLabel
-        %337 = OpAccessChain %_ptr_Function_mat4v2half %322 %332
-        %339 = OpLoad %mat4v2half %337 None
-        %340 = OpAccessChain %_ptr_Function_mat4v2half %324 %332
-               OpStore %340 %339 None
+        %336 = OpLabel
+        %338 = OpAccessChain %_ptr_Function_mat4v2half %322 %332
+        %340 = OpLoad %mat4v2half %338 None
+        %341 = OpAccessChain %_ptr_Function_mat4v2half %324 %332
+               OpStore %341 %340 None
                OpBranch %329
         %329 = OpLabel
         %333 = OpIAdd %uint %332 %uint_1
                OpBranch %330
         %331 = OpLabel
-        %341 = OpLoad %_arr_mat4v2half_uint_2 %324 None
-               OpReturnValue %341
+        %334 = OpLoad %_arr_mat4v2half_uint_2 %324 None
+               OpReturnValue %334
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/types/array4_f16.wgsl.expected.spvasm b/test/tint/buffer/storage/types/array4_f16.wgsl.expected.spvasm
index 5309f9c..b112db7 100644
--- a/test/tint/buffer/storage/types/array4_f16.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/types/array4_f16.wgsl.expected.spvasm
@@ -79,23 +79,23 @@
                OpLoopMerge %38 %36 None
                OpBranch %35
          %35 = OpLabel
-         %41 = OpUGreaterThanEqual %bool %39 %uint_4
-               OpSelectionMerge %43 None
-               OpBranchConditional %41 %44 %43
-         %44 = OpLabel
+         %42 = OpUGreaterThanEqual %bool %39 %uint_4
+               OpSelectionMerge %44 None
+               OpBranchConditional %42 %45 %44
+         %45 = OpLabel
                OpBranch %38
-         %43 = OpLabel
-         %45 = OpAccessChain %_ptr_Function_half %29 %39
-         %47 = OpLoad %half %45 None
-         %48 = OpAccessChain %_ptr_Function_half %31 %39
-               OpStore %48 %47 None
+         %44 = OpLabel
+         %46 = OpAccessChain %_ptr_Function_half %29 %39
+         %48 = OpLoad %half %46 None
+         %49 = OpAccessChain %_ptr_Function_half %31 %39
+               OpStore %49 %48 None
                OpBranch %36
          %36 = OpLabel
          %40 = OpIAdd %uint %39 %uint_1
                OpBranch %37
          %38 = OpLabel
-         %50 = OpLoad %_arr_half_uint_4_0 %31 None
-               OpReturnValue %50
+         %41 = OpLoad %_arr_half_uint_4_0 %31 None
+               OpReturnValue %41
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_half_uint_4 None %52
 %tint_source_0 = OpFunctionParameter %_arr_half_uint_4_0
@@ -111,21 +111,21 @@
                OpLoopMerge %61 %59 None
                OpBranch %58
          %58 = OpLabel
-         %64 = OpUGreaterThanEqual %bool %62 %uint_4
-               OpSelectionMerge %65 None
-               OpBranchConditional %64 %66 %65
-         %66 = OpLabel
+         %65 = OpUGreaterThanEqual %bool %62 %uint_4
+               OpSelectionMerge %66 None
+               OpBranchConditional %65 %67 %66
+         %67 = OpLabel
                OpBranch %61
-         %65 = OpLabel
-         %67 = OpAccessChain %_ptr_Function_half %54 %62
-         %68 = OpLoad %half %67 None
-         %69 = OpAccessChain %_ptr_Function_half %55 %62
-               OpStore %69 %68 None
+         %66 = OpLabel
+         %68 = OpAccessChain %_ptr_Function_half %54 %62
+         %69 = OpLoad %half %68 None
+         %70 = OpAccessChain %_ptr_Function_half %55 %62
+               OpStore %70 %69 None
                OpBranch %59
          %59 = OpLabel
          %63 = OpIAdd %uint %62 %uint_1
                OpBranch %60
          %61 = OpLabel
-         %70 = OpLoad %_arr_half_uint_4 %55 None
-               OpReturnValue %70
+         %64 = OpLoad %_arr_half_uint_4 %55 None
+               OpReturnValue %64
                OpFunctionEnd
diff --git a/test/tint/buffer/storage/types/array4_f32.wgsl.expected.spvasm b/test/tint/buffer/storage/types/array4_f32.wgsl.expected.spvasm
index 8fb0b46..a1cc66c 100644
--- a/test/tint/buffer/storage/types/array4_f32.wgsl.expected.spvasm
+++ b/test/tint/buffer/storage/types/array4_f32.wgsl.expected.spvasm
@@ -76,23 +76,23 @@
                OpLoopMerge %38 %36 None
                OpBranch %35
          %35 = OpLabel
-         %41 = OpUGreaterThanEqual %bool %39 %uint_4
-               OpSelectionMerge %43 None
-               OpBranchConditional %41 %44 %43
-         %44 = OpLabel
+         %42 = OpUGreaterThanEqual %bool %39 %uint_4
+               OpSelectionMerge %44 None
+               OpBranchConditional %42 %45 %44
+         %45 = OpLabel
                OpBranch %38
-         %43 = OpLabel
-         %45 = OpAccessChain %_ptr_Function_float %29 %39
-         %47 = OpLoad %float %45 None
-         %48 = OpAccessChain %_ptr_Function_float %31 %39
-               OpStore %48 %47 None
+         %44 = OpLabel
+         %46 = OpAccessChain %_ptr_Function_float %29 %39
+         %48 = OpLoad %float %46 None
+         %49 = OpAccessChain %_ptr_Function_float %31 %39
+               OpStore %49 %48 None
                OpBranch %36
          %36 = OpLabel
          %40 = OpIAdd %uint %39 %uint_1
                OpBranch %37
          %38 = OpLabel
-         %50 = OpLoad %_arr_float_uint_4_0 %31 None
-               OpReturnValue %50
+         %41 = OpLoad %_arr_float_uint_4_0 %31 None
+               OpReturnValue %41
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_float_uint_4 None %52
 %tint_source_0 = OpFunctionParameter %_arr_float_uint_4_0
@@ -108,21 +108,21 @@
                OpLoopMerge %61 %59 None
                OpBranch %58
          %58 = OpLabel
-         %64 = OpUGreaterThanEqual %bool %62 %uint_4
-               OpSelectionMerge %65 None
-               OpBranchConditional %64 %66 %65
-         %66 = OpLabel
+         %65 = OpUGreaterThanEqual %bool %62 %uint_4
+               OpSelectionMerge %66 None
+               OpBranchConditional %65 %67 %66
+         %67 = OpLabel
                OpBranch %61
-         %65 = OpLabel
-         %67 = OpAccessChain %_ptr_Function_float %54 %62
-         %68 = OpLoad %float %67 None
-         %69 = OpAccessChain %_ptr_Function_float %55 %62
-               OpStore %69 %68 None
+         %66 = OpLabel
+         %68 = OpAccessChain %_ptr_Function_float %54 %62
+         %69 = OpLoad %float %68 None
+         %70 = OpAccessChain %_ptr_Function_float %55 %62
+               OpStore %70 %69 None
                OpBranch %59
          %59 = OpLabel
          %63 = OpIAdd %uint %62 %uint_1
                OpBranch %60
          %61 = OpLabel
-         %70 = OpLoad %_arr_float_uint_4 %55 None
-               OpReturnValue %70
+         %64 = OpLoad %_arr_float_uint_4 %55 None
+               OpReturnValue %64
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.spvasm b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.spvasm
index 6dcd018..fc93d8c 100644
--- a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.spvasm
@@ -424,21 +424,21 @@
                OpLoopMerge %280 %278 None
                OpBranch %277
         %277 = OpLabel
-        %283 = OpUGreaterThanEqual %bool %281 %uint_2
-               OpSelectionMerge %284 None
-               OpBranchConditional %283 %285 %284
-        %285 = OpLabel
+        %284 = OpUGreaterThanEqual %bool %281 %uint_2
+               OpSelectionMerge %285 None
+               OpBranchConditional %284 %286 %285
+        %286 = OpLabel
                OpBranch %280
-        %284 = OpLabel
-        %286 = OpAccessChain %_ptr_Function_v3float %271 %281
-        %288 = OpLoad %v3float %286 None
-        %289 = OpAccessChain %_ptr_Function_v3float %273 %281
-               OpStore %289 %288 None
+        %285 = OpLabel
+        %287 = OpAccessChain %_ptr_Function_v3float %271 %281
+        %289 = OpLoad %v3float %287 None
+        %290 = OpAccessChain %_ptr_Function_v3float %273 %281
+               OpStore %290 %289 None
                OpBranch %278
         %278 = OpLabel
         %282 = OpIAdd %uint %281 %uint_1
                OpBranch %279
         %280 = OpLabel
-        %290 = OpLoad %_arr_v3float_uint_2_0 %273 None
-               OpReturnValue %290
+        %283 = OpLoad %_arr_v3float_uint_2_0 %273 None
+               OpReturnValue %283
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.spvasm b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.spvasm
index fdfdbca..e9bfc83 100644
--- a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.spvasm
@@ -371,10 +371,10 @@
 %_arr_mat4v2half_uint_2 = OpTypeArray %mat4v2half %uint_2
 %_ptr_Function__arr_mat4v2half_uint_2 = OpTypePointer Function %_arr_mat4v2half_uint_2
         %336 = OpConstantNull %_arr_mat4v2half_uint_2
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
        %bool = OpTypeBool
 %_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
 %_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
-%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
         %463 = OpTypeFunction %int %float
 %float_n2_14748365e_09 = OpConstant %float -2.14748365e+09
 %int_n2147483648 = OpConstant %int -2147483648
@@ -591,128 +591,128 @@
                OpLoopMerge %341 %339 None
                OpBranch %338
         %338 = OpLabel
-        %344 = OpUGreaterThanEqual %bool %342 %uint_2
-               OpSelectionMerge %346 None
-               OpBranchConditional %344 %347 %346
-        %347 = OpLabel
+        %448 = OpUGreaterThanEqual %bool %342 %uint_2
+               OpSelectionMerge %450 None
+               OpBranchConditional %448 %451 %450
+        %451 = OpLabel
                OpBranch %341
-        %346 = OpLabel
-        %348 = OpAccessChain %_ptr_Function_mat4v2half %333 %342
-        %350 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %331 %342
-        %352 = OpLoad %mat4x2_f16_std140 %350 None
-        %353 = OpCompositeExtract %v2half %352 0
-        %354 = OpCompositeExtract %v2half %352 1
-        %355 = OpCompositeExtract %v2half %352 2
-        %356 = OpCompositeExtract %v2half %352 3
-        %357 = OpCompositeConstruct %mat4v2half %353 %354 %355 %356
-               OpStore %348 %357 None
+        %450 = OpLabel
+        %452 = OpAccessChain %_ptr_Function_mat4v2half %333 %342
+        %454 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %331 %342
+        %456 = OpLoad %mat4x2_f16_std140 %454 None
+        %457 = OpCompositeExtract %v2half %456 0
+        %458 = OpCompositeExtract %v2half %456 1
+        %459 = OpCompositeExtract %v2half %456 2
+        %460 = OpCompositeExtract %v2half %456 3
+        %461 = OpCompositeConstruct %mat4v2half %457 %458 %459 %460
+               OpStore %452 %461 None
                OpBranch %339
         %339 = OpLabel
         %343 = OpIAdd %uint %342 %uint_1
                OpBranch %340
         %341 = OpLabel
 %arr2_mat4x2_f16 = OpLoad %_arr_mat4v2half_uint_2 %333 None
-        %359 = OpFunctionCall %int %tint_f32_to_i32 %scalar_f32
-        %361 = OpIAdd %int %359 %scalar_i32
-        %362 = OpBitcast %int %scalar_u32
-        %363 = OpIAdd %int %361 %362
-        %364 = OpFunctionCall %int %tint_f16_to_i32 %scalar_f16
-        %366 = OpIAdd %int %363 %364
-        %367 = OpCompositeExtract %float %vec2_f32 0
-        %368 = OpFunctionCall %int %tint_f32_to_i32 %367
-        %369 = OpIAdd %int %366 %368
-        %370 = OpCompositeExtract %int %vec2_i32 0
-        %371 = OpIAdd %int %369 %370
-        %372 = OpCompositeExtract %uint %vec2_u32 0
-        %373 = OpBitcast %int %372
+        %345 = OpFunctionCall %int %tint_f32_to_i32 %scalar_f32
+        %347 = OpIAdd %int %345 %scalar_i32
+        %348 = OpBitcast %int %scalar_u32
+        %349 = OpIAdd %int %347 %348
+        %350 = OpFunctionCall %int %tint_f16_to_i32 %scalar_f16
+        %352 = OpIAdd %int %349 %350
+        %353 = OpCompositeExtract %float %vec2_f32 0
+        %354 = OpFunctionCall %int %tint_f32_to_i32 %353
+        %355 = OpIAdd %int %352 %354
+        %356 = OpCompositeExtract %int %vec2_i32 0
+        %357 = OpIAdd %int %355 %356
+        %358 = OpCompositeExtract %uint %vec2_u32 0
+        %359 = OpBitcast %int %358
+        %360 = OpIAdd %int %357 %359
+        %361 = OpCompositeExtract %half %vec2_f16 0
+        %362 = OpFunctionCall %int %tint_f16_to_i32 %361
+        %363 = OpIAdd %int %360 %362
+        %364 = OpCompositeExtract %float %vec3_f32 1
+        %365 = OpFunctionCall %int %tint_f32_to_i32 %364
+        %366 = OpIAdd %int %363 %365
+        %367 = OpCompositeExtract %int %vec3_i32 1
+        %368 = OpIAdd %int %366 %367
+        %369 = OpCompositeExtract %uint %vec3_u32 1
+        %370 = OpBitcast %int %369
+        %371 = OpIAdd %int %368 %370
+        %372 = OpCompositeExtract %half %vec3_f16 1
+        %373 = OpFunctionCall %int %tint_f16_to_i32 %372
         %374 = OpIAdd %int %371 %373
-        %375 = OpCompositeExtract %half %vec2_f16 0
-        %376 = OpFunctionCall %int %tint_f16_to_i32 %375
+        %375 = OpCompositeExtract %float %vec4_f32 2
+        %376 = OpFunctionCall %int %tint_f32_to_i32 %375
         %377 = OpIAdd %int %374 %376
-        %378 = OpCompositeExtract %float %vec3_f32 1
-        %379 = OpFunctionCall %int %tint_f32_to_i32 %378
-        %380 = OpIAdd %int %377 %379
-        %381 = OpCompositeExtract %int %vec3_i32 1
-        %382 = OpIAdd %int %380 %381
-        %383 = OpCompositeExtract %uint %vec3_u32 1
-        %384 = OpBitcast %int %383
+        %378 = OpCompositeExtract %int %vec4_i32 2
+        %379 = OpIAdd %int %377 %378
+        %380 = OpCompositeExtract %uint %vec4_u32 2
+        %381 = OpBitcast %int %380
+        %382 = OpIAdd %int %379 %381
+        %383 = OpCompositeExtract %half %vec4_f16 2
+        %384 = OpFunctionCall %int %tint_f16_to_i32 %383
         %385 = OpIAdd %int %382 %384
-        %386 = OpCompositeExtract %half %vec3_f16 1
-        %387 = OpFunctionCall %int %tint_f16_to_i32 %386
+        %386 = OpCompositeExtract %float %mat2x2_f32 0 0
+        %387 = OpFunctionCall %int %tint_f32_to_i32 %386
         %388 = OpIAdd %int %385 %387
-        %389 = OpCompositeExtract %float %vec4_f32 2
+        %389 = OpCompositeExtract %float %mat2x3_f32 0 0
         %390 = OpFunctionCall %int %tint_f32_to_i32 %389
         %391 = OpIAdd %int %388 %390
-        %392 = OpCompositeExtract %int %vec4_i32 2
-        %393 = OpIAdd %int %391 %392
-        %394 = OpCompositeExtract %uint %vec4_u32 2
-        %395 = OpBitcast %int %394
-        %396 = OpIAdd %int %393 %395
-        %397 = OpCompositeExtract %half %vec4_f16 2
-        %398 = OpFunctionCall %int %tint_f16_to_i32 %397
-        %399 = OpIAdd %int %396 %398
-        %400 = OpCompositeExtract %float %mat2x2_f32 0 0
-        %401 = OpFunctionCall %int %tint_f32_to_i32 %400
-        %402 = OpIAdd %int %399 %401
-        %403 = OpCompositeExtract %float %mat2x3_f32 0 0
-        %404 = OpFunctionCall %int %tint_f32_to_i32 %403
-        %405 = OpIAdd %int %402 %404
-        %406 = OpCompositeExtract %float %mat2x4_f32 0 0
-        %407 = OpFunctionCall %int %tint_f32_to_i32 %406
-        %408 = OpIAdd %int %405 %407
-        %409 = OpCompositeExtract %float %mat3x2_f32 0 0
-        %410 = OpFunctionCall %int %tint_f32_to_i32 %409
-        %411 = OpIAdd %int %408 %410
-        %412 = OpCompositeExtract %float %mat3x3_f32 0 0
-        %413 = OpFunctionCall %int %tint_f32_to_i32 %412
-        %414 = OpIAdd %int %411 %413
-        %415 = OpCompositeExtract %float %mat3x4_f32 0 0
-        %416 = OpFunctionCall %int %tint_f32_to_i32 %415
-        %417 = OpIAdd %int %414 %416
-        %418 = OpCompositeExtract %float %mat4x2_f32 0 0
-        %419 = OpFunctionCall %int %tint_f32_to_i32 %418
-        %420 = OpIAdd %int %417 %419
-        %421 = OpCompositeExtract %float %mat4x3_f32 0 0
-        %422 = OpFunctionCall %int %tint_f32_to_i32 %421
-        %423 = OpIAdd %int %420 %422
-        %424 = OpCompositeExtract %float %mat4x4_f32 0 0
-        %425 = OpFunctionCall %int %tint_f32_to_i32 %424
-        %426 = OpIAdd %int %423 %425
-        %427 = OpCompositeExtract %half %mat2x2_f16 0 0
-        %428 = OpFunctionCall %int %tint_f16_to_i32 %427
-        %429 = OpIAdd %int %426 %428
-        %430 = OpCompositeExtract %half %mat2x3_f16 0 0
-        %431 = OpFunctionCall %int %tint_f16_to_i32 %430
-        %432 = OpIAdd %int %429 %431
-        %433 = OpCompositeExtract %half %mat2x4_f16 0 0
-        %434 = OpFunctionCall %int %tint_f16_to_i32 %433
-        %435 = OpIAdd %int %432 %434
-        %436 = OpCompositeExtract %half %mat3x2_f16 0 0
-        %437 = OpFunctionCall %int %tint_f16_to_i32 %436
-        %438 = OpIAdd %int %435 %437
-        %439 = OpCompositeExtract %half %mat3x3_f16 0 0
-        %440 = OpFunctionCall %int %tint_f16_to_i32 %439
-        %441 = OpIAdd %int %438 %440
-        %442 = OpCompositeExtract %half %mat3x4_f16 0 0
-        %443 = OpFunctionCall %int %tint_f16_to_i32 %442
-        %444 = OpIAdd %int %441 %443
-        %445 = OpCompositeExtract %half %mat4x2_f16 0 0
-        %446 = OpFunctionCall %int %tint_f16_to_i32 %445
-        %447 = OpIAdd %int %444 %446
-        %448 = OpCompositeExtract %half %mat4x3_f16 0 0
-        %449 = OpFunctionCall %int %tint_f16_to_i32 %448
-        %450 = OpIAdd %int %447 %449
-        %451 = OpCompositeExtract %half %mat4x4_f16 0 0
-        %452 = OpFunctionCall %int %tint_f16_to_i32 %451
-        %453 = OpIAdd %int %450 %452
-        %454 = OpCompositeExtract %float %arr2_vec3_f32 0 0
-        %455 = OpFunctionCall %int %tint_f32_to_i32 %454
-        %456 = OpIAdd %int %453 %455
-        %457 = OpCompositeExtract %half %arr2_mat4x2_f16 0 0 0
-        %458 = OpFunctionCall %int %tint_f16_to_i32 %457
-        %459 = OpIAdd %int %456 %458
-        %460 = OpAccessChain %_ptr_StorageBuffer_int %31 %uint_0
-               OpStore %460 %459 None
+        %392 = OpCompositeExtract %float %mat2x4_f32 0 0
+        %393 = OpFunctionCall %int %tint_f32_to_i32 %392
+        %394 = OpIAdd %int %391 %393
+        %395 = OpCompositeExtract %float %mat3x2_f32 0 0
+        %396 = OpFunctionCall %int %tint_f32_to_i32 %395
+        %397 = OpIAdd %int %394 %396
+        %398 = OpCompositeExtract %float %mat3x3_f32 0 0
+        %399 = OpFunctionCall %int %tint_f32_to_i32 %398
+        %400 = OpIAdd %int %397 %399
+        %401 = OpCompositeExtract %float %mat3x4_f32 0 0
+        %402 = OpFunctionCall %int %tint_f32_to_i32 %401
+        %403 = OpIAdd %int %400 %402
+        %404 = OpCompositeExtract %float %mat4x2_f32 0 0
+        %405 = OpFunctionCall %int %tint_f32_to_i32 %404
+        %406 = OpIAdd %int %403 %405
+        %407 = OpCompositeExtract %float %mat4x3_f32 0 0
+        %408 = OpFunctionCall %int %tint_f32_to_i32 %407
+        %409 = OpIAdd %int %406 %408
+        %410 = OpCompositeExtract %float %mat4x4_f32 0 0
+        %411 = OpFunctionCall %int %tint_f32_to_i32 %410
+        %412 = OpIAdd %int %409 %411
+        %413 = OpCompositeExtract %half %mat2x2_f16 0 0
+        %414 = OpFunctionCall %int %tint_f16_to_i32 %413
+        %415 = OpIAdd %int %412 %414
+        %416 = OpCompositeExtract %half %mat2x3_f16 0 0
+        %417 = OpFunctionCall %int %tint_f16_to_i32 %416
+        %418 = OpIAdd %int %415 %417
+        %419 = OpCompositeExtract %half %mat2x4_f16 0 0
+        %420 = OpFunctionCall %int %tint_f16_to_i32 %419
+        %421 = OpIAdd %int %418 %420
+        %422 = OpCompositeExtract %half %mat3x2_f16 0 0
+        %423 = OpFunctionCall %int %tint_f16_to_i32 %422
+        %424 = OpIAdd %int %421 %423
+        %425 = OpCompositeExtract %half %mat3x3_f16 0 0
+        %426 = OpFunctionCall %int %tint_f16_to_i32 %425
+        %427 = OpIAdd %int %424 %426
+        %428 = OpCompositeExtract %half %mat3x4_f16 0 0
+        %429 = OpFunctionCall %int %tint_f16_to_i32 %428
+        %430 = OpIAdd %int %427 %429
+        %431 = OpCompositeExtract %half %mat4x2_f16 0 0
+        %432 = OpFunctionCall %int %tint_f16_to_i32 %431
+        %433 = OpIAdd %int %430 %432
+        %434 = OpCompositeExtract %half %mat4x3_f16 0 0
+        %435 = OpFunctionCall %int %tint_f16_to_i32 %434
+        %436 = OpIAdd %int %433 %435
+        %437 = OpCompositeExtract %half %mat4x4_f16 0 0
+        %438 = OpFunctionCall %int %tint_f16_to_i32 %437
+        %439 = OpIAdd %int %436 %438
+        %440 = OpCompositeExtract %float %arr2_vec3_f32 0 0
+        %441 = OpFunctionCall %int %tint_f32_to_i32 %440
+        %442 = OpIAdd %int %439 %441
+        %443 = OpCompositeExtract %half %arr2_mat4x2_f16 0 0 0
+        %444 = OpFunctionCall %int %tint_f16_to_i32 %443
+        %445 = OpIAdd %int %442 %444
+        %446 = OpAccessChain %_ptr_StorageBuffer_int %31 %uint_0
+               OpStore %446 %445 None
                OpReturn
                OpFunctionEnd
 %tint_f32_to_i32 = OpFunction %int None %463
@@ -755,23 +755,23 @@
                OpLoopMerge %501 %499 None
                OpBranch %498
         %498 = OpLabel
-        %504 = OpUGreaterThanEqual %bool %502 %uint_2
-               OpSelectionMerge %505 None
-               OpBranchConditional %504 %506 %505
-        %506 = OpLabel
+        %505 = OpUGreaterThanEqual %bool %502 %uint_2
+               OpSelectionMerge %506 None
+               OpBranchConditional %505 %507 %506
+        %507 = OpLabel
                OpBranch %501
-        %505 = OpLabel
-        %507 = OpAccessChain %_ptr_Function_v3float %492 %502
-        %509 = OpLoad %v3float %507 None
-        %510 = OpAccessChain %_ptr_Function_v3float %494 %502
-               OpStore %510 %509 None
+        %506 = OpLabel
+        %508 = OpAccessChain %_ptr_Function_v3float %492 %502
+        %510 = OpLoad %v3float %508 None
+        %511 = OpAccessChain %_ptr_Function_v3float %494 %502
+               OpStore %511 %510 None
                OpBranch %499
         %499 = OpLabel
         %503 = OpIAdd %uint %502 %uint_1
                OpBranch %500
         %501 = OpLabel
-        %511 = OpLoad %_arr_v3float_uint_2_0 %494 None
-               OpReturnValue %511
+        %504 = OpLoad %_arr_v3float_uint_2_0 %494 None
+               OpReturnValue %504
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4x2_f16_std140_uint_2_0 None %513
 %tint_source_0 = OpFunctionParameter %_arr_mat4x2_f16_std140_uint_2
@@ -787,21 +787,21 @@
                OpLoopMerge %523 %521 None
                OpBranch %520
         %520 = OpLabel
-        %526 = OpUGreaterThanEqual %bool %524 %uint_2
-               OpSelectionMerge %527 None
-               OpBranchConditional %526 %528 %527
-        %528 = OpLabel
+        %527 = OpUGreaterThanEqual %bool %524 %uint_2
+               OpSelectionMerge %528 None
+               OpBranchConditional %527 %529 %528
+        %529 = OpLabel
                OpBranch %523
-        %527 = OpLabel
-        %529 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %515 %524
-        %530 = OpLoad %mat4x2_f16_std140 %529 None
-        %531 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %517 %524
-               OpStore %531 %530 None
+        %528 = OpLabel
+        %530 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %515 %524
+        %531 = OpLoad %mat4x2_f16_std140 %530 None
+        %532 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %517 %524
+               OpStore %532 %531 None
                OpBranch %521
         %521 = OpLabel
         %525 = OpIAdd %uint %524 %uint_1
                OpBranch %522
         %523 = OpLabel
-        %532 = OpLoad %_arr_mat4x2_f16_std140_uint_2_0 %517 None
-               OpReturnValue %532
+        %526 = OpLoad %_arr_mat4x2_f16_std140_uint_2_0 %517 None
+               OpReturnValue %526
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/static_index/read.wgsl.expected.spvasm b/test/tint/buffer/uniform/static_index/read.wgsl.expected.spvasm
index bc14567..9d51d05 100644
--- a/test/tint/buffer/uniform/static_index/read.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/static_index/read.wgsl.expected.spvasm
@@ -416,23 +416,23 @@
                OpLoopMerge %264 %262 None
                OpBranch %261
         %261 = OpLabel
-        %267 = OpUGreaterThanEqual %bool %265 %uint_2
-               OpSelectionMerge %268 None
-               OpBranchConditional %267 %269 %268
-        %269 = OpLabel
+        %268 = OpUGreaterThanEqual %bool %265 %uint_2
+               OpSelectionMerge %269 None
+               OpBranchConditional %268 %270 %269
+        %270 = OpLabel
                OpBranch %264
-        %268 = OpLabel
-        %270 = OpAccessChain %_ptr_Function_v3float %255 %265
-        %272 = OpLoad %v3float %270 None
-        %273 = OpAccessChain %_ptr_Function_v3float %257 %265
-               OpStore %273 %272 None
+        %269 = OpLabel
+        %271 = OpAccessChain %_ptr_Function_v3float %255 %265
+        %273 = OpLoad %v3float %271 None
+        %274 = OpAccessChain %_ptr_Function_v3float %257 %265
+               OpStore %274 %273 None
                OpBranch %262
         %262 = OpLabel
         %266 = OpIAdd %uint %265 %uint_1
                OpBranch %263
         %264 = OpLabel
-        %274 = OpLoad %_arr_v3float_uint_2_0 %257 None
-               OpReturnValue %274
+        %267 = OpLoad %_arr_v3float_uint_2_0 %257 None
+               OpReturnValue %267
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_Inner_uint_4_0 None %276
 %tint_source_0 = OpFunctionParameter %_arr_Inner_uint_4
@@ -448,21 +448,21 @@
                OpLoopMerge %287 %285 None
                OpBranch %284
         %284 = OpLabel
-        %290 = OpUGreaterThanEqual %bool %288 %uint_4
-               OpSelectionMerge %291 None
-               OpBranchConditional %290 %292 %291
-        %292 = OpLabel
+        %291 = OpUGreaterThanEqual %bool %288 %uint_4
+               OpSelectionMerge %292 None
+               OpBranchConditional %291 %293 %292
+        %293 = OpLabel
                OpBranch %287
-        %291 = OpLabel
-        %293 = OpAccessChain %_ptr_Function_Inner %278 %288
-        %295 = OpLoad %Inner %293 None
-        %296 = OpAccessChain %_ptr_Function_Inner %280 %288
-               OpStore %296 %295 None
+        %292 = OpLabel
+        %294 = OpAccessChain %_ptr_Function_Inner %278 %288
+        %296 = OpLoad %Inner %294 None
+        %297 = OpAccessChain %_ptr_Function_Inner %280 %288
+               OpStore %297 %296 None
                OpBranch %285
         %285 = OpLabel
         %289 = OpIAdd %uint %288 %uint_1
                OpBranch %286
         %287 = OpLabel
-        %297 = OpLoad %_arr_Inner_uint_4_0 %280 None
-               OpReturnValue %297
+        %290 = OpLoad %_arr_Inner_uint_4_0 %280 None
+               OpReturnValue %290
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.spvasm b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.spvasm
index 2770477..ec2fd0c 100644
--- a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.spvasm
@@ -376,15 +376,15 @@
 %_arr_mat4v2half_uint_2 = OpTypeArray %mat4v2half %uint_2
 %_ptr_Function__arr_mat4v2half_uint_2 = OpTypePointer Function %_arr_mat4v2half_uint_2
         %296 = OpConstantNull %_arr_mat4v2half_uint_2
-       %bool = OpTypeBool
-%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
 %_ptr_Uniform_Inner = OpTypePointer Uniform %Inner
     %uint_66 = OpConstant %uint 66
 %_ptr_Uniform__arr_Inner_uint_4 = OpTypePointer Uniform %_arr_Inner_uint_4
     %uint_67 = OpConstant %uint 67
 %_arr_Inner_uint_4_0 = OpTypeArray %Inner %uint_4
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+       %bool = OpTypeBool
+%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
+%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
         %438 = OpTypeFunction %int %float
 %float_n2_14748365e_09 = OpConstant %float -2.14748365e+09
 %int_n2147483648 = OpConstant %int -2147483648
@@ -568,137 +568,137 @@
                OpLoopMerge %301 %299 None
                OpBranch %298
         %298 = OpLabel
-        %304 = OpUGreaterThanEqual %bool %302 %uint_2
-               OpSelectionMerge %306 None
-               OpBranchConditional %304 %307 %306
-        %307 = OpLabel
+        %423 = OpUGreaterThanEqual %bool %302 %uint_2
+               OpSelectionMerge %425 None
+               OpBranchConditional %423 %426 %425
+        %426 = OpLabel
                OpBranch %301
-        %306 = OpLabel
-        %308 = OpAccessChain %_ptr_Function_mat4v2half %293 %302
-        %310 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %291 %302
-        %312 = OpLoad %mat4x2_f16_std140 %310 None
-        %313 = OpCompositeExtract %v2half %312 0
-        %314 = OpCompositeExtract %v2half %312 1
-        %315 = OpCompositeExtract %v2half %312 2
-        %316 = OpCompositeExtract %v2half %312 3
-        %317 = OpCompositeConstruct %mat4v2half %313 %314 %315 %316
-               OpStore %308 %317 None
+        %425 = OpLabel
+        %427 = OpAccessChain %_ptr_Function_mat4v2half %293 %302
+        %429 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %291 %302
+        %431 = OpLoad %mat4x2_f16_std140 %429 None
+        %432 = OpCompositeExtract %v2half %431 0
+        %433 = OpCompositeExtract %v2half %431 1
+        %434 = OpCompositeExtract %v2half %431 2
+        %435 = OpCompositeExtract %v2half %431 3
+        %436 = OpCompositeConstruct %mat4v2half %432 %433 %434 %435
+               OpStore %427 %436 None
                OpBranch %299
         %299 = OpLabel
         %303 = OpIAdd %uint %302 %uint_1
                OpBranch %300
         %301 = OpLabel
 %arr2_mat4x2_f16 = OpLoad %_arr_mat4v2half_uint_2 %293 None
-        %319 = OpAccessChain %_ptr_Uniform_Inner %1 %uint_0 %uint_66
-%struct_inner = OpLoad %Inner %319 None
-        %323 = OpAccessChain %_ptr_Uniform__arr_Inner_uint_4 %1 %uint_0 %uint_67
-        %326 = OpLoad %_arr_Inner_uint_4 %323 None
-%array_struct_inner = OpFunctionCall %_arr_Inner_uint_4_0 %tint_convert_explicit_layout_1 %326
-        %330 = OpFunctionCall %int %tint_f32_to_i32 %scalar_f32
-        %332 = OpIAdd %int %330 %scalar_i32
-        %333 = OpBitcast %int %scalar_u32
-        %334 = OpIAdd %int %332 %333
-        %335 = OpFunctionCall %int %tint_f16_to_i32 %scalar_f16
-        %337 = OpIAdd %int %334 %335
-        %338 = OpCompositeExtract %float %vec2_f32 0
-        %339 = OpFunctionCall %int %tint_f32_to_i32 %338
-        %340 = OpIAdd %int %337 %339
-        %341 = OpCompositeExtract %int %vec2_i32 0
-        %342 = OpIAdd %int %340 %341
-        %343 = OpCompositeExtract %uint %vec2_u32 0
-        %344 = OpBitcast %int %343
+        %305 = OpAccessChain %_ptr_Uniform_Inner %1 %uint_0 %uint_66
+%struct_inner = OpLoad %Inner %305 None
+        %309 = OpAccessChain %_ptr_Uniform__arr_Inner_uint_4 %1 %uint_0 %uint_67
+        %312 = OpLoad %_arr_Inner_uint_4 %309 None
+%array_struct_inner = OpFunctionCall %_arr_Inner_uint_4_0 %tint_convert_explicit_layout_1 %312
+        %316 = OpFunctionCall %int %tint_f32_to_i32 %scalar_f32
+        %318 = OpIAdd %int %316 %scalar_i32
+        %319 = OpBitcast %int %scalar_u32
+        %320 = OpIAdd %int %318 %319
+        %321 = OpFunctionCall %int %tint_f16_to_i32 %scalar_f16
+        %323 = OpIAdd %int %320 %321
+        %324 = OpCompositeExtract %float %vec2_f32 0
+        %325 = OpFunctionCall %int %tint_f32_to_i32 %324
+        %326 = OpIAdd %int %323 %325
+        %327 = OpCompositeExtract %int %vec2_i32 0
+        %328 = OpIAdd %int %326 %327
+        %329 = OpCompositeExtract %uint %vec2_u32 0
+        %330 = OpBitcast %int %329
+        %331 = OpIAdd %int %328 %330
+        %332 = OpCompositeExtract %half %vec2_f16 0
+        %333 = OpFunctionCall %int %tint_f16_to_i32 %332
+        %334 = OpIAdd %int %331 %333
+        %335 = OpCompositeExtract %float %vec3_f32 1
+        %336 = OpFunctionCall %int %tint_f32_to_i32 %335
+        %337 = OpIAdd %int %334 %336
+        %338 = OpCompositeExtract %int %vec3_i32 1
+        %339 = OpIAdd %int %337 %338
+        %340 = OpCompositeExtract %uint %vec3_u32 1
+        %341 = OpBitcast %int %340
+        %342 = OpIAdd %int %339 %341
+        %343 = OpCompositeExtract %half %vec3_f16 1
+        %344 = OpFunctionCall %int %tint_f16_to_i32 %343
         %345 = OpIAdd %int %342 %344
-        %346 = OpCompositeExtract %half %vec2_f16 0
-        %347 = OpFunctionCall %int %tint_f16_to_i32 %346
+        %346 = OpCompositeExtract %float %vec4_f32 2
+        %347 = OpFunctionCall %int %tint_f32_to_i32 %346
         %348 = OpIAdd %int %345 %347
-        %349 = OpCompositeExtract %float %vec3_f32 1
-        %350 = OpFunctionCall %int %tint_f32_to_i32 %349
-        %351 = OpIAdd %int %348 %350
-        %352 = OpCompositeExtract %int %vec3_i32 1
-        %353 = OpIAdd %int %351 %352
-        %354 = OpCompositeExtract %uint %vec3_u32 1
-        %355 = OpBitcast %int %354
+        %349 = OpCompositeExtract %int %vec4_i32 2
+        %350 = OpIAdd %int %348 %349
+        %351 = OpCompositeExtract %uint %vec4_u32 2
+        %352 = OpBitcast %int %351
+        %353 = OpIAdd %int %350 %352
+        %354 = OpCompositeExtract %half %vec4_f16 2
+        %355 = OpFunctionCall %int %tint_f16_to_i32 %354
         %356 = OpIAdd %int %353 %355
-        %357 = OpCompositeExtract %half %vec3_f16 1
-        %358 = OpFunctionCall %int %tint_f16_to_i32 %357
+        %357 = OpCompositeExtract %float %mat2x2_f32 0 0
+        %358 = OpFunctionCall %int %tint_f32_to_i32 %357
         %359 = OpIAdd %int %356 %358
-        %360 = OpCompositeExtract %float %vec4_f32 2
+        %360 = OpCompositeExtract %float %mat2x3_f32 0 0
         %361 = OpFunctionCall %int %tint_f32_to_i32 %360
         %362 = OpIAdd %int %359 %361
-        %363 = OpCompositeExtract %int %vec4_i32 2
-        %364 = OpIAdd %int %362 %363
-        %365 = OpCompositeExtract %uint %vec4_u32 2
-        %366 = OpBitcast %int %365
-        %367 = OpIAdd %int %364 %366
-        %368 = OpCompositeExtract %half %vec4_f16 2
-        %369 = OpFunctionCall %int %tint_f16_to_i32 %368
-        %370 = OpIAdd %int %367 %369
-        %371 = OpCompositeExtract %float %mat2x2_f32 0 0
-        %372 = OpFunctionCall %int %tint_f32_to_i32 %371
-        %373 = OpIAdd %int %370 %372
-        %374 = OpCompositeExtract %float %mat2x3_f32 0 0
-        %375 = OpFunctionCall %int %tint_f32_to_i32 %374
-        %376 = OpIAdd %int %373 %375
-        %377 = OpCompositeExtract %float %mat2x4_f32 0 0
-        %378 = OpFunctionCall %int %tint_f32_to_i32 %377
-        %379 = OpIAdd %int %376 %378
-        %380 = OpCompositeExtract %float %mat3x2_f32 0 0
-        %381 = OpFunctionCall %int %tint_f32_to_i32 %380
-        %382 = OpIAdd %int %379 %381
-        %383 = OpCompositeExtract %float %mat3x3_f32 0 0
-        %384 = OpFunctionCall %int %tint_f32_to_i32 %383
-        %385 = OpIAdd %int %382 %384
-        %386 = OpCompositeExtract %float %mat3x4_f32 0 0
-        %387 = OpFunctionCall %int %tint_f32_to_i32 %386
-        %388 = OpIAdd %int %385 %387
-        %389 = OpCompositeExtract %float %mat4x2_f32 0 0
-        %390 = OpFunctionCall %int %tint_f32_to_i32 %389
-        %391 = OpIAdd %int %388 %390
-        %392 = OpCompositeExtract %float %mat4x3_f32 0 0
-        %393 = OpFunctionCall %int %tint_f32_to_i32 %392
-        %394 = OpIAdd %int %391 %393
-        %395 = OpCompositeExtract %float %mat4x4_f32 0 0
-        %396 = OpFunctionCall %int %tint_f32_to_i32 %395
-        %397 = OpIAdd %int %394 %396
-        %398 = OpCompositeExtract %half %mat2x2_f16 0 0
-        %399 = OpFunctionCall %int %tint_f16_to_i32 %398
-        %400 = OpIAdd %int %397 %399
-        %401 = OpCompositeExtract %half %mat2x3_f16 0 0
-        %402 = OpFunctionCall %int %tint_f16_to_i32 %401
-        %403 = OpIAdd %int %400 %402
-        %404 = OpCompositeExtract %half %mat2x4_f16 0 0
-        %405 = OpFunctionCall %int %tint_f16_to_i32 %404
-        %406 = OpIAdd %int %403 %405
-        %407 = OpCompositeExtract %half %mat3x2_f16 0 0
-        %408 = OpFunctionCall %int %tint_f16_to_i32 %407
-        %409 = OpIAdd %int %406 %408
-        %410 = OpCompositeExtract %half %mat3x3_f16 0 0
-        %411 = OpFunctionCall %int %tint_f16_to_i32 %410
-        %412 = OpIAdd %int %409 %411
-        %413 = OpCompositeExtract %half %mat3x4_f16 0 0
-        %414 = OpFunctionCall %int %tint_f16_to_i32 %413
-        %415 = OpIAdd %int %412 %414
-        %416 = OpCompositeExtract %half %mat4x2_f16 0 0
-        %417 = OpFunctionCall %int %tint_f16_to_i32 %416
-        %418 = OpIAdd %int %415 %417
-        %419 = OpCompositeExtract %half %mat4x3_f16 0 0
-        %420 = OpFunctionCall %int %tint_f16_to_i32 %419
-        %421 = OpIAdd %int %418 %420
-        %422 = OpCompositeExtract %half %mat4x4_f16 0 0
-        %423 = OpFunctionCall %int %tint_f16_to_i32 %422
-        %424 = OpIAdd %int %421 %423
-        %425 = OpCompositeExtract %float %arr2_vec3_f32 0 0
-        %426 = OpFunctionCall %int %tint_f32_to_i32 %425
-        %427 = OpIAdd %int %424 %426
-        %428 = OpCompositeExtract %half %arr2_mat4x2_f16 0 0 0
-        %429 = OpFunctionCall %int %tint_f16_to_i32 %428
-        %430 = OpIAdd %int %427 %429
-        %431 = OpCompositeExtract %int %struct_inner 0
-        %432 = OpIAdd %int %430 %431
-        %433 = OpCompositeExtract %int %array_struct_inner 0 0
-        %434 = OpIAdd %int %432 %433
-        %435 = OpAccessChain %_ptr_StorageBuffer_int %31 %uint_0
-               OpStore %435 %434 None
+        %363 = OpCompositeExtract %float %mat2x4_f32 0 0
+        %364 = OpFunctionCall %int %tint_f32_to_i32 %363
+        %365 = OpIAdd %int %362 %364
+        %366 = OpCompositeExtract %float %mat3x2_f32 0 0
+        %367 = OpFunctionCall %int %tint_f32_to_i32 %366
+        %368 = OpIAdd %int %365 %367
+        %369 = OpCompositeExtract %float %mat3x3_f32 0 0
+        %370 = OpFunctionCall %int %tint_f32_to_i32 %369
+        %371 = OpIAdd %int %368 %370
+        %372 = OpCompositeExtract %float %mat3x4_f32 0 0
+        %373 = OpFunctionCall %int %tint_f32_to_i32 %372
+        %374 = OpIAdd %int %371 %373
+        %375 = OpCompositeExtract %float %mat4x2_f32 0 0
+        %376 = OpFunctionCall %int %tint_f32_to_i32 %375
+        %377 = OpIAdd %int %374 %376
+        %378 = OpCompositeExtract %float %mat4x3_f32 0 0
+        %379 = OpFunctionCall %int %tint_f32_to_i32 %378
+        %380 = OpIAdd %int %377 %379
+        %381 = OpCompositeExtract %float %mat4x4_f32 0 0
+        %382 = OpFunctionCall %int %tint_f32_to_i32 %381
+        %383 = OpIAdd %int %380 %382
+        %384 = OpCompositeExtract %half %mat2x2_f16 0 0
+        %385 = OpFunctionCall %int %tint_f16_to_i32 %384
+        %386 = OpIAdd %int %383 %385
+        %387 = OpCompositeExtract %half %mat2x3_f16 0 0
+        %388 = OpFunctionCall %int %tint_f16_to_i32 %387
+        %389 = OpIAdd %int %386 %388
+        %390 = OpCompositeExtract %half %mat2x4_f16 0 0
+        %391 = OpFunctionCall %int %tint_f16_to_i32 %390
+        %392 = OpIAdd %int %389 %391
+        %393 = OpCompositeExtract %half %mat3x2_f16 0 0
+        %394 = OpFunctionCall %int %tint_f16_to_i32 %393
+        %395 = OpIAdd %int %392 %394
+        %396 = OpCompositeExtract %half %mat3x3_f16 0 0
+        %397 = OpFunctionCall %int %tint_f16_to_i32 %396
+        %398 = OpIAdd %int %395 %397
+        %399 = OpCompositeExtract %half %mat3x4_f16 0 0
+        %400 = OpFunctionCall %int %tint_f16_to_i32 %399
+        %401 = OpIAdd %int %398 %400
+        %402 = OpCompositeExtract %half %mat4x2_f16 0 0
+        %403 = OpFunctionCall %int %tint_f16_to_i32 %402
+        %404 = OpIAdd %int %401 %403
+        %405 = OpCompositeExtract %half %mat4x3_f16 0 0
+        %406 = OpFunctionCall %int %tint_f16_to_i32 %405
+        %407 = OpIAdd %int %404 %406
+        %408 = OpCompositeExtract %half %mat4x4_f16 0 0
+        %409 = OpFunctionCall %int %tint_f16_to_i32 %408
+        %410 = OpIAdd %int %407 %409
+        %411 = OpCompositeExtract %float %arr2_vec3_f32 0 0
+        %412 = OpFunctionCall %int %tint_f32_to_i32 %411
+        %413 = OpIAdd %int %410 %412
+        %414 = OpCompositeExtract %half %arr2_mat4x2_f16 0 0 0
+        %415 = OpFunctionCall %int %tint_f16_to_i32 %414
+        %416 = OpIAdd %int %413 %415
+        %417 = OpCompositeExtract %int %struct_inner 0
+        %418 = OpIAdd %int %416 %417
+        %419 = OpCompositeExtract %int %array_struct_inner 0 0
+        %420 = OpIAdd %int %418 %419
+        %421 = OpAccessChain %_ptr_StorageBuffer_int %31 %uint_0
+               OpStore %421 %420 None
                OpReturn
                OpFunctionEnd
 %tint_f32_to_i32 = OpFunction %int None %438
@@ -735,23 +735,23 @@
                OpLoopMerge %471 %469 None
                OpBranch %468
         %468 = OpLabel
-        %474 = OpUGreaterThanEqual %bool %472 %uint_2
-               OpSelectionMerge %475 None
-               OpBranchConditional %474 %476 %475
-        %476 = OpLabel
+        %475 = OpUGreaterThanEqual %bool %472 %uint_2
+               OpSelectionMerge %476 None
+               OpBranchConditional %475 %477 %476
+        %477 = OpLabel
                OpBranch %471
-        %475 = OpLabel
-        %477 = OpAccessChain %_ptr_Function_v3float %462 %472
-        %479 = OpLoad %v3float %477 None
-        %480 = OpAccessChain %_ptr_Function_v3float %464 %472
-               OpStore %480 %479 None
+        %476 = OpLabel
+        %478 = OpAccessChain %_ptr_Function_v3float %462 %472
+        %480 = OpLoad %v3float %478 None
+        %481 = OpAccessChain %_ptr_Function_v3float %464 %472
+               OpStore %481 %480 None
                OpBranch %469
         %469 = OpLabel
         %473 = OpIAdd %uint %472 %uint_1
                OpBranch %470
         %471 = OpLabel
-        %481 = OpLoad %_arr_v3float_uint_2_0 %464 None
-               OpReturnValue %481
+        %474 = OpLoad %_arr_v3float_uint_2_0 %464 None
+               OpReturnValue %474
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4x2_f16_std140_uint_2_0 None %483
 %tint_source_0 = OpFunctionParameter %_arr_mat4x2_f16_std140_uint_2
@@ -767,23 +767,23 @@
                OpLoopMerge %493 %491 None
                OpBranch %490
         %490 = OpLabel
-        %496 = OpUGreaterThanEqual %bool %494 %uint_2
-               OpSelectionMerge %497 None
-               OpBranchConditional %496 %498 %497
-        %498 = OpLabel
+        %497 = OpUGreaterThanEqual %bool %494 %uint_2
+               OpSelectionMerge %498 None
+               OpBranchConditional %497 %499 %498
+        %499 = OpLabel
                OpBranch %493
-        %497 = OpLabel
-        %499 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %485 %494
-        %500 = OpLoad %mat4x2_f16_std140 %499 None
-        %501 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %487 %494
-               OpStore %501 %500 None
+        %498 = OpLabel
+        %500 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %485 %494
+        %501 = OpLoad %mat4x2_f16_std140 %500 None
+        %502 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %487 %494
+               OpStore %502 %501 None
                OpBranch %491
         %491 = OpLabel
         %495 = OpIAdd %uint %494 %uint_1
                OpBranch %492
         %493 = OpLabel
-        %502 = OpLoad %_arr_mat4x2_f16_std140_uint_2_0 %487 None
-               OpReturnValue %502
+        %496 = OpLoad %_arr_mat4x2_f16_std140_uint_2_0 %487 None
+               OpReturnValue %496
                OpFunctionEnd
 %tint_convert_explicit_layout_1 = OpFunction %_arr_Inner_uint_4_0 None %504
 %tint_source_1 = OpFunctionParameter %_arr_Inner_uint_4
@@ -799,21 +799,21 @@
                OpLoopMerge %515 %513 None
                OpBranch %512
         %512 = OpLabel
-        %518 = OpUGreaterThanEqual %bool %516 %uint_4
-               OpSelectionMerge %519 None
-               OpBranchConditional %518 %520 %519
-        %520 = OpLabel
+        %519 = OpUGreaterThanEqual %bool %516 %uint_4
+               OpSelectionMerge %520 None
+               OpBranchConditional %519 %521 %520
+        %521 = OpLabel
                OpBranch %515
-        %519 = OpLabel
-        %521 = OpAccessChain %_ptr_Function_Inner %506 %516
-        %523 = OpLoad %Inner %521 None
-        %524 = OpAccessChain %_ptr_Function_Inner %508 %516
-               OpStore %524 %523 None
+        %520 = OpLabel
+        %522 = OpAccessChain %_ptr_Function_Inner %506 %516
+        %524 = OpLoad %Inner %522 None
+        %525 = OpAccessChain %_ptr_Function_Inner %508 %516
+               OpStore %525 %524 None
                OpBranch %513
         %513 = OpLabel
         %517 = OpIAdd %uint %516 %uint_1
                OpBranch %514
         %515 = OpLabel
-        %525 = OpLoad %_arr_Inner_uint_4_0 %508 None
-               OpReturnValue %525
+        %518 = OpLoad %_arr_Inner_uint_4_0 %508 None
+               OpReturnValue %518
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 58a7a84..a6da27c 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -69,9 +69,9 @@
 %_arr_mat2v2float_uint_4 = OpTypeArray %mat2v2float %uint_4
 %_ptr_Function__arr_mat2v2float_uint_4 = OpTypePointer Function %_arr_mat2v2float_uint_4
          %61 = OpConstantNull %_arr_mat2v2float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %91 = OpTypeFunction %_arr_mat2x2_f32_std140_uint_4_0 %_arr_mat2x2_f32_std140_uint_4
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4
          %96 = OpConstantNull %_arr_mat2x2_f32_std140_uint_4_0
@@ -114,34 +114,34 @@
                OpLoopMerge %66 %64 None
                OpBranch %63
          %63 = OpLabel
-         %69 = OpUGreaterThanEqual %bool %67 %uint_4
-               OpSelectionMerge %71 None
-               OpBranchConditional %69 %72 %71
-         %72 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %67 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %66
-         %71 = OpLabel
-         %73 = OpAccessChain %_ptr_Function_mat2v2float %58 %67
-         %74 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %56 %67
-         %76 = OpLoad %mat2x2_f32_std140 %74 None
-         %77 = OpCompositeExtract %v2float %76 0
-         %78 = OpCompositeExtract %v2float %76 1
-         %79 = OpCompositeConstruct %mat2v2float %77 %78
-               OpStore %73 %79 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Function_mat2v2float %58 %67
+         %84 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %56 %67
+         %86 = OpLoad %mat2x2_f32_std140 %84 None
+         %87 = OpCompositeExtract %v2float %86 0
+         %88 = OpCompositeExtract %v2float %86 1
+         %89 = OpCompositeConstruct %mat2v2float %87 %88
+               OpStore %83 %89 None
                OpBranch %64
          %64 = OpLabel
          %68 = OpIAdd %uint %67 %uint_1
                OpBranch %65
          %66 = OpLabel
         %l_a = OpLoad %_arr_mat2v2float_uint_4 %58 None
-         %81 = OpCompositeExtract %float %l_a_i_i 0
-         %82 = OpCompositeExtract %float %l_a 0 0 0
-         %83 = OpFAdd %float %81 %82
-         %84 = OpCompositeExtract %float %l_a_i 0 0
-         %85 = OpFAdd %float %83 %84
-         %86 = OpCompositeExtract %float %l_a_i_i 0
-         %87 = OpFAdd %float %85 %86
-         %88 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %88 %87 None
+         %70 = OpCompositeExtract %float %l_a_i_i 0
+         %71 = OpCompositeExtract %float %l_a 0 0 0
+         %72 = OpFAdd %float %70 %71
+         %73 = OpCompositeExtract %float %l_a_i 0 0
+         %74 = OpFAdd %float %72 %73
+         %75 = OpCompositeExtract %float %l_a_i_i 0
+         %76 = OpFAdd %float %74 %75
+         %77 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %77 %76 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x2_f32_std140_uint_4_0 None %91
@@ -158,21 +158,21 @@
                OpLoopMerge %101 %99 None
                OpBranch %98
          %98 = OpLabel
-        %104 = OpUGreaterThanEqual %bool %102 %uint_4
-               OpSelectionMerge %105 None
-               OpBranchConditional %104 %106 %105
-        %106 = OpLabel
+        %105 = OpUGreaterThanEqual %bool %102 %uint_4
+               OpSelectionMerge %106 None
+               OpBranchConditional %105 %107 %106
+        %107 = OpLabel
                OpBranch %101
-        %105 = OpLabel
-        %107 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %93 %102
-        %108 = OpLoad %mat2x2_f32_std140 %107 None
-        %109 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %95 %102
-               OpStore %109 %108 None
+        %106 = OpLabel
+        %108 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %93 %102
+        %109 = OpLoad %mat2x2_f32_std140 %108 None
+        %110 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %95 %102
+               OpStore %110 %109 None
                OpBranch %99
          %99 = OpLabel
         %103 = OpIAdd %uint %102 %uint_1
                OpBranch %100
         %101 = OpLabel
-        %110 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %95 None
-               OpReturnValue %110
+        %104 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %95 None
+               OpReturnValue %104
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm
index 62ca647..e38511a 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -58,10 +58,10 @@
 %_arr_mat2v2float_uint_4 = OpTypeArray %mat2v2float %uint_4
 %_ptr_Function__arr_mat2v2float_uint_4 = OpTypePointer Function %_arr_mat2v2float_uint_4
          %39 = OpConstantNull %_arr_mat2v2float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
 %_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %70 = OpTypeFunction %_arr_mat2x2_f32_std140_uint_4_0 %_arr_mat2x2_f32_std140_uint_4
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4
          %75 = OpConstantNull %_arr_mat2x2_f32_std140_uint_4_0
@@ -87,34 +87,34 @@
                OpLoopMerge %44 %42 None
                OpBranch %41
          %41 = OpLabel
-         %47 = OpUGreaterThanEqual %bool %45 %uint_4
-               OpSelectionMerge %49 None
-               OpBranchConditional %47 %50 %49
-         %50 = OpLabel
+         %57 = OpUGreaterThanEqual %bool %45 %uint_4
+               OpSelectionMerge %59 None
+               OpBranchConditional %57 %60 %59
+         %60 = OpLabel
                OpBranch %44
-         %49 = OpLabel
-         %51 = OpAccessChain %_ptr_Function_mat2v2float %36 %45
-         %53 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %34 %45
-         %55 = OpLoad %mat2x2_f32_std140 %53 None
-         %56 = OpCompositeExtract %v2float %55 0
-         %57 = OpCompositeExtract %v2float %55 1
-         %58 = OpCompositeConstruct %mat2v2float %56 %57
-               OpStore %51 %58 None
+         %59 = OpLabel
+         %61 = OpAccessChain %_ptr_Function_mat2v2float %36 %45
+         %63 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %34 %45
+         %65 = OpLoad %mat2x2_f32_std140 %63 None
+         %66 = OpCompositeExtract %v2float %65 0
+         %67 = OpCompositeExtract %v2float %65 1
+         %68 = OpCompositeConstruct %mat2v2float %66 %67
+               OpStore %61 %68 None
                OpBranch %42
          %42 = OpLabel
          %46 = OpIAdd %uint %45 %uint_1
                OpBranch %43
          %44 = OpLabel
         %l_a = OpLoad %_arr_mat2v2float_uint_4 %36 None
-         %60 = OpCompositeExtract %float %l_a_i_i 0
-         %61 = OpCompositeExtract %float %l_a 0 0 0
-         %62 = OpFAdd %float %60 %61
-         %63 = OpCompositeExtract %float %l_a_i 0 0
-         %64 = OpFAdd %float %62 %63
-         %65 = OpCompositeExtract %float %l_a_i_i 0
-         %66 = OpFAdd %float %64 %65
-         %67 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %67 %66 None
+         %48 = OpCompositeExtract %float %l_a_i_i 0
+         %49 = OpCompositeExtract %float %l_a 0 0 0
+         %50 = OpFAdd %float %48 %49
+         %51 = OpCompositeExtract %float %l_a_i 0 0
+         %52 = OpFAdd %float %50 %51
+         %53 = OpCompositeExtract %float %l_a_i_i 0
+         %54 = OpFAdd %float %52 %53
+         %55 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %55 %54 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x2_f32_std140_uint_4_0 None %70
@@ -131,21 +131,21 @@
                OpLoopMerge %80 %78 None
                OpBranch %77
          %77 = OpLabel
-         %83 = OpUGreaterThanEqual %bool %81 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %83 %85 %84
-         %85 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %84 %86 %85
+         %86 = OpLabel
                OpBranch %80
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %72 %81
-         %87 = OpLoad %mat2x2_f32_std140 %86 None
-         %88 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %74 %81
-               OpStore %88 %87 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %72 %81
+         %88 = OpLoad %mat2x2_f32_std140 %87 None
+         %89 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %74 %81
+               OpStore %89 %88 None
                OpBranch %78
          %78 = OpLabel
          %82 = OpIAdd %uint %81 %uint_1
                OpBranch %79
          %80 = OpLabel
-         %89 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %74 None
-               OpReturnValue %89
+         %83 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %74 None
+               OpReturnValue %83
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.spvasm
index 4b40156..690bab4 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.spvasm
@@ -64,12 +64,12 @@
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4_0
 %_ptr_Function__arr_mat2v2float_uint_4 = OpTypePointer Function %_arr_mat2v2float_uint_4
          %49 = OpConstantNull %_arr_mat2v2float_uint_4
+%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+     %uint_1 = OpConstant %uint 1
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
 %_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
-     %uint_1 = OpConstant %uint 1
-%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %94 = OpTypeFunction %_arr_mat2x2_f32_std140_uint_4_0 %_arr_mat2x2_f32_std140_uint_4
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4
          %99 = OpConstantNull %_arr_mat2x2_f32_std140_uint_4_0
@@ -112,46 +112,46 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %83 None
+               OpBranchConditional %81 %84 %83
+         %84 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat2v2float %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %45 %55
-         %65 = OpLoad %mat2x2_f32_std140 %63 None
-         %66 = OpCompositeExtract %v2float %65 0
-         %67 = OpCompositeExtract %v2float %65 1
-         %68 = OpCompositeConstruct %mat2v2float %66 %67
-               OpStore %61 %68 None
+         %83 = OpLabel
+         %85 = OpAccessChain %_ptr_Function_mat2v2float %47 %55
+         %87 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %45 %55
+         %89 = OpLoad %mat2x2_f32_std140 %87 None
+         %90 = OpCompositeExtract %v2float %89 0
+         %91 = OpCompositeExtract %v2float %89 1
+         %92 = OpCompositeConstruct %mat2v2float %90 %91
+               OpStore %85 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %70 = OpLoad %_arr_mat2v2float_uint_4 %47 None
-         %71 = OpFunctionCall %float %a %70
-         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
-         %74 = OpLoad %v2float %72 None
-         %75 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_1
-         %76 = OpLoad %v2float %75 None
-         %77 = OpCompositeConstruct %mat2v2float %74 %76
-         %78 = OpFunctionCall %float %b %77
-         %79 = OpFAdd %float %71 %78
-         %80 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
-         %81 = OpLoad %v2float %80 None
-         %82 = OpVectorShuffle %v2float %81 %81 1 0
-         %83 = OpFunctionCall %float %c %82
-         %84 = OpFAdd %float %79 %83
-         %85 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
-         %86 = OpLoad %v2float %85 None
-         %87 = OpVectorShuffle %v2float %86 %86 1 0
-         %88 = OpCompositeExtract %float %87 0
-         %89 = OpFunctionCall %float %d %88
-         %90 = OpFAdd %float %84 %89
-         %91 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %91 %90 None
+         %57 = OpLoad %_arr_mat2v2float_uint_4 %47 None
+         %58 = OpFunctionCall %float %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v2float %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v2float %63 None
+         %65 = OpCompositeConstruct %mat2v2float %62 %64
+         %66 = OpFunctionCall %float %b %65
+         %67 = OpFAdd %float %58 %66
+         %68 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
+         %69 = OpLoad %v2float %68 None
+         %70 = OpVectorShuffle %v2float %69 %69 1 0
+         %71 = OpFunctionCall %float %c %70
+         %72 = OpFAdd %float %67 %71
+         %73 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
+         %74 = OpLoad %v2float %73 None
+         %75 = OpVectorShuffle %v2float %74 %74 1 0
+         %76 = OpCompositeExtract %float %75 0
+         %77 = OpFunctionCall %float %d %76
+         %78 = OpFAdd %float %72 %77
+         %79 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %79 %78 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x2_f32_std140_uint_4_0 None %94
@@ -168,21 +168,21 @@
                OpLoopMerge %104 %102 None
                OpBranch %101
         %101 = OpLabel
-        %107 = OpUGreaterThanEqual %bool %105 %uint_4
-               OpSelectionMerge %108 None
-               OpBranchConditional %107 %109 %108
-        %109 = OpLabel
+        %108 = OpUGreaterThanEqual %bool %105 %uint_4
+               OpSelectionMerge %109 None
+               OpBranchConditional %108 %110 %109
+        %110 = OpLabel
                OpBranch %104
-        %108 = OpLabel
-        %110 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %96 %105
-        %111 = OpLoad %mat2x2_f32_std140 %110 None
-        %112 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %98 %105
-               OpStore %112 %111 None
+        %109 = OpLabel
+        %111 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %96 %105
+        %112 = OpLoad %mat2x2_f32_std140 %111 None
+        %113 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %98 %105
+               OpStore %113 %112 None
                OpBranch %102
         %102 = OpLabel
         %106 = OpIAdd %uint %105 %uint_1
                OpBranch %103
         %104 = OpLabel
-        %113 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %98 None
-               OpReturnValue %113
+        %107 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %98 None
+               OpReturnValue %107
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.spvasm
index 057acd6..551c6f9 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.spvasm
@@ -55,17 +55,17 @@
 %_arr_mat2x2_f32_std140_uint_4_0 = OpTypeArray %mat2x2_f32_std140 %uint_4
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4_0
 %_ptr_Function__arr_mat2v2float_uint_4 = OpTypePointer Function %_arr_mat2v2float_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-%_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat2v2float = OpTypePointer Private %mat2v2float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_v2float = OpTypePointer Private %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Private_float = OpTypePointer Private %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
+%_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
          %81 = OpTypeFunction %_arr_mat2x2_f32_std140_uint_4_0 %_arr_mat2x2_f32_std140_uint_4
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4
          %86 = OpConstantNull %_arr_mat2x2_f32_std140_uint_4_0
@@ -85,49 +85,49 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %68 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %70 None
+               OpBranchConditional %68 %71 %70
+         %71 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat2v2float %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %29 %38
-         %48 = OpLoad %mat2x2_f32_std140 %46 None
-         %49 = OpCompositeExtract %v2float %48 0
-         %50 = OpCompositeExtract %v2float %48 1
-         %51 = OpCompositeConstruct %mat2v2float %49 %50
-               OpStore %44 %51 None
+         %70 = OpLabel
+         %72 = OpAccessChain %_ptr_Function_mat2v2float %31 %38
+         %74 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %29 %38
+         %76 = OpLoad %mat2x2_f32_std140 %74 None
+         %77 = OpCompositeExtract %v2float %76 0
+         %78 = OpCompositeExtract %v2float %76 1
+         %79 = OpCompositeConstruct %mat2v2float %77 %78
+               OpStore %72 %79 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %53 = OpLoad %_arr_mat2v2float_uint_4 %31 None
-               OpStore %p %53 None
-         %54 = OpAccessChain %_ptr_Private_mat2v2float %p %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
-         %59 = OpLoad %v2float %56 None
-         %60 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %61 = OpLoad %v2float %60 None
-         %62 = OpCompositeConstruct %mat2v2float %59 %61
-               OpStore %54 %62 None
+         %40 = OpLoad %_arr_mat2v2float_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat2v2float %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v2float %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v2float %48 None
+         %50 = OpCompositeConstruct %mat2v2float %47 %49
+               OpStore %41 %50 None
+         %51 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %54 = OpLoad %v2float %53 None
+         %55 = OpVectorShuffle %v2float %54 %54 1 0
+               OpStore %51 %55 None
+         %56 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
+         %57 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %58 = OpAccessChain %_ptr_Uniform_float %57 %uint_0
+         %60 = OpLoad %float %58 None
+         %61 = OpAccessChain %_ptr_Private_float %56 %uint_0
+               OpStore %61 %60 None
          %63 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
-         %65 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %66 = OpLoad %v2float %65 None
-         %67 = OpVectorShuffle %v2float %66 %66 1 0
-               OpStore %63 %67 None
-         %68 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
-         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %70 = OpAccessChain %_ptr_Uniform_float %69 %uint_0
-         %72 = OpLoad %float %70 None
-         %73 = OpAccessChain %_ptr_Private_float %68 %uint_0
-               OpStore %73 %72 None
-         %75 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Private_float %75 %uint_0
-         %77 = OpLoad %float %76 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %78 %77 None
+         %64 = OpAccessChain %_ptr_Private_float %63 %uint_0
+         %65 = OpLoad %float %64 None
+         %66 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %66 %65 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x2_f32_std140_uint_4_0 None %81
@@ -144,21 +144,21 @@
                OpLoopMerge %91 %89 None
                OpBranch %88
          %88 = OpLabel
-         %94 = OpUGreaterThanEqual %bool %92 %uint_4
-               OpSelectionMerge %95 None
-               OpBranchConditional %94 %96 %95
-         %96 = OpLabel
+         %95 = OpUGreaterThanEqual %bool %92 %uint_4
+               OpSelectionMerge %96 None
+               OpBranchConditional %95 %97 %96
+         %97 = OpLabel
                OpBranch %91
-         %95 = OpLabel
-         %97 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %83 %92
-         %98 = OpLoad %mat2x2_f32_std140 %97 None
-         %99 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %85 %92
-               OpStore %99 %98 None
+         %96 = OpLabel
+         %98 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %83 %92
+         %99 = OpLoad %mat2x2_f32_std140 %98 None
+        %100 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %85 %92
+               OpStore %100 %99 None
                OpBranch %89
          %89 = OpLabel
          %93 = OpIAdd %uint %92 %uint_1
                OpBranch %90
          %91 = OpLabel
-        %100 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %85 None
-               OpReturnValue %100
+         %94 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %85 None
+               OpReturnValue %94
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.spvasm
index b60352d..b19d40e 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.spvasm
@@ -58,17 +58,17 @@
 %_arr_mat2v2float_uint_4_0 = OpTypeArray %mat2v2float %uint_4
 %_ptr_Function__arr_mat2v2float_uint_4_0 = OpTypePointer Function %_arr_mat2v2float_uint_4_0
          %31 = OpConstantNull %_arr_mat2v2float_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-%_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_StorageBuffer__arr_mat2v2float_uint_4 = OpTypePointer StorageBuffer %_arr_mat2v2float_uint_4
 %_ptr_StorageBuffer_mat2v2float = OpTypePointer StorageBuffer %mat2v2float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
      %uint_2 = OpConstant %uint 2
 %_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
+%_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
          %79 = OpTypeFunction %_arr_mat2v2float_uint_4 %_arr_mat2v2float_uint_4_0
 %_ptr_Function__arr_mat2v2float_uint_4 = OpTypePointer Function %_arr_mat2v2float_uint_4
          %84 = OpConstantNull %_arr_mat2v2float_uint_4
@@ -91,46 +91,46 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %66 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %68 None
+               OpBranchConditional %66 %69 %68
+         %69 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat2v2float %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %26 %37
-         %47 = OpLoad %mat2x2_f32_std140 %45 None
-         %48 = OpCompositeExtract %v2float %47 0
-         %49 = OpCompositeExtract %v2float %47 1
-         %50 = OpCompositeConstruct %mat2v2float %48 %49
-               OpStore %43 %50 None
+         %68 = OpLabel
+         %70 = OpAccessChain %_ptr_Function_mat2v2float %28 %37
+         %72 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %26 %37
+         %74 = OpLoad %mat2x2_f32_std140 %72 None
+         %75 = OpCompositeExtract %v2float %74 0
+         %76 = OpCompositeExtract %v2float %74 1
+         %77 = OpCompositeConstruct %mat2v2float %75 %76
+               OpStore %70 %77 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %52 = OpLoad %_arr_mat2v2float_uint_4_0 %28 None
-         %53 = OpAccessChain %_ptr_StorageBuffer__arr_mat2v2float_uint_4 %10 %uint_0
-         %55 = OpFunctionCall %_arr_mat2v2float_uint_4 %tint_convert_explicit_layout %52
-               OpStore %53 %55 None
-         %57 = OpAccessChain %_ptr_StorageBuffer_mat2v2float %10 %uint_0 %uint_1
-         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
-         %62 = OpLoad %v2float %59 None
-         %63 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v2float %63 None
-         %65 = OpCompositeConstruct %mat2v2float %62 %64
-               OpStore %57 %65 None
-         %66 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
-         %68 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %69 = OpLoad %v2float %68 None
-         %70 = OpVectorShuffle %v2float %69 %69 1 0
-               OpStore %66 %70 None
-         %71 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_float %72 %uint_0
-         %75 = OpLoad %float %73 None
-         %76 = OpAccessChain %_ptr_StorageBuffer_float %71 %uint_0
-               OpStore %76 %75 None
+         %39 = OpLoad %_arr_mat2v2float_uint_4_0 %28 None
+         %40 = OpAccessChain %_ptr_StorageBuffer__arr_mat2v2float_uint_4 %10 %uint_0
+         %42 = OpFunctionCall %_arr_mat2v2float_uint_4 %tint_convert_explicit_layout %39
+               OpStore %40 %42 None
+         %44 = OpAccessChain %_ptr_StorageBuffer_mat2v2float %10 %uint_0 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
+         %50 = OpLoad %v2float %47 None
+         %51 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %v2float %51 None
+         %53 = OpCompositeConstruct %mat2v2float %50 %52
+               OpStore %44 %53 None
+         %54 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
+         %56 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %57 = OpLoad %v2float %56 None
+         %58 = OpVectorShuffle %v2float %57 %57 1 0
+               OpStore %54 %58 None
+         %59 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %61 = OpAccessChain %_ptr_Uniform_float %60 %uint_0
+         %63 = OpLoad %float %61 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_float %59 %uint_0
+               OpStore %64 %63 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2v2float_uint_4 None %79
@@ -147,23 +147,23 @@
                OpLoopMerge %89 %87 None
                OpBranch %86
          %86 = OpLabel
-         %92 = OpUGreaterThanEqual %bool %90 %uint_4
-               OpSelectionMerge %93 None
-               OpBranchConditional %92 %94 %93
-         %94 = OpLabel
+         %93 = OpUGreaterThanEqual %bool %90 %uint_4
+               OpSelectionMerge %94 None
+               OpBranchConditional %93 %95 %94
+         %95 = OpLabel
                OpBranch %89
-         %93 = OpLabel
-         %95 = OpAccessChain %_ptr_Function_mat2v2float %81 %90
-         %96 = OpLoad %mat2v2float %95 None
-         %97 = OpAccessChain %_ptr_Function_mat2v2float %82 %90
-               OpStore %97 %96 None
+         %94 = OpLabel
+         %96 = OpAccessChain %_ptr_Function_mat2v2float %81 %90
+         %97 = OpLoad %mat2v2float %96 None
+         %98 = OpAccessChain %_ptr_Function_mat2v2float %82 %90
+               OpStore %98 %97 None
                OpBranch %87
          %87 = OpLabel
          %91 = OpIAdd %uint %90 %uint_1
                OpBranch %88
          %89 = OpLabel
-         %98 = OpLoad %_arr_mat2v2float_uint_4 %82 None
-               OpReturnValue %98
+         %92 = OpLoad %_arr_mat2v2float_uint_4 %82 None
+               OpReturnValue %92
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat2x2_f32_std140_uint_4_0 None %100
 %tint_source_0 = OpFunctionParameter %_arr_mat2x2_f32_std140_uint_4
@@ -179,21 +179,21 @@
                OpLoopMerge %110 %108 None
                OpBranch %107
         %107 = OpLabel
-        %113 = OpUGreaterThanEqual %bool %111 %uint_4
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %114
-        %115 = OpLabel
+        %114 = OpUGreaterThanEqual %bool %111 %uint_4
+               OpSelectionMerge %115 None
+               OpBranchConditional %114 %116 %115
+        %116 = OpLabel
                OpBranch %110
-        %114 = OpLabel
-        %116 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %102 %111
-        %117 = OpLoad %mat2x2_f32_std140 %116 None
-        %118 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %104 %111
-               OpStore %118 %117 None
+        %115 = OpLabel
+        %117 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %102 %111
+        %118 = OpLoad %mat2x2_f32_std140 %117 None
+        %119 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %104 %111
+               OpStore %119 %118 None
                OpBranch %108
         %108 = OpLabel
         %112 = OpIAdd %uint %111 %uint_1
                OpBranch %109
         %110 = OpLabel
-        %119 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %104 None
-               OpReturnValue %119
+        %113 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %104 None
+               OpReturnValue %113
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
index 53da835f..a390396 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -45,10 +45,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat2v2float = OpTypePointer Workgroup %mat2v2float
-         %34 = OpConstantNull %mat2v2float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat2x2_f32_std140_uint_4 = OpTypePointer Uniform %_arr_mat2x2_f32_std140_uint_4
@@ -56,13 +52,17 @@
 %_arr_mat2x2_f32_std140_uint_4_0 = OpTypeArray %mat2x2_f32_std140 %uint_4
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4_0
 %_ptr_Function__arr_mat2v2float_uint_4 = OpTypePointer Function %_arr_mat2v2float_uint_4
-         %50 = OpConstantNull %_arr_mat2v2float_uint_4
-%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
-%_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
+         %42 = OpConstantNull %_arr_mat2v2float_uint_4
+%_ptr_Workgroup_mat2v2float = OpTypePointer Workgroup %mat2v2float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %77 = OpConstantNull %mat2v2float
+%_ptr_Function_mat2v2float = OpTypePointer Function %mat2v2float
+%_ptr_Function_mat2x2_f32_std140 = OpTypePointer Function %mat2x2_f32_std140
          %90 = OpTypeFunction %void
          %95 = OpTypeFunction %_arr_mat2x2_f32_std140_uint_4_0 %_arr_mat2x2_f32_std140_uint_4
 %_ptr_Function__arr_mat2x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x2_f32_std140_uint_4
@@ -70,8 +70,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat2x2_f32_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat2v2float_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat2x2_f32_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat2v2float_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -80,70 +80,70 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %72 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %74 None
+               OpBranchConditional %72 %75 %74
+         %75 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat2v2float %w %26
-               OpStore %32 %34 None
+         %74 = OpLabel
+         %76 = OpAccessChain %_ptr_Workgroup_mat2v2float %w %26
+               OpStore %76 %77 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat2x2_f32_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat2x2_f32_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat2x2_f32_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat2v2float %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %46 %56
-         %65 = OpLoad %mat2x2_f32_std140 %63 None
-         %66 = OpCompositeExtract %v2float %65 0
-         %67 = OpCompositeExtract %v2float %65 1
-         %68 = OpCompositeConstruct %mat2v2float %66 %67
-               OpStore %61 %68 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %69 = OpLoad %_arr_mat2v2float_uint_4 %48 None
-               OpStore %w %69 None
-         %70 = OpAccessChain %_ptr_Workgroup_mat2v2float %w %uint_1
-         %71 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
-         %73 = OpLoad %v2float %71 None
-         %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %75 = OpLoad %v2float %74 None
-         %76 = OpCompositeConstruct %mat2v2float %73 %75
-               OpStore %70 %76 None
-         %77 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %80 = OpLoad %v2float %79 None
-         %81 = OpVectorShuffle %v2float %80 %80 1 0
-               OpStore %77 %81 None
-         %82 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %84 = OpAccessChain %_ptr_Uniform_float %83 %uint_0
-         %86 = OpLoad %float %84 None
-         %87 = OpAccessChain %_ptr_Workgroup_float %82 %uint_0
-               OpStore %87 %86 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat2x2_f32_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat2x2_f32_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat2x2_f32_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %78 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %78 %80 %79
+         %80 = OpLabel
+               OpBranch %47
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Function_mat2v2float %40 %48
+         %83 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %38 %48
+         %85 = OpLoad %mat2x2_f32_std140 %83 None
+         %86 = OpCompositeExtract %v2float %85 0
+         %87 = OpCompositeExtract %v2float %85 1
+         %88 = OpCompositeConstruct %mat2v2float %86 %87
+               OpStore %81 %88 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat2v2float_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat2v2float %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v2float %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v2float %57 None
+         %59 = OpCompositeConstruct %mat2v2float %56 %58
+               OpStore %51 %59 None
+         %60 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %63 = OpLoad %v2float %62 None
+         %64 = OpVectorShuffle %v2float %63 %63 1 0
+               OpStore %60 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
+         %66 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %67 = OpAccessChain %_ptr_Uniform_float %66 %uint_0
+         %69 = OpLoad %float %67 None
+         %70 = OpAccessChain %_ptr_Workgroup_float %65 %uint_0
+               OpStore %70 %69 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %90
@@ -166,21 +166,21 @@
                OpLoopMerge %105 %103 None
                OpBranch %102
         %102 = OpLabel
-        %108 = OpUGreaterThanEqual %bool %106 %uint_4
-               OpSelectionMerge %109 None
-               OpBranchConditional %108 %110 %109
-        %110 = OpLabel
+        %109 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %110 None
+               OpBranchConditional %109 %111 %110
+        %111 = OpLabel
                OpBranch %105
-        %109 = OpLabel
-        %111 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %97 %106
-        %112 = OpLoad %mat2x2_f32_std140 %111 None
-        %113 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %99 %106
-               OpStore %113 %112 None
+        %110 = OpLabel
+        %112 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %97 %106
+        %113 = OpLoad %mat2x2_f32_std140 %112 None
+        %114 = OpAccessChain %_ptr_Function_mat2x2_f32_std140 %99 %106
+               OpStore %114 %113 None
                OpBranch %103
         %103 = OpLabel
         %107 = OpIAdd %uint %106 %uint_1
                OpBranch %104
         %105 = OpLabel
-        %114 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %99 None
-               OpReturnValue %114
+        %108 = OpLoad %_arr_mat2x2_f32_std140_uint_4_0 %99 None
+               OpReturnValue %108
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index da5b3ac..1a04df5 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -72,9 +72,9 @@
 %_arr_mat2v3half_uint_4 = OpTypeArray %mat2v3half %uint_4
 %_ptr_Function__arr_mat2v3half_uint_4 = OpTypePointer Function %_arr_mat2v3half_uint_4
          %61 = OpConstantNull %_arr_mat2v3half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %91 = OpTypeFunction %_arr_mat2x3_f16_std140_uint_4_0 %_arr_mat2x3_f16_std140_uint_4
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4
          %96 = OpConstantNull %_arr_mat2x3_f16_std140_uint_4_0
@@ -117,34 +117,34 @@
                OpLoopMerge %66 %64 None
                OpBranch %63
          %63 = OpLabel
-         %69 = OpUGreaterThanEqual %bool %67 %uint_4
-               OpSelectionMerge %71 None
-               OpBranchConditional %69 %72 %71
-         %72 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %67 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %66
-         %71 = OpLabel
-         %73 = OpAccessChain %_ptr_Function_mat2v3half %58 %67
-         %74 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %56 %67
-         %76 = OpLoad %mat2x3_f16_std140 %74 None
-         %77 = OpCompositeExtract %v3half %76 0
-         %78 = OpCompositeExtract %v3half %76 1
-         %79 = OpCompositeConstruct %mat2v3half %77 %78
-               OpStore %73 %79 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Function_mat2v3half %58 %67
+         %84 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %56 %67
+         %86 = OpLoad %mat2x3_f16_std140 %84 None
+         %87 = OpCompositeExtract %v3half %86 0
+         %88 = OpCompositeExtract %v3half %86 1
+         %89 = OpCompositeConstruct %mat2v3half %87 %88
+               OpStore %83 %89 None
                OpBranch %64
          %64 = OpLabel
          %68 = OpIAdd %uint %67 %uint_1
                OpBranch %65
          %66 = OpLabel
         %l_a = OpLoad %_arr_mat2v3half_uint_4 %58 None
-         %81 = OpCompositeExtract %half %l_a_i_i 0
-         %82 = OpCompositeExtract %half %l_a 0 0 0
-         %83 = OpFAdd %half %81 %82
-         %84 = OpCompositeExtract %half %l_a_i 0 0
-         %85 = OpFAdd %half %83 %84
-         %86 = OpCompositeExtract %half %l_a_i_i 0
-         %87 = OpFAdd %half %85 %86
-         %88 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %88 %87 None
+         %70 = OpCompositeExtract %half %l_a_i_i 0
+         %71 = OpCompositeExtract %half %l_a 0 0 0
+         %72 = OpFAdd %half %70 %71
+         %73 = OpCompositeExtract %half %l_a_i 0 0
+         %74 = OpFAdd %half %72 %73
+         %75 = OpCompositeExtract %half %l_a_i_i 0
+         %76 = OpFAdd %half %74 %75
+         %77 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %77 %76 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f16_std140_uint_4_0 None %91
@@ -161,21 +161,21 @@
                OpLoopMerge %101 %99 None
                OpBranch %98
          %98 = OpLabel
-        %104 = OpUGreaterThanEqual %bool %102 %uint_4
-               OpSelectionMerge %105 None
-               OpBranchConditional %104 %106 %105
-        %106 = OpLabel
+        %105 = OpUGreaterThanEqual %bool %102 %uint_4
+               OpSelectionMerge %106 None
+               OpBranchConditional %105 %107 %106
+        %107 = OpLabel
                OpBranch %101
-        %105 = OpLabel
-        %107 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %93 %102
-        %108 = OpLoad %mat2x3_f16_std140 %107 None
-        %109 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %95 %102
-               OpStore %109 %108 None
+        %106 = OpLabel
+        %108 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %93 %102
+        %109 = OpLoad %mat2x3_f16_std140 %108 None
+        %110 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %95 %102
+               OpStore %110 %109 None
                OpBranch %99
          %99 = OpLabel
         %103 = OpIAdd %uint %102 %uint_1
                OpBranch %100
         %101 = OpLabel
-        %110 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %95 None
-               OpReturnValue %110
+        %104 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %95 None
+               OpReturnValue %104
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm
index 4a6d13e..d83bb71 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -61,10 +61,10 @@
 %_arr_mat2v3half_uint_4 = OpTypeArray %mat2v3half %uint_4
 %_ptr_Function__arr_mat2v3half_uint_4 = OpTypePointer Function %_arr_mat2v3half_uint_4
          %39 = OpConstantNull %_arr_mat2v3half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
 %_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %70 = OpTypeFunction %_arr_mat2x3_f16_std140_uint_4_0 %_arr_mat2x3_f16_std140_uint_4
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4
          %75 = OpConstantNull %_arr_mat2x3_f16_std140_uint_4_0
@@ -90,34 +90,34 @@
                OpLoopMerge %44 %42 None
                OpBranch %41
          %41 = OpLabel
-         %47 = OpUGreaterThanEqual %bool %45 %uint_4
-               OpSelectionMerge %49 None
-               OpBranchConditional %47 %50 %49
-         %50 = OpLabel
+         %57 = OpUGreaterThanEqual %bool %45 %uint_4
+               OpSelectionMerge %59 None
+               OpBranchConditional %57 %60 %59
+         %60 = OpLabel
                OpBranch %44
-         %49 = OpLabel
-         %51 = OpAccessChain %_ptr_Function_mat2v3half %36 %45
-         %53 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %34 %45
-         %55 = OpLoad %mat2x3_f16_std140 %53 None
-         %56 = OpCompositeExtract %v3half %55 0
-         %57 = OpCompositeExtract %v3half %55 1
-         %58 = OpCompositeConstruct %mat2v3half %56 %57
-               OpStore %51 %58 None
+         %59 = OpLabel
+         %61 = OpAccessChain %_ptr_Function_mat2v3half %36 %45
+         %63 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %34 %45
+         %65 = OpLoad %mat2x3_f16_std140 %63 None
+         %66 = OpCompositeExtract %v3half %65 0
+         %67 = OpCompositeExtract %v3half %65 1
+         %68 = OpCompositeConstruct %mat2v3half %66 %67
+               OpStore %61 %68 None
                OpBranch %42
          %42 = OpLabel
          %46 = OpIAdd %uint %45 %uint_1
                OpBranch %43
          %44 = OpLabel
         %l_a = OpLoad %_arr_mat2v3half_uint_4 %36 None
-         %60 = OpCompositeExtract %half %l_a_i_i 0
-         %61 = OpCompositeExtract %half %l_a 0 0 0
-         %62 = OpFAdd %half %60 %61
-         %63 = OpCompositeExtract %half %l_a_i 0 0
-         %64 = OpFAdd %half %62 %63
-         %65 = OpCompositeExtract %half %l_a_i_i 0
-         %66 = OpFAdd %half %64 %65
-         %67 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %67 %66 None
+         %48 = OpCompositeExtract %half %l_a_i_i 0
+         %49 = OpCompositeExtract %half %l_a 0 0 0
+         %50 = OpFAdd %half %48 %49
+         %51 = OpCompositeExtract %half %l_a_i 0 0
+         %52 = OpFAdd %half %50 %51
+         %53 = OpCompositeExtract %half %l_a_i_i 0
+         %54 = OpFAdd %half %52 %53
+         %55 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %55 %54 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f16_std140_uint_4_0 None %70
@@ -134,21 +134,21 @@
                OpLoopMerge %80 %78 None
                OpBranch %77
          %77 = OpLabel
-         %83 = OpUGreaterThanEqual %bool %81 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %83 %85 %84
-         %85 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %84 %86 %85
+         %86 = OpLabel
                OpBranch %80
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %72 %81
-         %87 = OpLoad %mat2x3_f16_std140 %86 None
-         %88 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %74 %81
-               OpStore %88 %87 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %72 %81
+         %88 = OpLoad %mat2x3_f16_std140 %87 None
+         %89 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %74 %81
+               OpStore %89 %88 None
                OpBranch %78
          %78 = OpLabel
          %82 = OpIAdd %uint %81 %uint_1
                OpBranch %79
          %80 = OpLabel
-         %89 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %74 None
-               OpReturnValue %89
+         %83 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %74 None
+               OpReturnValue %83
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.spvasm
index aaeb265..446e373 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.spvasm
@@ -67,12 +67,12 @@
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4_0
 %_ptr_Function__arr_mat2v3half_uint_4 = OpTypePointer Function %_arr_mat2v3half_uint_4
          %49 = OpConstantNull %_arr_mat2v3half_uint_4
+%_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
+     %uint_1 = OpConstant %uint 1
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
 %_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
-     %uint_1 = OpConstant %uint 1
-%_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %94 = OpTypeFunction %_arr_mat2x3_f16_std140_uint_4_0 %_arr_mat2x3_f16_std140_uint_4
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4
          %99 = OpConstantNull %_arr_mat2x3_f16_std140_uint_4_0
@@ -115,46 +115,46 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %83 None
+               OpBranchConditional %81 %84 %83
+         %84 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat2v3half %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %45 %55
-         %65 = OpLoad %mat2x3_f16_std140 %63 None
-         %66 = OpCompositeExtract %v3half %65 0
-         %67 = OpCompositeExtract %v3half %65 1
-         %68 = OpCompositeConstruct %mat2v3half %66 %67
-               OpStore %61 %68 None
+         %83 = OpLabel
+         %85 = OpAccessChain %_ptr_Function_mat2v3half %47 %55
+         %87 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %45 %55
+         %89 = OpLoad %mat2x3_f16_std140 %87 None
+         %90 = OpCompositeExtract %v3half %89 0
+         %91 = OpCompositeExtract %v3half %89 1
+         %92 = OpCompositeConstruct %mat2v3half %90 %91
+               OpStore %85 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %70 = OpLoad %_arr_mat2v3half_uint_4 %47 None
-         %71 = OpFunctionCall %half %a %70
-         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
-         %74 = OpLoad %v3half %72 None
-         %75 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_1
-         %76 = OpLoad %v3half %75 None
-         %77 = OpCompositeConstruct %mat2v3half %74 %76
-         %78 = OpFunctionCall %half %b %77
-         %79 = OpFAdd %half %71 %78
-         %80 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
-         %81 = OpLoad %v3half %80 None
-         %82 = OpVectorShuffle %v3half %81 %81 2 0 1
-         %83 = OpFunctionCall %half %c %82
-         %84 = OpFAdd %half %79 %83
-         %85 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
-         %86 = OpLoad %v3half %85 None
-         %87 = OpVectorShuffle %v3half %86 %86 2 0 1
-         %88 = OpCompositeExtract %half %87 0
-         %89 = OpFunctionCall %half %d %88
-         %90 = OpFAdd %half %84 %89
-         %91 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %91 %90 None
+         %57 = OpLoad %_arr_mat2v3half_uint_4 %47 None
+         %58 = OpFunctionCall %half %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v3half %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v3half %63 None
+         %65 = OpCompositeConstruct %mat2v3half %62 %64
+         %66 = OpFunctionCall %half %b %65
+         %67 = OpFAdd %half %58 %66
+         %68 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
+         %69 = OpLoad %v3half %68 None
+         %70 = OpVectorShuffle %v3half %69 %69 2 0 1
+         %71 = OpFunctionCall %half %c %70
+         %72 = OpFAdd %half %67 %71
+         %73 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
+         %74 = OpLoad %v3half %73 None
+         %75 = OpVectorShuffle %v3half %74 %74 2 0 1
+         %76 = OpCompositeExtract %half %75 0
+         %77 = OpFunctionCall %half %d %76
+         %78 = OpFAdd %half %72 %77
+         %79 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %79 %78 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f16_std140_uint_4_0 None %94
@@ -171,21 +171,21 @@
                OpLoopMerge %104 %102 None
                OpBranch %101
         %101 = OpLabel
-        %107 = OpUGreaterThanEqual %bool %105 %uint_4
-               OpSelectionMerge %108 None
-               OpBranchConditional %107 %109 %108
-        %109 = OpLabel
+        %108 = OpUGreaterThanEqual %bool %105 %uint_4
+               OpSelectionMerge %109 None
+               OpBranchConditional %108 %110 %109
+        %110 = OpLabel
                OpBranch %104
-        %108 = OpLabel
-        %110 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %96 %105
-        %111 = OpLoad %mat2x3_f16_std140 %110 None
-        %112 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %98 %105
-               OpStore %112 %111 None
+        %109 = OpLabel
+        %111 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %96 %105
+        %112 = OpLoad %mat2x3_f16_std140 %111 None
+        %113 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %98 %105
+               OpStore %113 %112 None
                OpBranch %102
         %102 = OpLabel
         %106 = OpIAdd %uint %105 %uint_1
                OpBranch %103
         %104 = OpLabel
-        %113 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %98 None
-               OpReturnValue %113
+        %107 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %98 None
+               OpReturnValue %107
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.spvasm
index 04c45ca..e7255e5 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.spvasm
@@ -58,17 +58,17 @@
 %_arr_mat2x3_f16_std140_uint_4_0 = OpTypeArray %mat2x3_f16_std140 %uint_4
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4_0
 %_ptr_Function__arr_mat2v3half_uint_4 = OpTypePointer Function %_arr_mat2v3half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
-%_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat2v3half = OpTypePointer Private %mat2v3half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_v3half = OpTypePointer Private %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Private_half = OpTypePointer Private %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
+%_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
          %81 = OpTypeFunction %_arr_mat2x3_f16_std140_uint_4_0 %_arr_mat2x3_f16_std140_uint_4
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4
          %86 = OpConstantNull %_arr_mat2x3_f16_std140_uint_4_0
@@ -88,49 +88,49 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %68 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %70 None
+               OpBranchConditional %68 %71 %70
+         %71 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat2v3half %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %29 %38
-         %48 = OpLoad %mat2x3_f16_std140 %46 None
-         %49 = OpCompositeExtract %v3half %48 0
-         %50 = OpCompositeExtract %v3half %48 1
-         %51 = OpCompositeConstruct %mat2v3half %49 %50
-               OpStore %44 %51 None
+         %70 = OpLabel
+         %72 = OpAccessChain %_ptr_Function_mat2v3half %31 %38
+         %74 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %29 %38
+         %76 = OpLoad %mat2x3_f16_std140 %74 None
+         %77 = OpCompositeExtract %v3half %76 0
+         %78 = OpCompositeExtract %v3half %76 1
+         %79 = OpCompositeConstruct %mat2v3half %77 %78
+               OpStore %72 %79 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %53 = OpLoad %_arr_mat2v3half_uint_4 %31 None
-               OpStore %p %53 None
-         %54 = OpAccessChain %_ptr_Private_mat2v3half %p %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
-         %59 = OpLoad %v3half %56 None
-         %60 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %61 = OpLoad %v3half %60 None
-         %62 = OpCompositeConstruct %mat2v3half %59 %61
-               OpStore %54 %62 None
+         %40 = OpLoad %_arr_mat2v3half_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat2v3half %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v3half %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v3half %48 None
+         %50 = OpCompositeConstruct %mat2v3half %47 %49
+               OpStore %41 %50 None
+         %51 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %54 = OpLoad %v3half %53 None
+         %55 = OpVectorShuffle %v3half %54 %54 2 0 1
+               OpStore %51 %55 None
+         %56 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
+         %57 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %58 = OpAccessChain %_ptr_Uniform_half %57 %uint_0
+         %60 = OpLoad %half %58 None
+         %61 = OpAccessChain %_ptr_Private_half %56 %uint_0
+               OpStore %61 %60 None
          %63 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
-         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %66 = OpLoad %v3half %65 None
-         %67 = OpVectorShuffle %v3half %66 %66 2 0 1
-               OpStore %63 %67 None
-         %68 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
-         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %70 = OpAccessChain %_ptr_Uniform_half %69 %uint_0
-         %72 = OpLoad %half %70 None
-         %73 = OpAccessChain %_ptr_Private_half %68 %uint_0
-               OpStore %73 %72 None
-         %75 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Private_half %75 %uint_0
-         %77 = OpLoad %half %76 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %78 %77 None
+         %64 = OpAccessChain %_ptr_Private_half %63 %uint_0
+         %65 = OpLoad %half %64 None
+         %66 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %66 %65 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f16_std140_uint_4_0 None %81
@@ -147,21 +147,21 @@
                OpLoopMerge %91 %89 None
                OpBranch %88
          %88 = OpLabel
-         %94 = OpUGreaterThanEqual %bool %92 %uint_4
-               OpSelectionMerge %95 None
-               OpBranchConditional %94 %96 %95
-         %96 = OpLabel
+         %95 = OpUGreaterThanEqual %bool %92 %uint_4
+               OpSelectionMerge %96 None
+               OpBranchConditional %95 %97 %96
+         %97 = OpLabel
                OpBranch %91
-         %95 = OpLabel
-         %97 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %83 %92
-         %98 = OpLoad %mat2x3_f16_std140 %97 None
-         %99 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %85 %92
-               OpStore %99 %98 None
+         %96 = OpLabel
+         %98 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %83 %92
+         %99 = OpLoad %mat2x3_f16_std140 %98 None
+        %100 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %85 %92
+               OpStore %100 %99 None
                OpBranch %89
          %89 = OpLabel
          %93 = OpIAdd %uint %92 %uint_1
                OpBranch %90
          %91 = OpLabel
-        %100 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %85 None
-               OpReturnValue %100
+         %94 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %85 None
+               OpReturnValue %94
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.spvasm
index 0922e58..5a5479f 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.spvasm
@@ -64,16 +64,16 @@
 %_arr_mat2v3half_uint_4_0 = OpTypeArray %mat2v3half %uint_4
 %_ptr_Function__arr_mat2v3half_uint_4_0 = OpTypePointer Function %_arr_mat2v3half_uint_4_0
          %31 = OpConstantNull %_arr_mat2v3half_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
-%_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
+%_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
          %79 = OpTypeFunction %void %_arr_mat2v3half_uint_4_0
          %98 = OpTypeFunction %void %_arr_uint_uint_1 %mat2v3half
         %106 = OpTypeFunction %_arr_mat2x3_f16_std140_uint_4_0 %_arr_mat2x3_f16_std140_uint_4
@@ -95,44 +95,44 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %66 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %68 None
+               OpBranchConditional %66 %69 %68
+         %69 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat2v3half %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %26 %37
-         %47 = OpLoad %mat2x3_f16_std140 %45 None
-         %48 = OpCompositeExtract %v3half %47 0
-         %49 = OpCompositeExtract %v3half %47 1
-         %50 = OpCompositeConstruct %mat2v3half %48 %49
-               OpStore %43 %50 None
+         %68 = OpLabel
+         %70 = OpAccessChain %_ptr_Function_mat2v3half %28 %37
+         %72 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %26 %37
+         %74 = OpLoad %mat2x3_f16_std140 %72 None
+         %75 = OpCompositeExtract %v3half %74 0
+         %76 = OpCompositeExtract %v3half %74 1
+         %77 = OpCompositeConstruct %mat2v3half %75 %76
+               OpStore %70 %77 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %52 = OpLoad %_arr_mat2v3half_uint_4_0 %28 None
-         %53 = OpFunctionCall %void %tint_store_and_preserve_padding %52
-         %55 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
-         %58 = OpLoad %v3half %55 None
-         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %60 = OpLoad %v3half %59 None
-         %61 = OpCompositeConstruct %mat2v3half %58 %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
-         %68 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %69 = OpLoad %v3half %68 None
-         %70 = OpVectorShuffle %v3half %69 %69 2 0 1
-               OpStore %66 %70 None
-         %71 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_half %72 %uint_0
-         %75 = OpLoad %half %73 None
-         %76 = OpAccessChain %_ptr_StorageBuffer_half %71 %uint_0
-               OpStore %76 %75 None
+         %39 = OpLoad %_arr_mat2v3half_uint_4_0 %28 None
+         %40 = OpFunctionCall %void %tint_store_and_preserve_padding %39
+         %42 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
+         %45 = OpLoad %v3half %42 None
+         %46 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %48 = OpLoad %v3half %46 None
+         %49 = OpCompositeConstruct %mat2v3half %45 %48
+         %51 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %52 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %51 %49
+         %54 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
+         %56 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %57 = OpLoad %v3half %56 None
+         %58 = OpVectorShuffle %v3half %57 %57 2 0 1
+               OpStore %54 %58 None
+         %59 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %61 = OpAccessChain %_ptr_Uniform_half %60 %uint_0
+         %63 = OpLoad %half %61 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_half %59 %uint_0
+               OpStore %64 %63 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %79
@@ -192,21 +192,21 @@
                OpLoopMerge %116 %114 None
                OpBranch %113
         %113 = OpLabel
-        %119 = OpUGreaterThanEqual %bool %117 %uint_4
-               OpSelectionMerge %120 None
-               OpBranchConditional %119 %121 %120
-        %121 = OpLabel
+        %120 = OpUGreaterThanEqual %bool %117 %uint_4
+               OpSelectionMerge %121 None
+               OpBranchConditional %120 %122 %121
+        %122 = OpLabel
                OpBranch %116
-        %120 = OpLabel
-        %122 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %108 %117
-        %123 = OpLoad %mat2x3_f16_std140 %122 None
-        %124 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %110 %117
-               OpStore %124 %123 None
+        %121 = OpLabel
+        %123 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %108 %117
+        %124 = OpLoad %mat2x3_f16_std140 %123 None
+        %125 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %110 %117
+               OpStore %125 %124 None
                OpBranch %114
         %114 = OpLabel
         %118 = OpIAdd %uint %117 %uint_1
                OpBranch %115
         %116 = OpLabel
-        %125 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %110 None
-               OpReturnValue %125
+        %119 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %110 None
+               OpReturnValue %119
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
index 0df88f0..e118d97 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -58,10 +58,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %22 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat2v3half = OpTypePointer Workgroup %mat2v3half
-         %37 = OpConstantNull %mat2v3half
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat2x3_f16_std140_uint_4 = OpTypePointer Uniform %_arr_mat2x3_f16_std140_uint_4
@@ -69,14 +65,18 @@
 %_arr_mat2x3_f16_std140_uint_4_0 = OpTypeArray %mat2x3_f16_std140 %uint_4
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4_0
 %_ptr_Function__arr_mat2v3half_uint_4 = OpTypePointer Function %_arr_mat2v3half_uint_4
-         %53 = OpConstantNull %_arr_mat2v3half_uint_4
-%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
-%_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
+         %45 = OpConstantNull %_arr_mat2v3half_uint_4
+%_ptr_Workgroup_mat2v3half = OpTypePointer Workgroup %mat2v3half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+         %85 = OpConstantNull %mat2v3half
+%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
+%_ptr_Function_mat2x3_f16_std140 = OpTypePointer Function %mat2x3_f16_std140
          %98 = OpTypeFunction %void
         %103 = OpTypeFunction %_arr_mat2x3_f16_std140_uint_4_0 %_arr_mat2x3_f16_std140_uint_4
 %_ptr_Function__arr_mat2x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f16_std140_uint_4
@@ -84,8 +84,8 @@
     %f_inner = OpFunction %void None %22
 %tint_local_index = OpFunctionParameter %uint
          %23 = OpLabel
-         %49 = OpVariable %_ptr_Function__arr_mat2x3_f16_std140_uint_4_0 Function
-         %51 = OpVariable %_ptr_Function__arr_mat2v3half_uint_4 Function %53
+         %41 = OpVariable %_ptr_Function__arr_mat2x3_f16_std140_uint_4_0 Function
+         %43 = OpVariable %_ptr_Function__arr_mat2v3half_uint_4 Function %45
                OpBranch %24
          %24 = OpLabel
                OpBranch %27
@@ -94,75 +94,75 @@
                OpLoopMerge %28 %26 None
                OpBranch %25
          %25 = OpLabel
-         %31 = OpUGreaterThanEqual %bool %29 %uint_4
-               OpSelectionMerge %33 None
-               OpBranchConditional %31 %34 %33
-         %34 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %29 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %80 %83 %82
+         %83 = OpLabel
                OpBranch %28
-         %33 = OpLabel
-         %35 = OpAccessChain %_ptr_Workgroup_mat2v3half %w %29
-               OpStore %35 %37 None
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Workgroup_mat2v3half %w %29
+               OpStore %84 %85 None
                OpBranch %26
          %26 = OpLabel
          %30 = OpIAdd %uint %29 %uint_1
                OpBranch %27
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %42 = OpAccessChain %_ptr_Uniform__arr_mat2x3_f16_std140_uint_4 %1 %uint_0
-         %45 = OpLoad %_arr_mat2x3_f16_std140_uint_4 %42 None
-         %46 = OpFunctionCall %_arr_mat2x3_f16_std140_uint_4_0 %tint_convert_explicit_layout %45
-               OpStore %49 %46
-               OpBranch %54
-         %54 = OpLabel
-               OpBranch %57
-         %57 = OpLabel
-         %59 = OpPhi %uint %uint_0 %54 %60 %56
-               OpLoopMerge %58 %56 None
-               OpBranch %55
-         %55 = OpLabel
-         %61 = OpUGreaterThanEqual %bool %59 %uint_4
-               OpSelectionMerge %62 None
-               OpBranchConditional %61 %63 %62
-         %63 = OpLabel
-               OpBranch %58
-         %62 = OpLabel
-         %64 = OpAccessChain %_ptr_Function_mat2v3half %51 %59
-         %66 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %49 %59
-         %68 = OpLoad %mat2x3_f16_std140 %66 None
-         %69 = OpCompositeExtract %v3half %68 0
-         %70 = OpCompositeExtract %v3half %68 1
-         %71 = OpCompositeConstruct %mat2v3half %69 %70
-               OpStore %64 %71 None
-               OpBranch %56
-         %56 = OpLabel
-         %60 = OpIAdd %uint %59 %uint_1
-               OpBranch %57
-         %58 = OpLabel
-         %72 = OpLoad %_arr_mat2v3half_uint_4 %51 None
-               OpStore %w %72 None
-         %73 = OpAccessChain %_ptr_Workgroup_mat2v3half %w %uint_1
-         %74 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
-         %76 = OpLoad %v3half %74 None
-         %77 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %78 = OpLoad %v3half %77 None
-         %79 = OpCompositeConstruct %mat2v3half %76 %78
-               OpStore %73 %79 None
-         %80 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %83 = OpLoad %v3half %82 None
-         %84 = OpVectorShuffle %v3half %83 %83 2 0 1
-               OpStore %80 %84 None
-         %85 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
-         %86 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %87 = OpAccessChain %_ptr_Uniform_half %86 %uint_0
-         %89 = OpLoad %half %87 None
-         %90 = OpAccessChain %_ptr_Workgroup_half %85 %uint_0
-               OpStore %90 %89 None
-         %92 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
-         %93 = OpAccessChain %_ptr_Workgroup_half %92 %uint_0
-         %94 = OpLoad %half %93 None
-         %95 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %95 %94 None
+         %34 = OpAccessChain %_ptr_Uniform__arr_mat2x3_f16_std140_uint_4 %1 %uint_0
+         %37 = OpLoad %_arr_mat2x3_f16_std140_uint_4 %34 None
+         %38 = OpFunctionCall %_arr_mat2x3_f16_std140_uint_4_0 %tint_convert_explicit_layout %37
+               OpStore %41 %38
+               OpBranch %46
+         %46 = OpLabel
+               OpBranch %49
+         %49 = OpLabel
+         %51 = OpPhi %uint %uint_0 %46 %52 %48
+               OpLoopMerge %50 %48 None
+               OpBranch %47
+         %47 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %51 %uint_4
+               OpSelectionMerge %87 None
+               OpBranchConditional %86 %88 %87
+         %88 = OpLabel
+               OpBranch %50
+         %87 = OpLabel
+         %89 = OpAccessChain %_ptr_Function_mat2v3half %43 %51
+         %91 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %41 %51
+         %93 = OpLoad %mat2x3_f16_std140 %91 None
+         %94 = OpCompositeExtract %v3half %93 0
+         %95 = OpCompositeExtract %v3half %93 1
+         %96 = OpCompositeConstruct %mat2v3half %94 %95
+               OpStore %89 %96 None
+               OpBranch %48
+         %48 = OpLabel
+         %52 = OpIAdd %uint %51 %uint_1
+               OpBranch %49
+         %50 = OpLabel
+         %53 = OpLoad %_arr_mat2v3half_uint_4 %43 None
+               OpStore %w %53 None
+         %54 = OpAccessChain %_ptr_Workgroup_mat2v3half %w %uint_1
+         %57 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
+         %59 = OpLoad %v3half %57 None
+         %60 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v3half %60 None
+         %62 = OpCompositeConstruct %mat2v3half %59 %61
+               OpStore %54 %62 None
+         %63 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
+         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %66 = OpLoad %v3half %65 None
+         %67 = OpVectorShuffle %v3half %66 %66 2 0 1
+               OpStore %63 %67 None
+         %68 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %70 = OpAccessChain %_ptr_Uniform_half %69 %uint_0
+         %72 = OpLoad %half %70 None
+         %73 = OpAccessChain %_ptr_Workgroup_half %68 %uint_0
+               OpStore %73 %72 None
+         %75 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
+         %76 = OpAccessChain %_ptr_Workgroup_half %75 %uint_0
+         %77 = OpLoad %half %76 None
+         %78 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %78 %77 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %98
@@ -185,21 +185,21 @@
                OpLoopMerge %113 %111 None
                OpBranch %110
         %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
+        %117 = OpUGreaterThanEqual %bool %114 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %117 %119 %118
+        %119 = OpLabel
                OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %105 %114
-        %120 = OpLoad %mat2x3_f16_std140 %119 None
-        %121 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %107 %114
-               OpStore %121 %120 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %105 %114
+        %121 = OpLoad %mat2x3_f16_std140 %120 None
+        %122 = OpAccessChain %_ptr_Function_mat2x3_f16_std140 %107 %114
+               OpStore %122 %121 None
                OpBranch %111
         %111 = OpLabel
         %115 = OpIAdd %uint %114 %uint_1
                OpBranch %112
         %113 = OpLabel
-        %122 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %107 None
-               OpReturnValue %122
+        %116 = OpLoad %_arr_mat2x3_f16_std140_uint_4_0 %107 None
+               OpReturnValue %116
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index ec57429..805dc2f 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -69,9 +69,9 @@
 %_arr_mat2v3float_uint_4 = OpTypeArray %mat2v3float %uint_4
 %_ptr_Function__arr_mat2v3float_uint_4 = OpTypePointer Function %_arr_mat2v3float_uint_4
          %61 = OpConstantNull %_arr_mat2v3float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %91 = OpTypeFunction %_arr_mat2x3_f32_std140_uint_4_0 %_arr_mat2x3_f32_std140_uint_4
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4
          %96 = OpConstantNull %_arr_mat2x3_f32_std140_uint_4_0
@@ -114,34 +114,34 @@
                OpLoopMerge %66 %64 None
                OpBranch %63
          %63 = OpLabel
-         %69 = OpUGreaterThanEqual %bool %67 %uint_4
-               OpSelectionMerge %71 None
-               OpBranchConditional %69 %72 %71
-         %72 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %67 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %66
-         %71 = OpLabel
-         %73 = OpAccessChain %_ptr_Function_mat2v3float %58 %67
-         %74 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %56 %67
-         %76 = OpLoad %mat2x3_f32_std140 %74 None
-         %77 = OpCompositeExtract %v3float %76 0
-         %78 = OpCompositeExtract %v3float %76 1
-         %79 = OpCompositeConstruct %mat2v3float %77 %78
-               OpStore %73 %79 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Function_mat2v3float %58 %67
+         %84 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %56 %67
+         %86 = OpLoad %mat2x3_f32_std140 %84 None
+         %87 = OpCompositeExtract %v3float %86 0
+         %88 = OpCompositeExtract %v3float %86 1
+         %89 = OpCompositeConstruct %mat2v3float %87 %88
+               OpStore %83 %89 None
                OpBranch %64
          %64 = OpLabel
          %68 = OpIAdd %uint %67 %uint_1
                OpBranch %65
          %66 = OpLabel
         %l_a = OpLoad %_arr_mat2v3float_uint_4 %58 None
-         %81 = OpCompositeExtract %float %l_a_i_i 0
-         %82 = OpCompositeExtract %float %l_a 0 0 0
-         %83 = OpFAdd %float %81 %82
-         %84 = OpCompositeExtract %float %l_a_i 0 0
-         %85 = OpFAdd %float %83 %84
-         %86 = OpCompositeExtract %float %l_a_i_i 0
-         %87 = OpFAdd %float %85 %86
-         %88 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %88 %87 None
+         %70 = OpCompositeExtract %float %l_a_i_i 0
+         %71 = OpCompositeExtract %float %l_a 0 0 0
+         %72 = OpFAdd %float %70 %71
+         %73 = OpCompositeExtract %float %l_a_i 0 0
+         %74 = OpFAdd %float %72 %73
+         %75 = OpCompositeExtract %float %l_a_i_i 0
+         %76 = OpFAdd %float %74 %75
+         %77 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %77 %76 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f32_std140_uint_4_0 None %91
@@ -158,21 +158,21 @@
                OpLoopMerge %101 %99 None
                OpBranch %98
          %98 = OpLabel
-        %104 = OpUGreaterThanEqual %bool %102 %uint_4
-               OpSelectionMerge %105 None
-               OpBranchConditional %104 %106 %105
-        %106 = OpLabel
+        %105 = OpUGreaterThanEqual %bool %102 %uint_4
+               OpSelectionMerge %106 None
+               OpBranchConditional %105 %107 %106
+        %107 = OpLabel
                OpBranch %101
-        %105 = OpLabel
-        %107 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %93 %102
-        %108 = OpLoad %mat2x3_f32_std140 %107 None
-        %109 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %95 %102
-               OpStore %109 %108 None
+        %106 = OpLabel
+        %108 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %93 %102
+        %109 = OpLoad %mat2x3_f32_std140 %108 None
+        %110 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %95 %102
+               OpStore %110 %109 None
                OpBranch %99
          %99 = OpLabel
         %103 = OpIAdd %uint %102 %uint_1
                OpBranch %100
         %101 = OpLabel
-        %110 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %95 None
-               OpReturnValue %110
+        %104 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %95 None
+               OpReturnValue %104
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm
index 6016eeb..202c5c2 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -58,10 +58,10 @@
 %_arr_mat2v3float_uint_4 = OpTypeArray %mat2v3float %uint_4
 %_ptr_Function__arr_mat2v3float_uint_4 = OpTypePointer Function %_arr_mat2v3float_uint_4
          %39 = OpConstantNull %_arr_mat2v3float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
 %_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %70 = OpTypeFunction %_arr_mat2x3_f32_std140_uint_4_0 %_arr_mat2x3_f32_std140_uint_4
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4
          %75 = OpConstantNull %_arr_mat2x3_f32_std140_uint_4_0
@@ -87,34 +87,34 @@
                OpLoopMerge %44 %42 None
                OpBranch %41
          %41 = OpLabel
-         %47 = OpUGreaterThanEqual %bool %45 %uint_4
-               OpSelectionMerge %49 None
-               OpBranchConditional %47 %50 %49
-         %50 = OpLabel
+         %57 = OpUGreaterThanEqual %bool %45 %uint_4
+               OpSelectionMerge %59 None
+               OpBranchConditional %57 %60 %59
+         %60 = OpLabel
                OpBranch %44
-         %49 = OpLabel
-         %51 = OpAccessChain %_ptr_Function_mat2v3float %36 %45
-         %53 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %34 %45
-         %55 = OpLoad %mat2x3_f32_std140 %53 None
-         %56 = OpCompositeExtract %v3float %55 0
-         %57 = OpCompositeExtract %v3float %55 1
-         %58 = OpCompositeConstruct %mat2v3float %56 %57
-               OpStore %51 %58 None
+         %59 = OpLabel
+         %61 = OpAccessChain %_ptr_Function_mat2v3float %36 %45
+         %63 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %34 %45
+         %65 = OpLoad %mat2x3_f32_std140 %63 None
+         %66 = OpCompositeExtract %v3float %65 0
+         %67 = OpCompositeExtract %v3float %65 1
+         %68 = OpCompositeConstruct %mat2v3float %66 %67
+               OpStore %61 %68 None
                OpBranch %42
          %42 = OpLabel
          %46 = OpIAdd %uint %45 %uint_1
                OpBranch %43
          %44 = OpLabel
         %l_a = OpLoad %_arr_mat2v3float_uint_4 %36 None
-         %60 = OpCompositeExtract %float %l_a_i_i 0
-         %61 = OpCompositeExtract %float %l_a 0 0 0
-         %62 = OpFAdd %float %60 %61
-         %63 = OpCompositeExtract %float %l_a_i 0 0
-         %64 = OpFAdd %float %62 %63
-         %65 = OpCompositeExtract %float %l_a_i_i 0
-         %66 = OpFAdd %float %64 %65
-         %67 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %67 %66 None
+         %48 = OpCompositeExtract %float %l_a_i_i 0
+         %49 = OpCompositeExtract %float %l_a 0 0 0
+         %50 = OpFAdd %float %48 %49
+         %51 = OpCompositeExtract %float %l_a_i 0 0
+         %52 = OpFAdd %float %50 %51
+         %53 = OpCompositeExtract %float %l_a_i_i 0
+         %54 = OpFAdd %float %52 %53
+         %55 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %55 %54 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f32_std140_uint_4_0 None %70
@@ -131,21 +131,21 @@
                OpLoopMerge %80 %78 None
                OpBranch %77
          %77 = OpLabel
-         %83 = OpUGreaterThanEqual %bool %81 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %83 %85 %84
-         %85 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %84 %86 %85
+         %86 = OpLabel
                OpBranch %80
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %72 %81
-         %87 = OpLoad %mat2x3_f32_std140 %86 None
-         %88 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %74 %81
-               OpStore %88 %87 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %72 %81
+         %88 = OpLoad %mat2x3_f32_std140 %87 None
+         %89 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %74 %81
+               OpStore %89 %88 None
                OpBranch %78
          %78 = OpLabel
          %82 = OpIAdd %uint %81 %uint_1
                OpBranch %79
          %80 = OpLabel
-         %89 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %74 None
-               OpReturnValue %89
+         %83 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %74 None
+               OpReturnValue %83
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.spvasm
index e28fa6c..5de8d09 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.spvasm
@@ -64,12 +64,12 @@
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat2v3float_uint_4 = OpTypePointer Function %_arr_mat2v3float_uint_4
          %49 = OpConstantNull %_arr_mat2v3float_uint_4
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+     %uint_1 = OpConstant %uint 1
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
 %_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
-     %uint_1 = OpConstant %uint 1
-%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %94 = OpTypeFunction %_arr_mat2x3_f32_std140_uint_4_0 %_arr_mat2x3_f32_std140_uint_4
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4
          %99 = OpConstantNull %_arr_mat2x3_f32_std140_uint_4_0
@@ -112,46 +112,46 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %83 None
+               OpBranchConditional %81 %84 %83
+         %84 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat2v3float %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %45 %55
-         %65 = OpLoad %mat2x3_f32_std140 %63 None
-         %66 = OpCompositeExtract %v3float %65 0
-         %67 = OpCompositeExtract %v3float %65 1
-         %68 = OpCompositeConstruct %mat2v3float %66 %67
-               OpStore %61 %68 None
+         %83 = OpLabel
+         %85 = OpAccessChain %_ptr_Function_mat2v3float %47 %55
+         %87 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %45 %55
+         %89 = OpLoad %mat2x3_f32_std140 %87 None
+         %90 = OpCompositeExtract %v3float %89 0
+         %91 = OpCompositeExtract %v3float %89 1
+         %92 = OpCompositeConstruct %mat2v3float %90 %91
+               OpStore %85 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %70 = OpLoad %_arr_mat2v3float_uint_4 %47 None
-         %71 = OpFunctionCall %float %a %70
-         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %74 = OpLoad %v3float %72 None
-         %75 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_1
-         %76 = OpLoad %v3float %75 None
-         %77 = OpCompositeConstruct %mat2v3float %74 %76
-         %78 = OpFunctionCall %float %b %77
-         %79 = OpFAdd %float %71 %78
-         %80 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %81 = OpLoad %v3float %80 None
-         %82 = OpVectorShuffle %v3float %81 %81 2 0 1
-         %83 = OpFunctionCall %float %c %82
-         %84 = OpFAdd %float %79 %83
-         %85 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %86 = OpLoad %v3float %85 None
-         %87 = OpVectorShuffle %v3float %86 %86 2 0 1
-         %88 = OpCompositeExtract %float %87 0
-         %89 = OpFunctionCall %float %d %88
-         %90 = OpFAdd %float %84 %89
-         %91 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %91 %90 None
+         %57 = OpLoad %_arr_mat2v3float_uint_4 %47 None
+         %58 = OpFunctionCall %float %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v3float %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v3float %63 None
+         %65 = OpCompositeConstruct %mat2v3float %62 %64
+         %66 = OpFunctionCall %float %b %65
+         %67 = OpFAdd %float %58 %66
+         %68 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
+         %69 = OpLoad %v3float %68 None
+         %70 = OpVectorShuffle %v3float %69 %69 2 0 1
+         %71 = OpFunctionCall %float %c %70
+         %72 = OpFAdd %float %67 %71
+         %73 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
+         %74 = OpLoad %v3float %73 None
+         %75 = OpVectorShuffle %v3float %74 %74 2 0 1
+         %76 = OpCompositeExtract %float %75 0
+         %77 = OpFunctionCall %float %d %76
+         %78 = OpFAdd %float %72 %77
+         %79 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %79 %78 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f32_std140_uint_4_0 None %94
@@ -168,21 +168,21 @@
                OpLoopMerge %104 %102 None
                OpBranch %101
         %101 = OpLabel
-        %107 = OpUGreaterThanEqual %bool %105 %uint_4
-               OpSelectionMerge %108 None
-               OpBranchConditional %107 %109 %108
-        %109 = OpLabel
+        %108 = OpUGreaterThanEqual %bool %105 %uint_4
+               OpSelectionMerge %109 None
+               OpBranchConditional %108 %110 %109
+        %110 = OpLabel
                OpBranch %104
-        %108 = OpLabel
-        %110 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %96 %105
-        %111 = OpLoad %mat2x3_f32_std140 %110 None
-        %112 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %98 %105
-               OpStore %112 %111 None
+        %109 = OpLabel
+        %111 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %96 %105
+        %112 = OpLoad %mat2x3_f32_std140 %111 None
+        %113 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %98 %105
+               OpStore %113 %112 None
                OpBranch %102
         %102 = OpLabel
         %106 = OpIAdd %uint %105 %uint_1
                OpBranch %103
         %104 = OpLabel
-        %113 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %98 None
-               OpReturnValue %113
+        %107 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %98 None
+               OpReturnValue %107
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.spvasm
index d3574c1..0b03976 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.spvasm
@@ -55,17 +55,17 @@
 %_arr_mat2x3_f32_std140_uint_4_0 = OpTypeArray %mat2x3_f32_std140 %uint_4
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat2v3float_uint_4 = OpTypePointer Function %_arr_mat2v3float_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
-%_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat2v3float = OpTypePointer Private %mat2v3float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_v3float = OpTypePointer Private %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Private_float = OpTypePointer Private %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
+%_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
          %81 = OpTypeFunction %_arr_mat2x3_f32_std140_uint_4_0 %_arr_mat2x3_f32_std140_uint_4
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4
          %86 = OpConstantNull %_arr_mat2x3_f32_std140_uint_4_0
@@ -85,49 +85,49 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %68 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %70 None
+               OpBranchConditional %68 %71 %70
+         %71 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat2v3float %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %29 %38
-         %48 = OpLoad %mat2x3_f32_std140 %46 None
-         %49 = OpCompositeExtract %v3float %48 0
-         %50 = OpCompositeExtract %v3float %48 1
-         %51 = OpCompositeConstruct %mat2v3float %49 %50
-               OpStore %44 %51 None
+         %70 = OpLabel
+         %72 = OpAccessChain %_ptr_Function_mat2v3float %31 %38
+         %74 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %29 %38
+         %76 = OpLoad %mat2x3_f32_std140 %74 None
+         %77 = OpCompositeExtract %v3float %76 0
+         %78 = OpCompositeExtract %v3float %76 1
+         %79 = OpCompositeConstruct %mat2v3float %77 %78
+               OpStore %72 %79 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %53 = OpLoad %_arr_mat2v3float_uint_4 %31 None
-               OpStore %p %53 None
-         %54 = OpAccessChain %_ptr_Private_mat2v3float %p %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %59 = OpLoad %v3float %56 None
-         %60 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %61 = OpLoad %v3float %60 None
-         %62 = OpCompositeConstruct %mat2v3float %59 %61
-               OpStore %54 %62 None
+         %40 = OpLoad %_arr_mat2v3float_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat2v3float %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v3float %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v3float %48 None
+         %50 = OpCompositeConstruct %mat2v3float %47 %49
+               OpStore %41 %50 None
+         %51 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %54 = OpLoad %v3float %53 None
+         %55 = OpVectorShuffle %v3float %54 %54 2 0 1
+               OpStore %51 %55 None
+         %56 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %58 = OpAccessChain %_ptr_Uniform_float %57 %uint_0
+         %60 = OpLoad %float %58 None
+         %61 = OpAccessChain %_ptr_Private_float %56 %uint_0
+               OpStore %61 %60 None
          %63 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %66 = OpLoad %v3float %65 None
-         %67 = OpVectorShuffle %v3float %66 %66 2 0 1
-               OpStore %63 %67 None
-         %68 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %69 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %70 = OpAccessChain %_ptr_Uniform_float %69 %uint_0
-         %72 = OpLoad %float %70 None
-         %73 = OpAccessChain %_ptr_Private_float %68 %uint_0
-               OpStore %73 %72 None
-         %75 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Private_float %75 %uint_0
-         %77 = OpLoad %float %76 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %78 %77 None
+         %64 = OpAccessChain %_ptr_Private_float %63 %uint_0
+         %65 = OpLoad %float %64 None
+         %66 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %66 %65 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x3_f32_std140_uint_4_0 None %81
@@ -144,21 +144,21 @@
                OpLoopMerge %91 %89 None
                OpBranch %88
          %88 = OpLabel
-         %94 = OpUGreaterThanEqual %bool %92 %uint_4
-               OpSelectionMerge %95 None
-               OpBranchConditional %94 %96 %95
-         %96 = OpLabel
+         %95 = OpUGreaterThanEqual %bool %92 %uint_4
+               OpSelectionMerge %96 None
+               OpBranchConditional %95 %97 %96
+         %97 = OpLabel
                OpBranch %91
-         %95 = OpLabel
-         %97 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %83 %92
-         %98 = OpLoad %mat2x3_f32_std140 %97 None
-         %99 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %85 %92
-               OpStore %99 %98 None
+         %96 = OpLabel
+         %98 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %83 %92
+         %99 = OpLoad %mat2x3_f32_std140 %98 None
+        %100 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %85 %92
+               OpStore %100 %99 None
                OpBranch %89
          %89 = OpLabel
          %93 = OpIAdd %uint %92 %uint_1
                OpBranch %90
          %91 = OpLabel
-        %100 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %85 None
-               OpReturnValue %100
+         %94 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %85 None
+               OpReturnValue %94
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.spvasm
index dec44c6..1e0f699 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.spvasm
@@ -61,16 +61,16 @@
 %_arr_mat2v3float_uint_4_0 = OpTypeArray %mat2v3float %uint_4
 %_ptr_Function__arr_mat2v3float_uint_4_0 = OpTypePointer Function %_arr_mat2v3float_uint_4_0
          %31 = OpConstantNull %_arr_mat2v3float_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
-%_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
+%_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
          %79 = OpTypeFunction %void %_arr_mat2v3float_uint_4_0
          %98 = OpTypeFunction %void %_arr_uint_uint_1 %mat2v3float
         %106 = OpTypeFunction %_arr_mat2x3_f32_std140_uint_4_0 %_arr_mat2x3_f32_std140_uint_4
@@ -92,44 +92,44 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %66 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %68 None
+               OpBranchConditional %66 %69 %68
+         %69 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat2v3float %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %26 %37
-         %47 = OpLoad %mat2x3_f32_std140 %45 None
-         %48 = OpCompositeExtract %v3float %47 0
-         %49 = OpCompositeExtract %v3float %47 1
-         %50 = OpCompositeConstruct %mat2v3float %48 %49
-               OpStore %43 %50 None
+         %68 = OpLabel
+         %70 = OpAccessChain %_ptr_Function_mat2v3float %28 %37
+         %72 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %26 %37
+         %74 = OpLoad %mat2x3_f32_std140 %72 None
+         %75 = OpCompositeExtract %v3float %74 0
+         %76 = OpCompositeExtract %v3float %74 1
+         %77 = OpCompositeConstruct %mat2v3float %75 %76
+               OpStore %70 %77 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %52 = OpLoad %_arr_mat2v3float_uint_4_0 %28 None
-         %53 = OpFunctionCall %void %tint_store_and_preserve_padding %52
-         %55 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %58 = OpLoad %v3float %55 None
-         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %60 = OpLoad %v3float %59 None
-         %61 = OpCompositeConstruct %mat2v3float %58 %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
-         %68 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %69 = OpLoad %v3float %68 None
-         %70 = OpVectorShuffle %v3float %69 %69 2 0 1
-               OpStore %66 %70 None
-         %71 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_float %72 %uint_0
-         %75 = OpLoad %float %73 None
-         %76 = OpAccessChain %_ptr_StorageBuffer_float %71 %uint_0
-               OpStore %76 %75 None
+         %39 = OpLoad %_arr_mat2v3float_uint_4_0 %28 None
+         %40 = OpFunctionCall %void %tint_store_and_preserve_padding %39
+         %42 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %45 = OpLoad %v3float %42 None
+         %46 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %48 = OpLoad %v3float %46 None
+         %49 = OpCompositeConstruct %mat2v3float %45 %48
+         %51 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %52 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %51 %49
+         %54 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
+         %56 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %57 = OpLoad %v3float %56 None
+         %58 = OpVectorShuffle %v3float %57 %57 2 0 1
+               OpStore %54 %58 None
+         %59 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %61 = OpAccessChain %_ptr_Uniform_float %60 %uint_0
+         %63 = OpLoad %float %61 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_float %59 %uint_0
+               OpStore %64 %63 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %79
@@ -189,21 +189,21 @@
                OpLoopMerge %116 %114 None
                OpBranch %113
         %113 = OpLabel
-        %119 = OpUGreaterThanEqual %bool %117 %uint_4
-               OpSelectionMerge %120 None
-               OpBranchConditional %119 %121 %120
-        %121 = OpLabel
+        %120 = OpUGreaterThanEqual %bool %117 %uint_4
+               OpSelectionMerge %121 None
+               OpBranchConditional %120 %122 %121
+        %122 = OpLabel
                OpBranch %116
-        %120 = OpLabel
-        %122 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %108 %117
-        %123 = OpLoad %mat2x3_f32_std140 %122 None
-        %124 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %110 %117
-               OpStore %124 %123 None
+        %121 = OpLabel
+        %123 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %108 %117
+        %124 = OpLoad %mat2x3_f32_std140 %123 None
+        %125 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %110 %117
+               OpStore %125 %124 None
                OpBranch %114
         %114 = OpLabel
         %118 = OpIAdd %uint %117 %uint_1
                OpBranch %115
         %116 = OpLabel
-        %125 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %110 None
-               OpReturnValue %125
+        %119 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %110 None
+               OpReturnValue %119
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
index c470563..09261fe 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -45,10 +45,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat2v3float = OpTypePointer Workgroup %mat2v3float
-         %34 = OpConstantNull %mat2v3float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat2x3_f32_std140_uint_4 = OpTypePointer Uniform %_arr_mat2x3_f32_std140_uint_4
@@ -56,13 +52,17 @@
 %_arr_mat2x3_f32_std140_uint_4_0 = OpTypeArray %mat2x3_f32_std140 %uint_4
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat2v3float_uint_4 = OpTypePointer Function %_arr_mat2v3float_uint_4
-         %50 = OpConstantNull %_arr_mat2v3float_uint_4
-%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
-%_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
+         %42 = OpConstantNull %_arr_mat2v3float_uint_4
+%_ptr_Workgroup_mat2v3float = OpTypePointer Workgroup %mat2v3float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %77 = OpConstantNull %mat2v3float
+%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
+%_ptr_Function_mat2x3_f32_std140 = OpTypePointer Function %mat2x3_f32_std140
          %90 = OpTypeFunction %void
          %95 = OpTypeFunction %_arr_mat2x3_f32_std140_uint_4_0 %_arr_mat2x3_f32_std140_uint_4
 %_ptr_Function__arr_mat2x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat2x3_f32_std140_uint_4
@@ -70,8 +70,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat2x3_f32_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat2v3float_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat2x3_f32_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat2v3float_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -80,70 +80,70 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %72 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %74 None
+               OpBranchConditional %72 %75 %74
+         %75 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat2v3float %w %26
-               OpStore %32 %34 None
+         %74 = OpLabel
+         %76 = OpAccessChain %_ptr_Workgroup_mat2v3float %w %26
+               OpStore %76 %77 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat2x3_f32_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat2x3_f32_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat2x3_f32_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat2v3float %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %46 %56
-         %65 = OpLoad %mat2x3_f32_std140 %63 None
-         %66 = OpCompositeExtract %v3float %65 0
-         %67 = OpCompositeExtract %v3float %65 1
-         %68 = OpCompositeConstruct %mat2v3float %66 %67
-               OpStore %61 %68 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %69 = OpLoad %_arr_mat2v3float_uint_4 %48 None
-               OpStore %w %69 None
-         %70 = OpAccessChain %_ptr_Workgroup_mat2v3float %w %uint_1
-         %71 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %73 = OpLoad %v3float %71 None
-         %74 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %75 = OpLoad %v3float %74 None
-         %76 = OpCompositeConstruct %mat2v3float %73 %75
-               OpStore %70 %76 None
-         %77 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %80 = OpLoad %v3float %79 None
-         %81 = OpVectorShuffle %v3float %80 %80 2 0 1
-               OpStore %77 %81 None
-         %82 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %84 = OpAccessChain %_ptr_Uniform_float %83 %uint_0
-         %86 = OpLoad %float %84 None
-         %87 = OpAccessChain %_ptr_Workgroup_float %82 %uint_0
-               OpStore %87 %86 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat2x3_f32_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat2x3_f32_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat2x3_f32_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %78 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %78 %80 %79
+         %80 = OpLabel
+               OpBranch %47
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Function_mat2v3float %40 %48
+         %83 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %38 %48
+         %85 = OpLoad %mat2x3_f32_std140 %83 None
+         %86 = OpCompositeExtract %v3float %85 0
+         %87 = OpCompositeExtract %v3float %85 1
+         %88 = OpCompositeConstruct %mat2v3float %86 %87
+               OpStore %81 %88 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat2v3float_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat2v3float %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v3float %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3float %57 None
+         %59 = OpCompositeConstruct %mat2v3float %56 %58
+               OpStore %51 %59 None
+         %60 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %63 = OpLoad %v3float %62 None
+         %64 = OpVectorShuffle %v3float %63 %63 2 0 1
+               OpStore %60 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
+         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %67 = OpAccessChain %_ptr_Uniform_float %66 %uint_0
+         %69 = OpLoad %float %67 None
+         %70 = OpAccessChain %_ptr_Workgroup_float %65 %uint_0
+               OpStore %70 %69 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %90
@@ -166,21 +166,21 @@
                OpLoopMerge %105 %103 None
                OpBranch %102
         %102 = OpLabel
-        %108 = OpUGreaterThanEqual %bool %106 %uint_4
-               OpSelectionMerge %109 None
-               OpBranchConditional %108 %110 %109
-        %110 = OpLabel
+        %109 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %110 None
+               OpBranchConditional %109 %111 %110
+        %111 = OpLabel
                OpBranch %105
-        %109 = OpLabel
-        %111 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %97 %106
-        %112 = OpLoad %mat2x3_f32_std140 %111 None
-        %113 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %99 %106
-               OpStore %113 %112 None
+        %110 = OpLabel
+        %112 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %97 %106
+        %113 = OpLoad %mat2x3_f32_std140 %112 None
+        %114 = OpAccessChain %_ptr_Function_mat2x3_f32_std140 %99 %106
+               OpStore %114 %113 None
                OpBranch %103
         %103 = OpLabel
         %107 = OpIAdd %uint %106 %uint_1
                OpBranch %104
         %105 = OpLabel
-        %114 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %99 None
-               OpReturnValue %114
+        %108 = OpLoad %_arr_mat2x3_f32_std140_uint_4_0 %99 None
+               OpReturnValue %108
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 340c981..c0d9b1c 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -72,9 +72,9 @@
 %_arr_mat2v4half_uint_4 = OpTypeArray %mat2v4half %uint_4
 %_ptr_Function__arr_mat2v4half_uint_4 = OpTypePointer Function %_arr_mat2v4half_uint_4
          %61 = OpConstantNull %_arr_mat2v4half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %91 = OpTypeFunction %_arr_mat2x4_f16_std140_uint_4_0 %_arr_mat2x4_f16_std140_uint_4
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4
          %96 = OpConstantNull %_arr_mat2x4_f16_std140_uint_4_0
@@ -117,34 +117,34 @@
                OpLoopMerge %66 %64 None
                OpBranch %63
          %63 = OpLabel
-         %69 = OpUGreaterThanEqual %bool %67 %uint_4
-               OpSelectionMerge %71 None
-               OpBranchConditional %69 %72 %71
-         %72 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %67 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %66
-         %71 = OpLabel
-         %73 = OpAccessChain %_ptr_Function_mat2v4half %58 %67
-         %74 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %56 %67
-         %76 = OpLoad %mat2x4_f16_std140 %74 None
-         %77 = OpCompositeExtract %v4half %76 0
-         %78 = OpCompositeExtract %v4half %76 1
-         %79 = OpCompositeConstruct %mat2v4half %77 %78
-               OpStore %73 %79 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Function_mat2v4half %58 %67
+         %84 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %56 %67
+         %86 = OpLoad %mat2x4_f16_std140 %84 None
+         %87 = OpCompositeExtract %v4half %86 0
+         %88 = OpCompositeExtract %v4half %86 1
+         %89 = OpCompositeConstruct %mat2v4half %87 %88
+               OpStore %83 %89 None
                OpBranch %64
          %64 = OpLabel
          %68 = OpIAdd %uint %67 %uint_1
                OpBranch %65
          %66 = OpLabel
         %l_a = OpLoad %_arr_mat2v4half_uint_4 %58 None
-         %81 = OpCompositeExtract %half %l_a_i_i 0
-         %82 = OpCompositeExtract %half %l_a 0 0 0
-         %83 = OpFAdd %half %81 %82
-         %84 = OpCompositeExtract %half %l_a_i 0 0
-         %85 = OpFAdd %half %83 %84
-         %86 = OpCompositeExtract %half %l_a_i_i 0
-         %87 = OpFAdd %half %85 %86
-         %88 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %88 %87 None
+         %70 = OpCompositeExtract %half %l_a_i_i 0
+         %71 = OpCompositeExtract %half %l_a 0 0 0
+         %72 = OpFAdd %half %70 %71
+         %73 = OpCompositeExtract %half %l_a_i 0 0
+         %74 = OpFAdd %half %72 %73
+         %75 = OpCompositeExtract %half %l_a_i_i 0
+         %76 = OpFAdd %half %74 %75
+         %77 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %77 %76 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x4_f16_std140_uint_4_0 None %91
@@ -161,21 +161,21 @@
                OpLoopMerge %101 %99 None
                OpBranch %98
          %98 = OpLabel
-        %104 = OpUGreaterThanEqual %bool %102 %uint_4
-               OpSelectionMerge %105 None
-               OpBranchConditional %104 %106 %105
-        %106 = OpLabel
+        %105 = OpUGreaterThanEqual %bool %102 %uint_4
+               OpSelectionMerge %106 None
+               OpBranchConditional %105 %107 %106
+        %107 = OpLabel
                OpBranch %101
-        %105 = OpLabel
-        %107 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %93 %102
-        %108 = OpLoad %mat2x4_f16_std140 %107 None
-        %109 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %95 %102
-               OpStore %109 %108 None
+        %106 = OpLabel
+        %108 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %93 %102
+        %109 = OpLoad %mat2x4_f16_std140 %108 None
+        %110 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %95 %102
+               OpStore %110 %109 None
                OpBranch %99
          %99 = OpLabel
         %103 = OpIAdd %uint %102 %uint_1
                OpBranch %100
         %101 = OpLabel
-        %110 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %95 None
-               OpReturnValue %110
+        %104 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %95 None
+               OpReturnValue %104
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm
index 3e83b8a..b2e2213 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -61,10 +61,10 @@
 %_arr_mat2v4half_uint_4 = OpTypeArray %mat2v4half %uint_4
 %_ptr_Function__arr_mat2v4half_uint_4 = OpTypePointer Function %_arr_mat2v4half_uint_4
          %39 = OpConstantNull %_arr_mat2v4half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
 %_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %70 = OpTypeFunction %_arr_mat2x4_f16_std140_uint_4_0 %_arr_mat2x4_f16_std140_uint_4
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4
          %75 = OpConstantNull %_arr_mat2x4_f16_std140_uint_4_0
@@ -90,34 +90,34 @@
                OpLoopMerge %44 %42 None
                OpBranch %41
          %41 = OpLabel
-         %47 = OpUGreaterThanEqual %bool %45 %uint_4
-               OpSelectionMerge %49 None
-               OpBranchConditional %47 %50 %49
-         %50 = OpLabel
+         %57 = OpUGreaterThanEqual %bool %45 %uint_4
+               OpSelectionMerge %59 None
+               OpBranchConditional %57 %60 %59
+         %60 = OpLabel
                OpBranch %44
-         %49 = OpLabel
-         %51 = OpAccessChain %_ptr_Function_mat2v4half %36 %45
-         %53 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %34 %45
-         %55 = OpLoad %mat2x4_f16_std140 %53 None
-         %56 = OpCompositeExtract %v4half %55 0
-         %57 = OpCompositeExtract %v4half %55 1
-         %58 = OpCompositeConstruct %mat2v4half %56 %57
-               OpStore %51 %58 None
+         %59 = OpLabel
+         %61 = OpAccessChain %_ptr_Function_mat2v4half %36 %45
+         %63 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %34 %45
+         %65 = OpLoad %mat2x4_f16_std140 %63 None
+         %66 = OpCompositeExtract %v4half %65 0
+         %67 = OpCompositeExtract %v4half %65 1
+         %68 = OpCompositeConstruct %mat2v4half %66 %67
+               OpStore %61 %68 None
                OpBranch %42
          %42 = OpLabel
          %46 = OpIAdd %uint %45 %uint_1
                OpBranch %43
          %44 = OpLabel
         %l_a = OpLoad %_arr_mat2v4half_uint_4 %36 None
-         %60 = OpCompositeExtract %half %l_a_i_i 0
-         %61 = OpCompositeExtract %half %l_a 0 0 0
-         %62 = OpFAdd %half %60 %61
-         %63 = OpCompositeExtract %half %l_a_i 0 0
-         %64 = OpFAdd %half %62 %63
-         %65 = OpCompositeExtract %half %l_a_i_i 0
-         %66 = OpFAdd %half %64 %65
-         %67 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %67 %66 None
+         %48 = OpCompositeExtract %half %l_a_i_i 0
+         %49 = OpCompositeExtract %half %l_a 0 0 0
+         %50 = OpFAdd %half %48 %49
+         %51 = OpCompositeExtract %half %l_a_i 0 0
+         %52 = OpFAdd %half %50 %51
+         %53 = OpCompositeExtract %half %l_a_i_i 0
+         %54 = OpFAdd %half %52 %53
+         %55 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %55 %54 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x4_f16_std140_uint_4_0 None %70
@@ -134,21 +134,21 @@
                OpLoopMerge %80 %78 None
                OpBranch %77
          %77 = OpLabel
-         %83 = OpUGreaterThanEqual %bool %81 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %83 %85 %84
-         %85 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %84 %86 %85
+         %86 = OpLabel
                OpBranch %80
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %72 %81
-         %87 = OpLoad %mat2x4_f16_std140 %86 None
-         %88 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %74 %81
-               OpStore %88 %87 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %72 %81
+         %88 = OpLoad %mat2x4_f16_std140 %87 None
+         %89 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %74 %81
+               OpStore %89 %88 None
                OpBranch %78
          %78 = OpLabel
          %82 = OpIAdd %uint %81 %uint_1
                OpBranch %79
          %80 = OpLabel
-         %89 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %74 None
-               OpReturnValue %89
+         %83 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %74 None
+               OpReturnValue %83
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.spvasm
index 08ec696..be1eaf9 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.spvasm
@@ -67,12 +67,12 @@
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4_0
 %_ptr_Function__arr_mat2v4half_uint_4 = OpTypePointer Function %_arr_mat2v4half_uint_4
          %49 = OpConstantNull %_arr_mat2v4half_uint_4
+%_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
+     %uint_1 = OpConstant %uint 1
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
 %_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
-     %uint_1 = OpConstant %uint 1
-%_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %94 = OpTypeFunction %_arr_mat2x4_f16_std140_uint_4_0 %_arr_mat2x4_f16_std140_uint_4
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4
          %99 = OpConstantNull %_arr_mat2x4_f16_std140_uint_4_0
@@ -115,46 +115,46 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %83 None
+               OpBranchConditional %81 %84 %83
+         %84 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat2v4half %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %45 %55
-         %65 = OpLoad %mat2x4_f16_std140 %63 None
-         %66 = OpCompositeExtract %v4half %65 0
-         %67 = OpCompositeExtract %v4half %65 1
-         %68 = OpCompositeConstruct %mat2v4half %66 %67
-               OpStore %61 %68 None
+         %83 = OpLabel
+         %85 = OpAccessChain %_ptr_Function_mat2v4half %47 %55
+         %87 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %45 %55
+         %89 = OpLoad %mat2x4_f16_std140 %87 None
+         %90 = OpCompositeExtract %v4half %89 0
+         %91 = OpCompositeExtract %v4half %89 1
+         %92 = OpCompositeConstruct %mat2v4half %90 %91
+               OpStore %85 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %70 = OpLoad %_arr_mat2v4half_uint_4 %47 None
-         %71 = OpFunctionCall %half %a %70
-         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
-         %74 = OpLoad %v4half %72 None
-         %75 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_1
-         %76 = OpLoad %v4half %75 None
-         %77 = OpCompositeConstruct %mat2v4half %74 %76
-         %78 = OpFunctionCall %half %b %77
-         %79 = OpFAdd %half %71 %78
-         %80 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
-         %81 = OpLoad %v4half %80 None
-         %82 = OpVectorShuffle %v4half %81 %81 1 3 0 2
-         %83 = OpFunctionCall %half %c %82
-         %84 = OpFAdd %half %79 %83
-         %85 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
-         %86 = OpLoad %v4half %85 None
-         %87 = OpVectorShuffle %v4half %86 %86 1 3 0 2
-         %88 = OpCompositeExtract %half %87 0
-         %89 = OpFunctionCall %half %d %88
-         %90 = OpFAdd %half %84 %89
-         %91 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %91 %90 None
+         %57 = OpLoad %_arr_mat2v4half_uint_4 %47 None
+         %58 = OpFunctionCall %half %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v4half %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v4half %63 None
+         %65 = OpCompositeConstruct %mat2v4half %62 %64
+         %66 = OpFunctionCall %half %b %65
+         %67 = OpFAdd %half %58 %66
+         %68 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
+         %69 = OpLoad %v4half %68 None
+         %70 = OpVectorShuffle %v4half %69 %69 1 3 0 2
+         %71 = OpFunctionCall %half %c %70
+         %72 = OpFAdd %half %67 %71
+         %73 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
+         %74 = OpLoad %v4half %73 None
+         %75 = OpVectorShuffle %v4half %74 %74 1 3 0 2
+         %76 = OpCompositeExtract %half %75 0
+         %77 = OpFunctionCall %half %d %76
+         %78 = OpFAdd %half %72 %77
+         %79 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %79 %78 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x4_f16_std140_uint_4_0 None %94
@@ -171,21 +171,21 @@
                OpLoopMerge %104 %102 None
                OpBranch %101
         %101 = OpLabel
-        %107 = OpUGreaterThanEqual %bool %105 %uint_4
-               OpSelectionMerge %108 None
-               OpBranchConditional %107 %109 %108
-        %109 = OpLabel
+        %108 = OpUGreaterThanEqual %bool %105 %uint_4
+               OpSelectionMerge %109 None
+               OpBranchConditional %108 %110 %109
+        %110 = OpLabel
                OpBranch %104
-        %108 = OpLabel
-        %110 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %96 %105
-        %111 = OpLoad %mat2x4_f16_std140 %110 None
-        %112 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %98 %105
-               OpStore %112 %111 None
+        %109 = OpLabel
+        %111 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %96 %105
+        %112 = OpLoad %mat2x4_f16_std140 %111 None
+        %113 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %98 %105
+               OpStore %113 %112 None
                OpBranch %102
         %102 = OpLabel
         %106 = OpIAdd %uint %105 %uint_1
                OpBranch %103
         %104 = OpLabel
-        %113 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %98 None
-               OpReturnValue %113
+        %107 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %98 None
+               OpReturnValue %107
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.spvasm
index 1a81cda..a02e1e3 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.spvasm
@@ -58,17 +58,17 @@
 %_arr_mat2x4_f16_std140_uint_4_0 = OpTypeArray %mat2x4_f16_std140 %uint_4
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4_0
 %_ptr_Function__arr_mat2v4half_uint_4 = OpTypePointer Function %_arr_mat2v4half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
-%_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat2v4half = OpTypePointer Private %mat2v4half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_v4half = OpTypePointer Private %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Private_half = OpTypePointer Private %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
+%_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
          %81 = OpTypeFunction %_arr_mat2x4_f16_std140_uint_4_0 %_arr_mat2x4_f16_std140_uint_4
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4
          %86 = OpConstantNull %_arr_mat2x4_f16_std140_uint_4_0
@@ -88,49 +88,49 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %68 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %70 None
+               OpBranchConditional %68 %71 %70
+         %71 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat2v4half %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %29 %38
-         %48 = OpLoad %mat2x4_f16_std140 %46 None
-         %49 = OpCompositeExtract %v4half %48 0
-         %50 = OpCompositeExtract %v4half %48 1
-         %51 = OpCompositeConstruct %mat2v4half %49 %50
-               OpStore %44 %51 None
+         %70 = OpLabel
+         %72 = OpAccessChain %_ptr_Function_mat2v4half %31 %38
+         %74 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %29 %38
+         %76 = OpLoad %mat2x4_f16_std140 %74 None
+         %77 = OpCompositeExtract %v4half %76 0
+         %78 = OpCompositeExtract %v4half %76 1
+         %79 = OpCompositeConstruct %mat2v4half %77 %78
+               OpStore %72 %79 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %53 = OpLoad %_arr_mat2v4half_uint_4 %31 None
-               OpStore %p %53 None
-         %54 = OpAccessChain %_ptr_Private_mat2v4half %p %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
-         %59 = OpLoad %v4half %56 None
-         %60 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %61 = OpLoad %v4half %60 None
-         %62 = OpCompositeConstruct %mat2v4half %59 %61
-               OpStore %54 %62 None
+         %40 = OpLoad %_arr_mat2v4half_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat2v4half %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v4half %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v4half %48 None
+         %50 = OpCompositeConstruct %mat2v4half %47 %49
+               OpStore %41 %50 None
+         %51 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %54 = OpLoad %v4half %53 None
+         %55 = OpVectorShuffle %v4half %54 %54 1 3 0 2
+               OpStore %51 %55 None
+         %56 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
+         %57 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %58 = OpAccessChain %_ptr_Uniform_half %57 %uint_0
+         %60 = OpLoad %half %58 None
+         %61 = OpAccessChain %_ptr_Private_half %56 %uint_0
+               OpStore %61 %60 None
          %63 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
-         %65 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %66 = OpLoad %v4half %65 None
-         %67 = OpVectorShuffle %v4half %66 %66 1 3 0 2
-               OpStore %63 %67 None
-         %68 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
-         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %70 = OpAccessChain %_ptr_Uniform_half %69 %uint_0
-         %72 = OpLoad %half %70 None
-         %73 = OpAccessChain %_ptr_Private_half %68 %uint_0
-               OpStore %73 %72 None
-         %75 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Private_half %75 %uint_0
-         %77 = OpLoad %half %76 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %78 %77 None
+         %64 = OpAccessChain %_ptr_Private_half %63 %uint_0
+         %65 = OpLoad %half %64 None
+         %66 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %66 %65 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2x4_f16_std140_uint_4_0 None %81
@@ -147,21 +147,21 @@
                OpLoopMerge %91 %89 None
                OpBranch %88
          %88 = OpLabel
-         %94 = OpUGreaterThanEqual %bool %92 %uint_4
-               OpSelectionMerge %95 None
-               OpBranchConditional %94 %96 %95
-         %96 = OpLabel
+         %95 = OpUGreaterThanEqual %bool %92 %uint_4
+               OpSelectionMerge %96 None
+               OpBranchConditional %95 %97 %96
+         %97 = OpLabel
                OpBranch %91
-         %95 = OpLabel
-         %97 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %83 %92
-         %98 = OpLoad %mat2x4_f16_std140 %97 None
-         %99 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %85 %92
-               OpStore %99 %98 None
+         %96 = OpLabel
+         %98 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %83 %92
+         %99 = OpLoad %mat2x4_f16_std140 %98 None
+        %100 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %85 %92
+               OpStore %100 %99 None
                OpBranch %89
          %89 = OpLabel
          %93 = OpIAdd %uint %92 %uint_1
                OpBranch %90
          %91 = OpLabel
-        %100 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %85 None
-               OpReturnValue %100
+         %94 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %85 None
+               OpReturnValue %94
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.spvasm
index e2b0df7..8b51919 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.spvasm
@@ -61,17 +61,17 @@
 %_arr_mat2v4half_uint_4_0 = OpTypeArray %mat2v4half %uint_4
 %_ptr_Function__arr_mat2v4half_uint_4_0 = OpTypePointer Function %_arr_mat2v4half_uint_4_0
          %31 = OpConstantNull %_arr_mat2v4half_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
-%_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_StorageBuffer__arr_mat2v4half_uint_4 = OpTypePointer StorageBuffer %_arr_mat2v4half_uint_4
 %_ptr_StorageBuffer_mat2v4half = OpTypePointer StorageBuffer %mat2v4half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
      %uint_2 = OpConstant %uint 2
 %_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
+%_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
          %79 = OpTypeFunction %_arr_mat2v4half_uint_4 %_arr_mat2v4half_uint_4_0
 %_ptr_Function__arr_mat2v4half_uint_4 = OpTypePointer Function %_arr_mat2v4half_uint_4
          %84 = OpConstantNull %_arr_mat2v4half_uint_4
@@ -94,46 +94,46 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %66 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %68 None
+               OpBranchConditional %66 %69 %68
+         %69 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat2v4half %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %26 %37
-         %47 = OpLoad %mat2x4_f16_std140 %45 None
-         %48 = OpCompositeExtract %v4half %47 0
-         %49 = OpCompositeExtract %v4half %47 1
-         %50 = OpCompositeConstruct %mat2v4half %48 %49
-               OpStore %43 %50 None
+         %68 = OpLabel
+         %70 = OpAccessChain %_ptr_Function_mat2v4half %28 %37
+         %72 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %26 %37
+         %74 = OpLoad %mat2x4_f16_std140 %72 None
+         %75 = OpCompositeExtract %v4half %74 0
+         %76 = OpCompositeExtract %v4half %74 1
+         %77 = OpCompositeConstruct %mat2v4half %75 %76
+               OpStore %70 %77 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %52 = OpLoad %_arr_mat2v4half_uint_4_0 %28 None
-         %53 = OpAccessChain %_ptr_StorageBuffer__arr_mat2v4half_uint_4 %10 %uint_0
-         %55 = OpFunctionCall %_arr_mat2v4half_uint_4 %tint_convert_explicit_layout %52
-               OpStore %53 %55 None
-         %57 = OpAccessChain %_ptr_StorageBuffer_mat2v4half %10 %uint_0 %uint_1
-         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
-         %62 = OpLoad %v4half %59 None
-         %63 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v4half %63 None
-         %65 = OpCompositeConstruct %mat2v4half %62 %64
-               OpStore %57 %65 None
-         %66 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
-         %68 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %69 = OpLoad %v4half %68 None
-         %70 = OpVectorShuffle %v4half %69 %69 1 3 0 2
-               OpStore %66 %70 None
-         %71 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_half %72 %uint_0
-         %75 = OpLoad %half %73 None
-         %76 = OpAccessChain %_ptr_StorageBuffer_half %71 %uint_0
-               OpStore %76 %75 None
+         %39 = OpLoad %_arr_mat2v4half_uint_4_0 %28 None
+         %40 = OpAccessChain %_ptr_StorageBuffer__arr_mat2v4half_uint_4 %10 %uint_0
+         %42 = OpFunctionCall %_arr_mat2v4half_uint_4 %tint_convert_explicit_layout %39
+               OpStore %40 %42 None
+         %44 = OpAccessChain %_ptr_StorageBuffer_mat2v4half %10 %uint_0 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
+         %50 = OpLoad %v4half %47 None
+         %51 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %v4half %51 None
+         %53 = OpCompositeConstruct %mat2v4half %50 %52
+               OpStore %44 %53 None
+         %54 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
+         %56 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %57 = OpLoad %v4half %56 None
+         %58 = OpVectorShuffle %v4half %57 %57 1 3 0 2
+               OpStore %54 %58 None
+         %59 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %61 = OpAccessChain %_ptr_Uniform_half %60 %uint_0
+         %63 = OpLoad %half %61 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_half %59 %uint_0
+               OpStore %64 %63 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat2v4half_uint_4 None %79
@@ -150,23 +150,23 @@
                OpLoopMerge %89 %87 None
                OpBranch %86
          %86 = OpLabel
-         %92 = OpUGreaterThanEqual %bool %90 %uint_4
-               OpSelectionMerge %93 None
-               OpBranchConditional %92 %94 %93
-         %94 = OpLabel
+         %93 = OpUGreaterThanEqual %bool %90 %uint_4
+               OpSelectionMerge %94 None
+               OpBranchConditional %93 %95 %94
+         %95 = OpLabel
                OpBranch %89
-         %93 = OpLabel
-         %95 = OpAccessChain %_ptr_Function_mat2v4half %81 %90
-         %96 = OpLoad %mat2v4half %95 None
-         %97 = OpAccessChain %_ptr_Function_mat2v4half %82 %90
-               OpStore %97 %96 None
+         %94 = OpLabel
+         %96 = OpAccessChain %_ptr_Function_mat2v4half %81 %90
+         %97 = OpLoad %mat2v4half %96 None
+         %98 = OpAccessChain %_ptr_Function_mat2v4half %82 %90
+               OpStore %98 %97 None
                OpBranch %87
          %87 = OpLabel
          %91 = OpIAdd %uint %90 %uint_1
                OpBranch %88
          %89 = OpLabel
-         %98 = OpLoad %_arr_mat2v4half_uint_4 %82 None
-               OpReturnValue %98
+         %92 = OpLoad %_arr_mat2v4half_uint_4 %82 None
+               OpReturnValue %92
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat2x4_f16_std140_uint_4_0 None %100
 %tint_source_0 = OpFunctionParameter %_arr_mat2x4_f16_std140_uint_4
@@ -182,21 +182,21 @@
                OpLoopMerge %110 %108 None
                OpBranch %107
         %107 = OpLabel
-        %113 = OpUGreaterThanEqual %bool %111 %uint_4
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %114
-        %115 = OpLabel
+        %114 = OpUGreaterThanEqual %bool %111 %uint_4
+               OpSelectionMerge %115 None
+               OpBranchConditional %114 %116 %115
+        %116 = OpLabel
                OpBranch %110
-        %114 = OpLabel
-        %116 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %102 %111
-        %117 = OpLoad %mat2x4_f16_std140 %116 None
-        %118 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %104 %111
-               OpStore %118 %117 None
+        %115 = OpLabel
+        %117 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %102 %111
+        %118 = OpLoad %mat2x4_f16_std140 %117 None
+        %119 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %104 %111
+               OpStore %119 %118 None
                OpBranch %108
         %108 = OpLabel
         %112 = OpIAdd %uint %111 %uint_1
                OpBranch %109
         %110 = OpLabel
-        %119 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %104 None
-               OpReturnValue %119
+        %113 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %104 None
+               OpReturnValue %113
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
index c25847b..34d388a 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -48,10 +48,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat2v4half = OpTypePointer Workgroup %mat2v4half
-         %34 = OpConstantNull %mat2v4half
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat2x4_f16_std140_uint_4 = OpTypePointer Uniform %_arr_mat2x4_f16_std140_uint_4
@@ -59,13 +55,17 @@
 %_arr_mat2x4_f16_std140_uint_4_0 = OpTypeArray %mat2x4_f16_std140 %uint_4
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4_0
 %_ptr_Function__arr_mat2v4half_uint_4 = OpTypePointer Function %_arr_mat2v4half_uint_4
-         %50 = OpConstantNull %_arr_mat2v4half_uint_4
-%_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
-%_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
+         %42 = OpConstantNull %_arr_mat2v4half_uint_4
+%_ptr_Workgroup_mat2v4half = OpTypePointer Workgroup %mat2v4half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+       %bool = OpTypeBool
+         %77 = OpConstantNull %mat2v4half
+%_ptr_Function_mat2v4half = OpTypePointer Function %mat2v4half
+%_ptr_Function_mat2x4_f16_std140 = OpTypePointer Function %mat2x4_f16_std140
          %90 = OpTypeFunction %void
          %95 = OpTypeFunction %_arr_mat2x4_f16_std140_uint_4_0 %_arr_mat2x4_f16_std140_uint_4
 %_ptr_Function__arr_mat2x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat2x4_f16_std140_uint_4
@@ -73,8 +73,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat2x4_f16_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat2v4half_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat2x4_f16_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat2v4half_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -83,70 +83,70 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %72 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %74 None
+               OpBranchConditional %72 %75 %74
+         %75 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat2v4half %w %26
-               OpStore %32 %34 None
+         %74 = OpLabel
+         %76 = OpAccessChain %_ptr_Workgroup_mat2v4half %w %26
+               OpStore %76 %77 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat2x4_f16_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat2x4_f16_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat2x4_f16_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat2v4half %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %46 %56
-         %65 = OpLoad %mat2x4_f16_std140 %63 None
-         %66 = OpCompositeExtract %v4half %65 0
-         %67 = OpCompositeExtract %v4half %65 1
-         %68 = OpCompositeConstruct %mat2v4half %66 %67
-               OpStore %61 %68 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %69 = OpLoad %_arr_mat2v4half_uint_4 %48 None
-               OpStore %w %69 None
-         %70 = OpAccessChain %_ptr_Workgroup_mat2v4half %w %uint_1
-         %71 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
-         %73 = OpLoad %v4half %71 None
-         %74 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %75 = OpLoad %v4half %74 None
-         %76 = OpCompositeConstruct %mat2v4half %73 %75
-               OpStore %70 %76 None
-         %77 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %80 = OpLoad %v4half %79 None
-         %81 = OpVectorShuffle %v4half %80 %80 1 3 0 2
-               OpStore %77 %81 None
-         %82 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %84 = OpAccessChain %_ptr_Uniform_half %83 %uint_0
-         %86 = OpLoad %half %84 None
-         %87 = OpAccessChain %_ptr_Workgroup_half %82 %uint_0
-               OpStore %87 %86 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat2x4_f16_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat2x4_f16_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat2x4_f16_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %78 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %78 %80 %79
+         %80 = OpLabel
+               OpBranch %47
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Function_mat2v4half %40 %48
+         %83 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %38 %48
+         %85 = OpLoad %mat2x4_f16_std140 %83 None
+         %86 = OpCompositeExtract %v4half %85 0
+         %87 = OpCompositeExtract %v4half %85 1
+         %88 = OpCompositeConstruct %mat2v4half %86 %87
+               OpStore %81 %88 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat2v4half_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat2v4half %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v4half %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v4half %57 None
+         %59 = OpCompositeConstruct %mat2v4half %56 %58
+               OpStore %51 %59 None
+         %60 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %63 = OpLoad %v4half %62 None
+         %64 = OpVectorShuffle %v4half %63 %63 1 3 0 2
+               OpStore %60 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
+         %66 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %67 = OpAccessChain %_ptr_Uniform_half %66 %uint_0
+         %69 = OpLoad %half %67 None
+         %70 = OpAccessChain %_ptr_Workgroup_half %65 %uint_0
+               OpStore %70 %69 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %90
@@ -169,21 +169,21 @@
                OpLoopMerge %105 %103 None
                OpBranch %102
         %102 = OpLabel
-        %108 = OpUGreaterThanEqual %bool %106 %uint_4
-               OpSelectionMerge %109 None
-               OpBranchConditional %108 %110 %109
-        %110 = OpLabel
+        %109 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %110 None
+               OpBranchConditional %109 %111 %110
+        %111 = OpLabel
                OpBranch %105
-        %109 = OpLabel
-        %111 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %97 %106
-        %112 = OpLoad %mat2x4_f16_std140 %111 None
-        %113 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %99 %106
-               OpStore %113 %112 None
+        %110 = OpLabel
+        %112 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %97 %106
+        %113 = OpLoad %mat2x4_f16_std140 %112 None
+        %114 = OpAccessChain %_ptr_Function_mat2x4_f16_std140 %99 %106
+               OpStore %114 %113 None
                OpBranch %103
         %103 = OpLabel
         %107 = OpIAdd %uint %106 %uint_1
                OpBranch %104
         %105 = OpLabel
-        %114 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %99 None
-               OpReturnValue %114
+        %108 = OpLoad %_arr_mat2x4_f16_std140_uint_4_0 %99 None
+               OpReturnValue %108
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index fd6b9b4..f4bf821 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -120,21 +120,21 @@
                OpLoopMerge %73 %71 None
                OpBranch %70
          %70 = OpLabel
-         %76 = OpUGreaterThanEqual %bool %74 %uint_4
-               OpSelectionMerge %78 None
-               OpBranchConditional %76 %79 %78
-         %79 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %74 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %73
-         %78 = OpLabel
-         %80 = OpAccessChain %_ptr_Function_mat2v4float %64 %74
-         %82 = OpLoad %mat2v4float %80 None
-         %83 = OpAccessChain %_ptr_Function_mat2v4float %66 %74
-               OpStore %83 %82 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Function_mat2v4float %64 %74
+         %83 = OpLoad %mat2v4float %81 None
+         %84 = OpAccessChain %_ptr_Function_mat2v4float %66 %74
+               OpStore %84 %83 None
                OpBranch %71
          %71 = OpLabel
          %75 = OpIAdd %uint %74 %uint_1
                OpBranch %72
          %73 = OpLabel
-         %84 = OpLoad %_arr_mat2v4float_uint_4_0 %66 None
-               OpReturnValue %84
+         %76 = OpLoad %_arr_mat2v4float_uint_4_0 %66 None
+               OpReturnValue %76
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm
index b430286..66bfe6e 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -97,21 +97,21 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %59 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %61
+         %62 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_mat2v4float %46 %56
-         %64 = OpLoad %mat2v4float %62 None
-         %65 = OpAccessChain %_ptr_Function_mat2v4float %48 %56
-               OpStore %65 %64 None
+         %61 = OpLabel
+         %63 = OpAccessChain %_ptr_Function_mat2v4float %46 %56
+         %65 = OpLoad %mat2v4float %63 None
+         %66 = OpAccessChain %_ptr_Function_mat2v4float %48 %56
+               OpStore %66 %65 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
-         %66 = OpLoad %_arr_mat2v4float_uint_4_0 %48 None
-               OpReturnValue %66
+         %58 = OpLoad %_arr_mat2v4float_uint_4_0 %48 None
+               OpReturnValue %58
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.spvasm
index 1f7d5e5..06c2126 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.spvasm
@@ -128,21 +128,21 @@
                OpLoopMerge %76 %74 None
                OpBranch %73
          %73 = OpLabel
-         %79 = OpUGreaterThanEqual %bool %77 %uint_4
-               OpSelectionMerge %81 None
-               OpBranchConditional %79 %82 %81
-         %82 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %80 %83 %82
+         %83 = OpLabel
                OpBranch %76
-         %81 = OpLabel
-         %83 = OpAccessChain %_ptr_Function_mat2v4float %67 %77
-         %85 = OpLoad %mat2v4float %83 None
-         %86 = OpAccessChain %_ptr_Function_mat2v4float %69 %77
-               OpStore %86 %85 None
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_mat2v4float %67 %77
+         %86 = OpLoad %mat2v4float %84 None
+         %87 = OpAccessChain %_ptr_Function_mat2v4float %69 %77
+               OpStore %87 %86 None
                OpBranch %74
          %74 = OpLabel
          %78 = OpIAdd %uint %77 %uint_1
                OpBranch %75
          %76 = OpLabel
-         %87 = OpLoad %_arr_mat2v4float_uint_4_0 %69 None
-               OpReturnValue %87
+         %79 = OpLoad %_arr_mat2v4float_uint_4_0 %69 None
+               OpReturnValue %79
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.spvasm
index 6330240..3bb4f49 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.spvasm
@@ -104,21 +104,21 @@
                OpLoopMerge %63 %61 None
                OpBranch %60
          %60 = OpLabel
-         %66 = OpUGreaterThanEqual %bool %64 %uint_4
-               OpSelectionMerge %68 None
-               OpBranchConditional %66 %69 %68
-         %69 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %64 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %63
-         %68 = OpLabel
-         %70 = OpAccessChain %_ptr_Function_mat2v4float %55 %64
-         %72 = OpLoad %mat2v4float %70 None
-         %73 = OpAccessChain %_ptr_Function_mat2v4float %57 %64
-               OpStore %73 %72 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_mat2v4float %55 %64
+         %73 = OpLoad %mat2v4float %71 None
+         %74 = OpAccessChain %_ptr_Function_mat2v4float %57 %64
+               OpStore %74 %73 None
                OpBranch %61
          %61 = OpLabel
          %65 = OpIAdd %uint %64 %uint_1
                OpBranch %62
          %63 = OpLabel
-         %74 = OpLoad %_arr_mat2v4float_uint_4_0 %57 None
-               OpReturnValue %74
+         %66 = OpLoad %_arr_mat2v4float_uint_4_0 %57 None
+               OpReturnValue %66
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.spvasm
index 753a129..fce7c51 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.spvasm
@@ -104,23 +104,23 @@
                OpLoopMerge %60 %58 None
                OpBranch %57
          %57 = OpLabel
-         %63 = OpUGreaterThanEqual %bool %61 %uint_4
-               OpSelectionMerge %65 None
-               OpBranchConditional %63 %66 %65
-         %66 = OpLabel
+         %64 = OpUGreaterThanEqual %bool %61 %uint_4
+               OpSelectionMerge %66 None
+               OpBranchConditional %64 %67 %66
+         %67 = OpLabel
                OpBranch %60
-         %65 = OpLabel
-         %67 = OpAccessChain %_ptr_Function_mat2v4float %51 %61
-         %69 = OpLoad %mat2v4float %67 None
-         %70 = OpAccessChain %_ptr_Function_mat2v4float %53 %61
-               OpStore %70 %69 None
+         %66 = OpLabel
+         %68 = OpAccessChain %_ptr_Function_mat2v4float %51 %61
+         %70 = OpLoad %mat2v4float %68 None
+         %71 = OpAccessChain %_ptr_Function_mat2v4float %53 %61
+               OpStore %71 %70 None
                OpBranch %58
          %58 = OpLabel
          %62 = OpIAdd %uint %61 %uint_1
                OpBranch %59
          %60 = OpLabel
-         %71 = OpLoad %_arr_mat2v4float_uint_4_0 %53 None
-               OpReturnValue %71
+         %63 = OpLoad %_arr_mat2v4float_uint_4_0 %53 None
+               OpReturnValue %63
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat2v4float_uint_4 None %73
 %tint_source_0 = OpFunctionParameter %_arr_mat2v4float_uint_4_0
@@ -136,21 +136,21 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %86 None
-               OpBranchConditional %85 %87 %86
-         %87 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %87 None
+               OpBranchConditional %86 %88 %87
+         %88 = OpLabel
                OpBranch %82
-         %86 = OpLabel
-         %88 = OpAccessChain %_ptr_Function_mat2v4float %75 %83
-         %89 = OpLoad %mat2v4float %88 None
-         %90 = OpAccessChain %_ptr_Function_mat2v4float %76 %83
-               OpStore %90 %89 None
+         %87 = OpLabel
+         %89 = OpAccessChain %_ptr_Function_mat2v4float %75 %83
+         %90 = OpLoad %mat2v4float %89 None
+         %91 = OpAccessChain %_ptr_Function_mat2v4float %76 %83
+               OpStore %91 %90 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
-         %91 = OpLoad %_arr_mat2v4float_uint_4 %76 None
-               OpReturnValue %91
+         %85 = OpLoad %_arr_mat2v4float_uint_4 %76 None
+               OpReturnValue %85
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
index d5b7136..57ee3c7 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -41,19 +41,19 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %18 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat2v4float = OpTypePointer Workgroup %mat2v4float
-         %33 = OpConstantNull %mat2v4float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat2v4float_uint_4 = OpTypePointer Uniform %_arr_mat2v4float_uint_4
      %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_mat2v4float = OpTypePointer Workgroup %mat2v4float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_mat2v4float = OpTypePointer Uniform %mat2v4float
 %_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %60 = OpConstantNull %mat2v4float
          %62 = OpTypeFunction %void
          %67 = OpTypeFunction %_arr_mat2v4float_uint_4_0 %_arr_mat2v4float_uint_4
 %_ptr_Function__arr_mat2v4float_uint_4 = OpTypePointer Function %_arr_mat2v4float_uint_4
@@ -71,39 +71,39 @@
                OpLoopMerge %24 %22 None
                OpBranch %21
          %21 = OpLabel
-         %27 = OpUGreaterThanEqual %bool %25 %uint_4
-               OpSelectionMerge %29 None
-               OpBranchConditional %27 %30 %29
-         %30 = OpLabel
+         %55 = OpUGreaterThanEqual %bool %25 %uint_4
+               OpSelectionMerge %57 None
+               OpBranchConditional %55 %58 %57
+         %58 = OpLabel
                OpBranch %24
-         %29 = OpLabel
-         %31 = OpAccessChain %_ptr_Workgroup_mat2v4float %w %25
-               OpStore %31 %33 None
+         %57 = OpLabel
+         %59 = OpAccessChain %_ptr_Workgroup_mat2v4float %w %25
+               OpStore %59 %60 None
                OpBranch %22
          %22 = OpLabel
          %26 = OpIAdd %uint %25 %uint_1
                OpBranch %23
          %24 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %38 = OpAccessChain %_ptr_Uniform__arr_mat2v4float_uint_4 %1 %uint_0
-         %41 = OpLoad %_arr_mat2v4float_uint_4 %38 None
-         %42 = OpFunctionCall %_arr_mat2v4float_uint_4_0 %tint_convert_explicit_layout %41
-               OpStore %w %42 None
-         %44 = OpAccessChain %_ptr_Workgroup_mat2v4float %w %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_mat2v4float %1 %uint_0 %uint_2
-         %47 = OpLoad %mat2v4float %45 None
-               OpStore %44 %47 None
+         %30 = OpAccessChain %_ptr_Uniform__arr_mat2v4float_uint_4 %1 %uint_0
+         %33 = OpLoad %_arr_mat2v4float_uint_4 %30 None
+         %34 = OpFunctionCall %_arr_mat2v4float_uint_4_0 %tint_convert_explicit_layout %33
+               OpStore %w %34 None
+         %36 = OpAccessChain %_ptr_Workgroup_mat2v4float %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_mat2v4float %1 %uint_0 %uint_2
+         %41 = OpLoad %mat2v4float %39 None
+               OpStore %36 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
+         %44 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
+         %46 = OpLoad %v4float %44 None
+         %47 = OpVectorShuffle %v4float %46 %46 1 3 0 2
+               OpStore %42 %47 None
          %48 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
-         %50 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
-         %52 = OpLoad %v4float %50 None
-         %53 = OpVectorShuffle %v4float %52 %52 1 3 0 2
-               OpStore %48 %53 None
-         %54 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
-         %55 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_float %55 %uint_0
-         %58 = OpLoad %float %56 None
-         %59 = OpAccessChain %_ptr_Workgroup_float %54 %uint_0
-               OpStore %59 %58 None
+         %49 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
+         %50 = OpAccessChain %_ptr_Uniform_float %49 %uint_0
+         %52 = OpLoad %float %50 None
+         %53 = OpAccessChain %_ptr_Workgroup_float %48 %uint_0
+               OpStore %53 %52 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %62
@@ -126,21 +126,21 @@
                OpLoopMerge %78 %76 None
                OpBranch %75
          %75 = OpLabel
-         %81 = OpUGreaterThanEqual %bool %79 %uint_4
-               OpSelectionMerge %82 None
-               OpBranchConditional %81 %83 %82
-         %83 = OpLabel
+         %82 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %83 None
+               OpBranchConditional %82 %84 %83
+         %84 = OpLabel
                OpBranch %78
-         %82 = OpLabel
-         %84 = OpAccessChain %_ptr_Function_mat2v4float %69 %79
-         %86 = OpLoad %mat2v4float %84 None
-         %87 = OpAccessChain %_ptr_Function_mat2v4float %71 %79
-               OpStore %87 %86 None
+         %83 = OpLabel
+         %85 = OpAccessChain %_ptr_Function_mat2v4float %69 %79
+         %87 = OpLoad %mat2v4float %85 None
+         %88 = OpAccessChain %_ptr_Function_mat2v4float %71 %79
+               OpStore %88 %87 None
                OpBranch %76
          %76 = OpLabel
          %80 = OpIAdd %uint %79 %uint_1
                OpBranch %77
          %78 = OpLabel
-         %88 = OpLoad %_arr_mat2v4float_uint_4_0 %71 None
-               OpReturnValue %88
+         %81 = OpLoad %_arr_mat2v4float_uint_4_0 %71 None
+               OpReturnValue %81
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index e66c217..81a5773 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -72,9 +72,9 @@
 %_arr_mat3v3float_uint_4 = OpTypeArray %mat3v3float %uint_4
 %_ptr_Function__arr_mat3v3float_uint_4 = OpTypePointer Function %_arr_mat3v3float_uint_4
          %64 = OpConstantNull %_arr_mat3v3float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %95 = OpTypeFunction %_arr_mat3x3_f32_std140_uint_4_0 %_arr_mat3x3_f32_std140_uint_4
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4
         %100 = OpConstantNull %_arr_mat3x3_f32_std140_uint_4_0
@@ -119,35 +119,35 @@
                OpLoopMerge %69 %67 None
                OpBranch %66
          %66 = OpLabel
-         %72 = OpUGreaterThanEqual %bool %70 %uint_4
-               OpSelectionMerge %74 None
-               OpBranchConditional %72 %75 %74
-         %75 = OpLabel
+         %82 = OpUGreaterThanEqual %bool %70 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %82 %85 %84
+         %85 = OpLabel
                OpBranch %69
-         %74 = OpLabel
-         %76 = OpAccessChain %_ptr_Function_mat3v3float %61 %70
-         %77 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %59 %70
-         %79 = OpLoad %mat3x3_f32_std140 %77 None
-         %80 = OpCompositeExtract %v3float %79 0
-         %81 = OpCompositeExtract %v3float %79 1
-         %82 = OpCompositeExtract %v3float %79 2
-         %83 = OpCompositeConstruct %mat3v3float %80 %81 %82
-               OpStore %76 %83 None
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_mat3v3float %61 %70
+         %87 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %59 %70
+         %89 = OpLoad %mat3x3_f32_std140 %87 None
+         %90 = OpCompositeExtract %v3float %89 0
+         %91 = OpCompositeExtract %v3float %89 1
+         %92 = OpCompositeExtract %v3float %89 2
+         %93 = OpCompositeConstruct %mat3v3float %90 %91 %92
+               OpStore %86 %93 None
                OpBranch %67
          %67 = OpLabel
          %71 = OpIAdd %uint %70 %uint_1
                OpBranch %68
          %69 = OpLabel
         %l_a = OpLoad %_arr_mat3v3float_uint_4 %61 None
-         %85 = OpCompositeExtract %float %l_a_i_i 0
-         %86 = OpCompositeExtract %float %l_a 0 0 0
-         %87 = OpFAdd %float %85 %86
-         %88 = OpCompositeExtract %float %l_a_i 0 0
-         %89 = OpFAdd %float %87 %88
-         %90 = OpCompositeExtract %float %l_a_i_i 0
-         %91 = OpFAdd %float %89 %90
-         %92 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %92 %91 None
+         %73 = OpCompositeExtract %float %l_a_i_i 0
+         %74 = OpCompositeExtract %float %l_a 0 0 0
+         %75 = OpFAdd %float %73 %74
+         %76 = OpCompositeExtract %float %l_a_i 0 0
+         %77 = OpFAdd %float %75 %76
+         %78 = OpCompositeExtract %float %l_a_i_i 0
+         %79 = OpFAdd %float %77 %78
+         %80 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %80 %79 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat3x3_f32_std140_uint_4_0 None %95
@@ -164,21 +164,21 @@
                OpLoopMerge %105 %103 None
                OpBranch %102
         %102 = OpLabel
-        %108 = OpUGreaterThanEqual %bool %106 %uint_4
-               OpSelectionMerge %109 None
-               OpBranchConditional %108 %110 %109
-        %110 = OpLabel
+        %109 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %110 None
+               OpBranchConditional %109 %111 %110
+        %111 = OpLabel
                OpBranch %105
-        %109 = OpLabel
-        %111 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %97 %106
-        %112 = OpLoad %mat3x3_f32_std140 %111 None
-        %113 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %99 %106
-               OpStore %113 %112 None
+        %110 = OpLabel
+        %112 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %97 %106
+        %113 = OpLoad %mat3x3_f32_std140 %112 None
+        %114 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %99 %106
+               OpStore %114 %113 None
                OpBranch %103
         %103 = OpLabel
         %107 = OpIAdd %uint %106 %uint_1
                OpBranch %104
         %105 = OpLabel
-        %114 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %99 None
-               OpReturnValue %114
+        %108 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %99 None
+               OpReturnValue %108
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm
index 663af67..a7bc48c 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -60,10 +60,10 @@
 %_arr_mat3v3float_uint_4 = OpTypeArray %mat3v3float %uint_4
 %_ptr_Function__arr_mat3v3float_uint_4 = OpTypePointer Function %_arr_mat3v3float_uint_4
          %41 = OpConstantNull %_arr_mat3v3float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
 %_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %73 = OpTypeFunction %_arr_mat3x3_f32_std140_uint_4_0 %_arr_mat3x3_f32_std140_uint_4
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4
          %78 = OpConstantNull %_arr_mat3x3_f32_std140_uint_4_0
@@ -91,35 +91,35 @@
                OpLoopMerge %46 %44 None
                OpBranch %43
          %43 = OpLabel
-         %49 = OpUGreaterThanEqual %bool %47 %uint_4
-               OpSelectionMerge %51 None
-               OpBranchConditional %49 %52 %51
-         %52 = OpLabel
+         %59 = OpUGreaterThanEqual %bool %47 %uint_4
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %61
+         %62 = OpLabel
                OpBranch %46
-         %51 = OpLabel
-         %53 = OpAccessChain %_ptr_Function_mat3v3float %38 %47
-         %55 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %36 %47
-         %57 = OpLoad %mat3x3_f32_std140 %55 None
-         %58 = OpCompositeExtract %v3float %57 0
-         %59 = OpCompositeExtract %v3float %57 1
-         %60 = OpCompositeExtract %v3float %57 2
-         %61 = OpCompositeConstruct %mat3v3float %58 %59 %60
-               OpStore %53 %61 None
+         %61 = OpLabel
+         %63 = OpAccessChain %_ptr_Function_mat3v3float %38 %47
+         %65 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %36 %47
+         %67 = OpLoad %mat3x3_f32_std140 %65 None
+         %68 = OpCompositeExtract %v3float %67 0
+         %69 = OpCompositeExtract %v3float %67 1
+         %70 = OpCompositeExtract %v3float %67 2
+         %71 = OpCompositeConstruct %mat3v3float %68 %69 %70
+               OpStore %63 %71 None
                OpBranch %44
          %44 = OpLabel
          %48 = OpIAdd %uint %47 %uint_1
                OpBranch %45
          %46 = OpLabel
         %l_a = OpLoad %_arr_mat3v3float_uint_4 %38 None
-         %63 = OpCompositeExtract %float %l_a_i_i 0
-         %64 = OpCompositeExtract %float %l_a 0 0 0
-         %65 = OpFAdd %float %63 %64
-         %66 = OpCompositeExtract %float %l_a_i 0 0
-         %67 = OpFAdd %float %65 %66
-         %68 = OpCompositeExtract %float %l_a_i_i 0
-         %69 = OpFAdd %float %67 %68
-         %70 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %70 %69 None
+         %50 = OpCompositeExtract %float %l_a_i_i 0
+         %51 = OpCompositeExtract %float %l_a 0 0 0
+         %52 = OpFAdd %float %50 %51
+         %53 = OpCompositeExtract %float %l_a_i 0 0
+         %54 = OpFAdd %float %52 %53
+         %55 = OpCompositeExtract %float %l_a_i_i 0
+         %56 = OpFAdd %float %54 %55
+         %57 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %57 %56 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat3x3_f32_std140_uint_4_0 None %73
@@ -136,21 +136,21 @@
                OpLoopMerge %83 %81 None
                OpBranch %80
          %80 = OpLabel
-         %86 = OpUGreaterThanEqual %bool %84 %uint_4
-               OpSelectionMerge %87 None
-               OpBranchConditional %86 %88 %87
-         %88 = OpLabel
+         %87 = OpUGreaterThanEqual %bool %84 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %87 %89 %88
+         %89 = OpLabel
                OpBranch %83
-         %87 = OpLabel
-         %89 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %75 %84
-         %90 = OpLoad %mat3x3_f32_std140 %89 None
-         %91 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %77 %84
-               OpStore %91 %90 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %75 %84
+         %91 = OpLoad %mat3x3_f32_std140 %90 None
+         %92 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %77 %84
+               OpStore %92 %91 None
                OpBranch %81
          %81 = OpLabel
          %85 = OpIAdd %uint %84 %uint_1
                OpBranch %82
          %83 = OpLabel
-         %92 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %77 None
-               OpReturnValue %92
+         %86 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %77 None
+               OpReturnValue %86
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.spvasm
index 337cf5b..5f0429a 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.spvasm
@@ -66,13 +66,13 @@
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat3v3float_uint_4 = OpTypePointer Function %_arr_mat3v3float_uint_4
          %49 = OpConstantNull %_arr_mat3v3float_uint_4
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+     %uint_1 = OpConstant %uint 1
+     %uint_2 = OpConstant %uint 2
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
 %_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
-     %uint_1 = OpConstant %uint 1
-%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
-     %uint_2 = OpConstant %uint 2
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %98 = OpTypeFunction %_arr_mat3x3_f32_std140_uint_4_0 %_arr_mat3x3_f32_std140_uint_4
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4
         %103 = OpConstantNull %_arr_mat3x3_f32_std140_uint_4_0
@@ -115,49 +115,49 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat3v3float %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %45 %55
-         %65 = OpLoad %mat3x3_f32_std140 %63 None
-         %66 = OpCompositeExtract %v3float %65 0
-         %67 = OpCompositeExtract %v3float %65 1
-         %68 = OpCompositeExtract %v3float %65 2
-         %69 = OpCompositeConstruct %mat3v3float %66 %67 %68
-               OpStore %61 %69 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_mat3v3float %47 %55
+         %90 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %45 %55
+         %92 = OpLoad %mat3x3_f32_std140 %90 None
+         %93 = OpCompositeExtract %v3float %92 0
+         %94 = OpCompositeExtract %v3float %92 1
+         %95 = OpCompositeExtract %v3float %92 2
+         %96 = OpCompositeConstruct %mat3v3float %93 %94 %95
+               OpStore %88 %96 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %71 = OpLoad %_arr_mat3v3float_uint_4 %47 None
-         %72 = OpFunctionCall %float %a %71
-         %73 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %75 = OpLoad %v3float %73 None
-         %76 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_1
+         %57 = OpLoad %_arr_mat3v3float_uint_4 %47 None
+         %58 = OpFunctionCall %float %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v3float %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v3float %63 None
+         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_2
+         %67 = OpLoad %v3float %65 None
+         %68 = OpCompositeConstruct %mat3v3float %62 %64 %67
+         %69 = OpFunctionCall %float %b %68
+         %70 = OpFAdd %float %58 %69
+         %71 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
+         %72 = OpLoad %v3float %71 None
+         %73 = OpVectorShuffle %v3float %72 %72 2 0 1
+         %74 = OpFunctionCall %float %c %73
+         %75 = OpFAdd %float %70 %74
+         %76 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
          %77 = OpLoad %v3float %76 None
-         %78 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_2
-         %80 = OpLoad %v3float %78 None
-         %81 = OpCompositeConstruct %mat3v3float %75 %77 %80
-         %82 = OpFunctionCall %float %b %81
-         %83 = OpFAdd %float %72 %82
-         %84 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %85 = OpLoad %v3float %84 None
-         %86 = OpVectorShuffle %v3float %85 %85 2 0 1
-         %87 = OpFunctionCall %float %c %86
-         %88 = OpFAdd %float %83 %87
-         %89 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %90 = OpLoad %v3float %89 None
-         %91 = OpVectorShuffle %v3float %90 %90 2 0 1
-         %92 = OpCompositeExtract %float %91 0
-         %93 = OpFunctionCall %float %d %92
-         %94 = OpFAdd %float %88 %93
-         %95 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %95 %94 None
+         %78 = OpVectorShuffle %v3float %77 %77 2 0 1
+         %79 = OpCompositeExtract %float %78 0
+         %80 = OpFunctionCall %float %d %79
+         %81 = OpFAdd %float %75 %80
+         %82 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %82 %81 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat3x3_f32_std140_uint_4_0 None %98
@@ -174,21 +174,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %100 %109
-        %115 = OpLoad %mat3x3_f32_std140 %114 None
-        %116 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %102 %109
-               OpStore %116 %115 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %100 %109
+        %116 = OpLoad %mat3x3_f32_std140 %115 None
+        %117 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %102 %109
+               OpStore %117 %116 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %117 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %102 None
-               OpReturnValue %117
+        %111 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %102 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.spvasm
index 348efc9..4e66c4f 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.spvasm
@@ -57,17 +57,17 @@
 %_arr_mat3x3_f32_std140_uint_4_0 = OpTypeArray %mat3x3_f32_std140 %uint_4
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat3v3float_uint_4 = OpTypePointer Function %_arr_mat3v3float_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-%_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat3v3float = OpTypePointer Private %mat3v3float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_v3float = OpTypePointer Private %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Private_float = OpTypePointer Private %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
+%_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
          %84 = OpTypeFunction %_arr_mat3x3_f32_std140_uint_4_0 %_arr_mat3x3_f32_std140_uint_4
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4
          %89 = OpConstantNull %_arr_mat3x3_f32_std140_uint_4_0
@@ -87,52 +87,52 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %70 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %73 %72
+         %73 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat3v3float %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %29 %38
-         %48 = OpLoad %mat3x3_f32_std140 %46 None
-         %49 = OpCompositeExtract %v3float %48 0
-         %50 = OpCompositeExtract %v3float %48 1
-         %51 = OpCompositeExtract %v3float %48 2
-         %52 = OpCompositeConstruct %mat3v3float %49 %50 %51
-               OpStore %44 %52 None
+         %72 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_mat3v3float %31 %38
+         %76 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %29 %38
+         %78 = OpLoad %mat3x3_f32_std140 %76 None
+         %79 = OpCompositeExtract %v3float %78 0
+         %80 = OpCompositeExtract %v3float %78 1
+         %81 = OpCompositeExtract %v3float %78 2
+         %82 = OpCompositeConstruct %mat3v3float %79 %80 %81
+               OpStore %74 %82 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %54 = OpLoad %_arr_mat3v3float_uint_4 %31 None
-               OpStore %p %54 None
-         %55 = OpAccessChain %_ptr_Private_mat3v3float %p %uint_1
-         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %60 = OpLoad %v3float %57 None
-         %61 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %62 = OpLoad %v3float %61 None
-         %63 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %64 = OpLoad %v3float %63 None
-         %65 = OpCompositeConstruct %mat3v3float %60 %62 %64
-               OpStore %55 %65 None
-         %66 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %68 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %69 = OpLoad %v3float %68 None
-         %70 = OpVectorShuffle %v3float %69 %69 2 0 1
-               OpStore %66 %70 None
-         %71 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_float %72 %uint_0
-         %75 = OpLoad %float %73 None
-         %76 = OpAccessChain %_ptr_Private_float %71 %uint_0
-               OpStore %76 %75 None
-         %78 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Private_float %78 %uint_0
-         %80 = OpLoad %float %79 None
-         %81 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %81 %80 None
+         %40 = OpLoad %_arr_mat3v3float_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat3v3float %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v3float %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v3float %48 None
+         %50 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %51 = OpLoad %v3float %50 None
+         %52 = OpCompositeConstruct %mat3v3float %47 %49 %51
+               OpStore %41 %52 None
+         %53 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %55 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %56 = OpLoad %v3float %55 None
+         %57 = OpVectorShuffle %v3float %56 %56 2 0 1
+               OpStore %53 %57 None
+         %58 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %60 = OpAccessChain %_ptr_Uniform_float %59 %uint_0
+         %62 = OpLoad %float %60 None
+         %63 = OpAccessChain %_ptr_Private_float %58 %uint_0
+               OpStore %63 %62 None
+         %65 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %66 = OpAccessChain %_ptr_Private_float %65 %uint_0
+         %67 = OpLoad %float %66 None
+         %68 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %68 %67 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat3x3_f32_std140_uint_4_0 None %84
@@ -149,21 +149,21 @@
                OpLoopMerge %94 %92 None
                OpBranch %91
          %91 = OpLabel
-         %97 = OpUGreaterThanEqual %bool %95 %uint_4
-               OpSelectionMerge %98 None
-               OpBranchConditional %97 %99 %98
-         %99 = OpLabel
+         %98 = OpUGreaterThanEqual %bool %95 %uint_4
+               OpSelectionMerge %99 None
+               OpBranchConditional %98 %100 %99
+        %100 = OpLabel
                OpBranch %94
-         %98 = OpLabel
-        %100 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %86 %95
-        %101 = OpLoad %mat3x3_f32_std140 %100 None
-        %102 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %88 %95
-               OpStore %102 %101 None
+         %99 = OpLabel
+        %101 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %86 %95
+        %102 = OpLoad %mat3x3_f32_std140 %101 None
+        %103 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %88 %95
+               OpStore %103 %102 None
                OpBranch %92
          %92 = OpLabel
          %96 = OpIAdd %uint %95 %uint_1
                OpBranch %93
          %94 = OpLabel
-        %103 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %88 None
-               OpReturnValue %103
+         %97 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %88 None
+               OpReturnValue %97
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.spvasm
index b814ad1..98bd770 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.spvasm
@@ -63,16 +63,16 @@
 %_arr_mat3v3float_uint_4_0 = OpTypeArray %mat3v3float %uint_4
 %_ptr_Function__arr_mat3v3float_uint_4_0 = OpTypePointer Function %_arr_mat3v3float_uint_4_0
          %31 = OpConstantNull %_arr_mat3v3float_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-%_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
+%_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
          %82 = OpTypeFunction %void %_arr_mat3v3float_uint_4_0
         %101 = OpTypeFunction %void %_arr_uint_uint_1 %mat3v3float
         %111 = OpTypeFunction %_arr_mat3x3_f32_std140_uint_4_0 %_arr_mat3x3_f32_std140_uint_4
@@ -94,47 +94,47 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %68 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %70 None
+               OpBranchConditional %68 %71 %70
+         %71 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat3v3float %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %26 %37
-         %47 = OpLoad %mat3x3_f32_std140 %45 None
-         %48 = OpCompositeExtract %v3float %47 0
-         %49 = OpCompositeExtract %v3float %47 1
-         %50 = OpCompositeExtract %v3float %47 2
-         %51 = OpCompositeConstruct %mat3v3float %48 %49 %50
-               OpStore %43 %51 None
+         %70 = OpLabel
+         %72 = OpAccessChain %_ptr_Function_mat3v3float %28 %37
+         %74 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %26 %37
+         %76 = OpLoad %mat3x3_f32_std140 %74 None
+         %77 = OpCompositeExtract %v3float %76 0
+         %78 = OpCompositeExtract %v3float %76 1
+         %79 = OpCompositeExtract %v3float %76 2
+         %80 = OpCompositeConstruct %mat3v3float %77 %78 %79
+               OpStore %72 %80 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %53 = OpLoad %_arr_mat3v3float_uint_4_0 %28 None
-         %54 = OpFunctionCall %void %tint_store_and_preserve_padding %53
-         %56 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %59 = OpLoad %v3float %56 None
-         %60 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %61 = OpLoad %v3float %60 None
-         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %63 = OpLoad %v3float %62 None
-         %64 = OpCompositeConstruct %mat3v3float %59 %61 %63
-         %66 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %67 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %66 %64
-         %69 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
-         %71 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %72 = OpLoad %v3float %71 None
-         %73 = OpVectorShuffle %v3float %72 %72 2 0 1
-               OpStore %69 %73 None
-         %74 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
-         %75 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %76 = OpAccessChain %_ptr_Uniform_float %75 %uint_0
-         %78 = OpLoad %float %76 None
-         %79 = OpAccessChain %_ptr_StorageBuffer_float %74 %uint_0
-               OpStore %79 %78 None
+         %39 = OpLoad %_arr_mat3v3float_uint_4_0 %28 None
+         %40 = OpFunctionCall %void %tint_store_and_preserve_padding %39
+         %42 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %45 = OpLoad %v3float %42 None
+         %46 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %48 = OpLoad %v3float %46 None
+         %49 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %50 = OpLoad %v3float %49 None
+         %51 = OpCompositeConstruct %mat3v3float %45 %48 %50
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %51
+         %56 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
+         %58 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %59 = OpLoad %v3float %58 None
+         %60 = OpVectorShuffle %v3float %59 %59 2 0 1
+               OpStore %56 %60 None
+         %61 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %63 = OpAccessChain %_ptr_Uniform_float %62 %uint_0
+         %65 = OpLoad %float %63 None
+         %66 = OpAccessChain %_ptr_StorageBuffer_float %61 %uint_0
+               OpStore %66 %65 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %82
@@ -197,21 +197,21 @@
                OpLoopMerge %121 %119 None
                OpBranch %118
         %118 = OpLabel
-        %124 = OpUGreaterThanEqual %bool %122 %uint_4
-               OpSelectionMerge %125 None
-               OpBranchConditional %124 %126 %125
-        %126 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %122 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %121
-        %125 = OpLabel
-        %127 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %113 %122
-        %128 = OpLoad %mat3x3_f32_std140 %127 None
-        %129 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %115 %122
-               OpStore %129 %128 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %113 %122
+        %129 = OpLoad %mat3x3_f32_std140 %128 None
+        %130 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %115 %122
+               OpStore %130 %129 None
                OpBranch %119
         %119 = OpLabel
         %123 = OpIAdd %uint %122 %uint_1
                OpBranch %120
         %121 = OpLabel
-        %130 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %115 None
-               OpReturnValue %130
+        %124 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %115 None
+               OpReturnValue %124
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
index 8bc1eb6..06c3146 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -47,10 +47,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat3v3float = OpTypePointer Workgroup %mat3v3float
-         %34 = OpConstantNull %mat3v3float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat3x3_f32_std140_uint_4 = OpTypePointer Uniform %_arr_mat3x3_f32_std140_uint_4
@@ -58,13 +54,17 @@
 %_arr_mat3x3_f32_std140_uint_4_0 = OpTypeArray %mat3x3_f32_std140 %uint_4
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat3v3float_uint_4 = OpTypePointer Function %_arr_mat3v3float_uint_4
-         %50 = OpConstantNull %_arr_mat3v3float_uint_4
-%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
-%_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
+         %42 = OpConstantNull %_arr_mat3v3float_uint_4
+%_ptr_Workgroup_mat3v3float = OpTypePointer Workgroup %mat3v3float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %79 = OpConstantNull %mat3v3float
+%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
+%_ptr_Function_mat3x3_f32_std140 = OpTypePointer Function %mat3x3_f32_std140
          %93 = OpTypeFunction %void
          %98 = OpTypeFunction %_arr_mat3x3_f32_std140_uint_4_0 %_arr_mat3x3_f32_std140_uint_4
 %_ptr_Function__arr_mat3x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat3x3_f32_std140_uint_4
@@ -72,8 +72,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat3x3_f32_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat3v3float_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat3x3_f32_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat3v3float_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -82,73 +82,73 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %74 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %76 None
+               OpBranchConditional %74 %77 %76
+         %77 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat3v3float %w %26
-               OpStore %32 %34 None
+         %76 = OpLabel
+         %78 = OpAccessChain %_ptr_Workgroup_mat3v3float %w %26
+               OpStore %78 %79 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat3x3_f32_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat3x3_f32_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat3x3_f32_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat3v3float %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %46 %56
-         %65 = OpLoad %mat3x3_f32_std140 %63 None
-         %66 = OpCompositeExtract %v3float %65 0
-         %67 = OpCompositeExtract %v3float %65 1
-         %68 = OpCompositeExtract %v3float %65 2
-         %69 = OpCompositeConstruct %mat3v3float %66 %67 %68
-               OpStore %61 %69 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %70 = OpLoad %_arr_mat3v3float_uint_4 %48 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_mat3v3float %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %74 = OpLoad %v3float %72 None
-         %75 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %76 = OpLoad %v3float %75 None
-         %77 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %78 = OpLoad %v3float %77 None
-         %79 = OpCompositeConstruct %mat3v3float %74 %76 %78
-               OpStore %71 %79 None
-         %80 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %83 = OpLoad %v3float %82 None
-         %84 = OpVectorShuffle %v3float %83 %83 2 0 1
-               OpStore %80 %84 None
-         %85 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
-         %86 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %87 = OpAccessChain %_ptr_Uniform_float %86 %uint_0
-         %89 = OpLoad %float %87 None
-         %90 = OpAccessChain %_ptr_Workgroup_float %85 %uint_0
-               OpStore %90 %89 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat3x3_f32_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat3x3_f32_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat3x3_f32_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %80 %82 %81
+         %82 = OpLabel
+               OpBranch %47
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Function_mat3v3float %40 %48
+         %85 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %38 %48
+         %87 = OpLoad %mat3x3_f32_std140 %85 None
+         %88 = OpCompositeExtract %v3float %87 0
+         %89 = OpCompositeExtract %v3float %87 1
+         %90 = OpCompositeExtract %v3float %87 2
+         %91 = OpCompositeConstruct %mat3v3float %88 %89 %90
+               OpStore %83 %91 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat3v3float_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat3v3float %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v3float %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3float %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3float %59 None
+         %61 = OpCompositeConstruct %mat3v3float %56 %58 %60
+               OpStore %51 %61 None
+         %62 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
+         %64 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %65 = OpLoad %v3float %64 None
+         %66 = OpVectorShuffle %v3float %65 %65 2 0 1
+               OpStore %62 %66 None
+         %67 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
+         %68 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %69 = OpAccessChain %_ptr_Uniform_float %68 %uint_0
+         %71 = OpLoad %float %69 None
+         %72 = OpAccessChain %_ptr_Workgroup_float %67 %uint_0
+               OpStore %72 %71 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %93
@@ -171,21 +171,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %100 %109
-        %115 = OpLoad %mat3x3_f32_std140 %114 None
-        %116 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %102 %109
-               OpStore %116 %115 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %100 %109
+        %116 = OpLoad %mat3x3_f32_std140 %115 None
+        %117 = OpAccessChain %_ptr_Function_mat3x3_f32_std140 %102 %109
+               OpStore %117 %116 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %117 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %102 None
-               OpReturnValue %117
+        %111 = OpLoad %_arr_mat3x3_f32_std140_uint_4_0 %102 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 2d11d73..2ac6f4f 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -121,21 +121,21 @@
                OpLoopMerge %73 %71 None
                OpBranch %70
          %70 = OpLabel
-         %76 = OpUGreaterThanEqual %bool %74 %uint_4
-               OpSelectionMerge %78 None
-               OpBranchConditional %76 %79 %78
-         %79 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %74 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %73
-         %78 = OpLabel
-         %80 = OpAccessChain %_ptr_Function_mat3v4float %64 %74
-         %82 = OpLoad %mat3v4float %80 None
-         %83 = OpAccessChain %_ptr_Function_mat3v4float %66 %74
-               OpStore %83 %82 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Function_mat3v4float %64 %74
+         %83 = OpLoad %mat3v4float %81 None
+         %84 = OpAccessChain %_ptr_Function_mat3v4float %66 %74
+               OpStore %84 %83 None
                OpBranch %71
          %71 = OpLabel
          %75 = OpIAdd %uint %74 %uint_1
                OpBranch %72
          %73 = OpLabel
-         %85 = OpLoad %_arr_mat3v4float_uint_4_0 %66 None
-               OpReturnValue %85
+         %76 = OpLoad %_arr_mat3v4float_uint_4_0 %66 None
+               OpReturnValue %76
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm
index 300df86..0ff06cd 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -97,21 +97,21 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %59 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %61
+         %62 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_mat3v4float %46 %56
-         %64 = OpLoad %mat3v4float %62 None
-         %65 = OpAccessChain %_ptr_Function_mat3v4float %48 %56
-               OpStore %65 %64 None
+         %61 = OpLabel
+         %63 = OpAccessChain %_ptr_Function_mat3v4float %46 %56
+         %65 = OpLoad %mat3v4float %63 None
+         %66 = OpAccessChain %_ptr_Function_mat3v4float %48 %56
+               OpStore %66 %65 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
-         %66 = OpLoad %_arr_mat3v4float_uint_4_0 %48 None
-               OpReturnValue %66
+         %58 = OpLoad %_arr_mat3v4float_uint_4_0 %48 None
+               OpReturnValue %58
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.spvasm
index 481f961..1ca2a36 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.spvasm
@@ -128,21 +128,21 @@
                OpLoopMerge %76 %74 None
                OpBranch %73
          %73 = OpLabel
-         %79 = OpUGreaterThanEqual %bool %77 %uint_4
-               OpSelectionMerge %81 None
-               OpBranchConditional %79 %82 %81
-         %82 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %80 %83 %82
+         %83 = OpLabel
                OpBranch %76
-         %81 = OpLabel
-         %83 = OpAccessChain %_ptr_Function_mat3v4float %67 %77
-         %85 = OpLoad %mat3v4float %83 None
-         %86 = OpAccessChain %_ptr_Function_mat3v4float %69 %77
-               OpStore %86 %85 None
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_mat3v4float %67 %77
+         %86 = OpLoad %mat3v4float %84 None
+         %87 = OpAccessChain %_ptr_Function_mat3v4float %69 %77
+               OpStore %87 %86 None
                OpBranch %74
          %74 = OpLabel
          %78 = OpIAdd %uint %77 %uint_1
                OpBranch %75
          %76 = OpLabel
-         %87 = OpLoad %_arr_mat3v4float_uint_4_0 %69 None
-               OpReturnValue %87
+         %79 = OpLoad %_arr_mat3v4float_uint_4_0 %69 None
+               OpReturnValue %79
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.spvasm
index a00ea79..ee9852c 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.spvasm
@@ -104,21 +104,21 @@
                OpLoopMerge %63 %61 None
                OpBranch %60
          %60 = OpLabel
-         %66 = OpUGreaterThanEqual %bool %64 %uint_4
-               OpSelectionMerge %68 None
-               OpBranchConditional %66 %69 %68
-         %69 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %64 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %63
-         %68 = OpLabel
-         %70 = OpAccessChain %_ptr_Function_mat3v4float %55 %64
-         %72 = OpLoad %mat3v4float %70 None
-         %73 = OpAccessChain %_ptr_Function_mat3v4float %57 %64
-               OpStore %73 %72 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_mat3v4float %55 %64
+         %73 = OpLoad %mat3v4float %71 None
+         %74 = OpAccessChain %_ptr_Function_mat3v4float %57 %64
+               OpStore %74 %73 None
                OpBranch %61
          %61 = OpLabel
          %65 = OpIAdd %uint %64 %uint_1
                OpBranch %62
          %63 = OpLabel
-         %74 = OpLoad %_arr_mat3v4float_uint_4_0 %57 None
-               OpReturnValue %74
+         %66 = OpLoad %_arr_mat3v4float_uint_4_0 %57 None
+               OpReturnValue %66
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.spvasm
index 3463da4..3342b65 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.spvasm
@@ -104,23 +104,23 @@
                OpLoopMerge %60 %58 None
                OpBranch %57
          %57 = OpLabel
-         %63 = OpUGreaterThanEqual %bool %61 %uint_4
-               OpSelectionMerge %65 None
-               OpBranchConditional %63 %66 %65
-         %66 = OpLabel
+         %64 = OpUGreaterThanEqual %bool %61 %uint_4
+               OpSelectionMerge %66 None
+               OpBranchConditional %64 %67 %66
+         %67 = OpLabel
                OpBranch %60
-         %65 = OpLabel
-         %67 = OpAccessChain %_ptr_Function_mat3v4float %51 %61
-         %69 = OpLoad %mat3v4float %67 None
-         %70 = OpAccessChain %_ptr_Function_mat3v4float %53 %61
-               OpStore %70 %69 None
+         %66 = OpLabel
+         %68 = OpAccessChain %_ptr_Function_mat3v4float %51 %61
+         %70 = OpLoad %mat3v4float %68 None
+         %71 = OpAccessChain %_ptr_Function_mat3v4float %53 %61
+               OpStore %71 %70 None
                OpBranch %58
          %58 = OpLabel
          %62 = OpIAdd %uint %61 %uint_1
                OpBranch %59
          %60 = OpLabel
-         %71 = OpLoad %_arr_mat3v4float_uint_4_0 %53 None
-               OpReturnValue %71
+         %63 = OpLoad %_arr_mat3v4float_uint_4_0 %53 None
+               OpReturnValue %63
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat3v4float_uint_4 None %73
 %tint_source_0 = OpFunctionParameter %_arr_mat3v4float_uint_4_0
@@ -136,21 +136,21 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %86 None
-               OpBranchConditional %85 %87 %86
-         %87 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %87 None
+               OpBranchConditional %86 %88 %87
+         %88 = OpLabel
                OpBranch %82
-         %86 = OpLabel
-         %88 = OpAccessChain %_ptr_Function_mat3v4float %75 %83
-         %89 = OpLoad %mat3v4float %88 None
-         %90 = OpAccessChain %_ptr_Function_mat3v4float %76 %83
-               OpStore %90 %89 None
+         %87 = OpLabel
+         %89 = OpAccessChain %_ptr_Function_mat3v4float %75 %83
+         %90 = OpLoad %mat3v4float %89 None
+         %91 = OpAccessChain %_ptr_Function_mat3v4float %76 %83
+               OpStore %91 %90 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
-         %91 = OpLoad %_arr_mat3v4float_uint_4 %76 None
-               OpReturnValue %91
+         %85 = OpLoad %_arr_mat3v4float_uint_4 %76 None
+               OpReturnValue %85
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
index 4705ed8..a52ae73 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -41,19 +41,19 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %18 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat3v4float = OpTypePointer Workgroup %mat3v4float
-         %33 = OpConstantNull %mat3v4float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat3v4float_uint_4 = OpTypePointer Uniform %_arr_mat3v4float_uint_4
      %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_mat3v4float = OpTypePointer Workgroup %mat3v4float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_mat3v4float = OpTypePointer Uniform %mat3v4float
 %_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %60 = OpConstantNull %mat3v4float
          %62 = OpTypeFunction %void
          %67 = OpTypeFunction %_arr_mat3v4float_uint_4_0 %_arr_mat3v4float_uint_4
 %_ptr_Function__arr_mat3v4float_uint_4 = OpTypePointer Function %_arr_mat3v4float_uint_4
@@ -71,39 +71,39 @@
                OpLoopMerge %24 %22 None
                OpBranch %21
          %21 = OpLabel
-         %27 = OpUGreaterThanEqual %bool %25 %uint_4
-               OpSelectionMerge %29 None
-               OpBranchConditional %27 %30 %29
-         %30 = OpLabel
+         %55 = OpUGreaterThanEqual %bool %25 %uint_4
+               OpSelectionMerge %57 None
+               OpBranchConditional %55 %58 %57
+         %58 = OpLabel
                OpBranch %24
-         %29 = OpLabel
-         %31 = OpAccessChain %_ptr_Workgroup_mat3v4float %w %25
-               OpStore %31 %33 None
+         %57 = OpLabel
+         %59 = OpAccessChain %_ptr_Workgroup_mat3v4float %w %25
+               OpStore %59 %60 None
                OpBranch %22
          %22 = OpLabel
          %26 = OpIAdd %uint %25 %uint_1
                OpBranch %23
          %24 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %38 = OpAccessChain %_ptr_Uniform__arr_mat3v4float_uint_4 %1 %uint_0
-         %41 = OpLoad %_arr_mat3v4float_uint_4 %38 None
-         %42 = OpFunctionCall %_arr_mat3v4float_uint_4_0 %tint_convert_explicit_layout %41
-               OpStore %w %42 None
-         %44 = OpAccessChain %_ptr_Workgroup_mat3v4float %w %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_mat3v4float %1 %uint_0 %uint_2
-         %47 = OpLoad %mat3v4float %45 None
-               OpStore %44 %47 None
+         %30 = OpAccessChain %_ptr_Uniform__arr_mat3v4float_uint_4 %1 %uint_0
+         %33 = OpLoad %_arr_mat3v4float_uint_4 %30 None
+         %34 = OpFunctionCall %_arr_mat3v4float_uint_4_0 %tint_convert_explicit_layout %33
+               OpStore %w %34 None
+         %36 = OpAccessChain %_ptr_Workgroup_mat3v4float %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_mat3v4float %1 %uint_0 %uint_2
+         %41 = OpLoad %mat3v4float %39 None
+               OpStore %36 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
+         %44 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
+         %46 = OpLoad %v4float %44 None
+         %47 = OpVectorShuffle %v4float %46 %46 1 3 0 2
+               OpStore %42 %47 None
          %48 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
-         %50 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
-         %52 = OpLoad %v4float %50 None
-         %53 = OpVectorShuffle %v4float %52 %52 1 3 0 2
-               OpStore %48 %53 None
-         %54 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
-         %55 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_float %55 %uint_0
-         %58 = OpLoad %float %56 None
-         %59 = OpAccessChain %_ptr_Workgroup_float %54 %uint_0
-               OpStore %59 %58 None
+         %49 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
+         %50 = OpAccessChain %_ptr_Uniform_float %49 %uint_0
+         %52 = OpLoad %float %50 None
+         %53 = OpAccessChain %_ptr_Workgroup_float %48 %uint_0
+               OpStore %53 %52 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %62
@@ -126,21 +126,21 @@
                OpLoopMerge %78 %76 None
                OpBranch %75
          %75 = OpLabel
-         %81 = OpUGreaterThanEqual %bool %79 %uint_4
-               OpSelectionMerge %82 None
-               OpBranchConditional %81 %83 %82
-         %83 = OpLabel
+         %82 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %83 None
+               OpBranchConditional %82 %84 %83
+         %84 = OpLabel
                OpBranch %78
-         %82 = OpLabel
-         %84 = OpAccessChain %_ptr_Function_mat3v4float %69 %79
-         %86 = OpLoad %mat3v4float %84 None
-         %87 = OpAccessChain %_ptr_Function_mat3v4float %71 %79
-               OpStore %87 %86 None
+         %83 = OpLabel
+         %85 = OpAccessChain %_ptr_Function_mat3v4float %69 %79
+         %87 = OpLoad %mat3v4float %85 None
+         %88 = OpAccessChain %_ptr_Function_mat3v4float %71 %79
+               OpStore %88 %87 None
                OpBranch %76
          %76 = OpLabel
          %80 = OpIAdd %uint %79 %uint_1
                OpBranch %77
          %78 = OpLabel
-         %88 = OpLoad %_arr_mat3v4float_uint_4_0 %71 None
-               OpReturnValue %88
+         %81 = OpLoad %_arr_mat3v4float_uint_4_0 %71 None
+               OpReturnValue %81
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index bfa007a..167cfdc 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -77,9 +77,9 @@
 %_arr_mat4v2half_uint_4 = OpTypeArray %mat4v2half %uint_4
 %_ptr_Function__arr_mat4v2half_uint_4 = OpTypePointer Function %_arr_mat4v2half_uint_4
          %66 = OpConstantNull %_arr_mat4v2half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %98 = OpTypeFunction %_arr_mat4x2_f16_std140_uint_4_0 %_arr_mat4x2_f16_std140_uint_4
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4
         %103 = OpConstantNull %_arr_mat4x2_f16_std140_uint_4_0
@@ -126,36 +126,36 @@
                OpLoopMerge %71 %69 None
                OpBranch %68
          %68 = OpLabel
-         %74 = OpUGreaterThanEqual %bool %72 %uint_4
-               OpSelectionMerge %76 None
-               OpBranchConditional %74 %77 %76
-         %77 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %72 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %71
-         %76 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_mat4v2half %63 %72
-         %79 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %61 %72
-         %81 = OpLoad %mat4x2_f16_std140 %79 None
-         %82 = OpCompositeExtract %v2half %81 0
-         %83 = OpCompositeExtract %v2half %81 1
-         %84 = OpCompositeExtract %v2half %81 2
-         %85 = OpCompositeExtract %v2half %81 3
-         %86 = OpCompositeConstruct %mat4v2half %82 %83 %84 %85
-               OpStore %78 %86 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_mat4v2half %63 %72
+         %89 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %61 %72
+         %91 = OpLoad %mat4x2_f16_std140 %89 None
+         %92 = OpCompositeExtract %v2half %91 0
+         %93 = OpCompositeExtract %v2half %91 1
+         %94 = OpCompositeExtract %v2half %91 2
+         %95 = OpCompositeExtract %v2half %91 3
+         %96 = OpCompositeConstruct %mat4v2half %92 %93 %94 %95
+               OpStore %88 %96 None
                OpBranch %69
          %69 = OpLabel
          %73 = OpIAdd %uint %72 %uint_1
                OpBranch %70
          %71 = OpLabel
         %l_a = OpLoad %_arr_mat4v2half_uint_4 %63 None
-         %88 = OpCompositeExtract %half %l_a_i_i 0
-         %89 = OpCompositeExtract %half %l_a 0 0 0
-         %90 = OpFAdd %half %88 %89
-         %91 = OpCompositeExtract %half %l_a_i 0 0
-         %92 = OpFAdd %half %90 %91
-         %93 = OpCompositeExtract %half %l_a_i_i 0
-         %94 = OpFAdd %half %92 %93
-         %95 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %95 %94 None
+         %75 = OpCompositeExtract %half %l_a_i_i 0
+         %76 = OpCompositeExtract %half %l_a 0 0 0
+         %77 = OpFAdd %half %75 %76
+         %78 = OpCompositeExtract %half %l_a_i 0 0
+         %79 = OpFAdd %half %77 %78
+         %80 = OpCompositeExtract %half %l_a_i_i 0
+         %81 = OpFAdd %half %79 %80
+         %82 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %82 %81 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f16_std140_uint_4_0 None %98
@@ -172,21 +172,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %100 %109
-        %115 = OpLoad %mat4x2_f16_std140 %114 None
-        %116 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %102 %109
-               OpStore %116 %115 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %100 %109
+        %116 = OpLoad %mat4x2_f16_std140 %115 None
+        %117 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %102 %109
+               OpStore %117 %116 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %117 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %102 None
-               OpReturnValue %117
+        %111 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %102 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm
index 917da75..c326e62 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -66,10 +66,10 @@
 %_arr_mat4v2half_uint_4 = OpTypeArray %mat4v2half %uint_4
 %_ptr_Function__arr_mat4v2half_uint_4 = OpTypePointer Function %_arr_mat4v2half_uint_4
          %44 = OpConstantNull %_arr_mat4v2half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
 %_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %77 = OpTypeFunction %_arr_mat4x2_f16_std140_uint_4_0 %_arr_mat4x2_f16_std140_uint_4
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4
          %82 = OpConstantNull %_arr_mat4x2_f16_std140_uint_4_0
@@ -99,36 +99,36 @@
                OpLoopMerge %49 %47 None
                OpBranch %46
          %46 = OpLabel
-         %52 = OpUGreaterThanEqual %bool %50 %uint_4
-               OpSelectionMerge %54 None
-               OpBranchConditional %52 %55 %54
-         %55 = OpLabel
+         %62 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %64 None
+               OpBranchConditional %62 %65 %64
+         %65 = OpLabel
                OpBranch %49
-         %54 = OpLabel
-         %56 = OpAccessChain %_ptr_Function_mat4v2half %41 %50
-         %58 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %39 %50
-         %60 = OpLoad %mat4x2_f16_std140 %58 None
-         %61 = OpCompositeExtract %v2half %60 0
-         %62 = OpCompositeExtract %v2half %60 1
-         %63 = OpCompositeExtract %v2half %60 2
-         %64 = OpCompositeExtract %v2half %60 3
-         %65 = OpCompositeConstruct %mat4v2half %61 %62 %63 %64
-               OpStore %56 %65 None
+         %64 = OpLabel
+         %66 = OpAccessChain %_ptr_Function_mat4v2half %41 %50
+         %68 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %39 %50
+         %70 = OpLoad %mat4x2_f16_std140 %68 None
+         %71 = OpCompositeExtract %v2half %70 0
+         %72 = OpCompositeExtract %v2half %70 1
+         %73 = OpCompositeExtract %v2half %70 2
+         %74 = OpCompositeExtract %v2half %70 3
+         %75 = OpCompositeConstruct %mat4v2half %71 %72 %73 %74
+               OpStore %66 %75 None
                OpBranch %47
          %47 = OpLabel
          %51 = OpIAdd %uint %50 %uint_1
                OpBranch %48
          %49 = OpLabel
         %l_a = OpLoad %_arr_mat4v2half_uint_4 %41 None
-         %67 = OpCompositeExtract %half %l_a_i_i 0
-         %68 = OpCompositeExtract %half %l_a 0 0 0
-         %69 = OpFAdd %half %67 %68
-         %70 = OpCompositeExtract %half %l_a_i 0 0
-         %71 = OpFAdd %half %69 %70
-         %72 = OpCompositeExtract %half %l_a_i_i 0
-         %73 = OpFAdd %half %71 %72
-         %74 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %74 %73 None
+         %53 = OpCompositeExtract %half %l_a_i_i 0
+         %54 = OpCompositeExtract %half %l_a 0 0 0
+         %55 = OpFAdd %half %53 %54
+         %56 = OpCompositeExtract %half %l_a_i 0 0
+         %57 = OpFAdd %half %55 %56
+         %58 = OpCompositeExtract %half %l_a_i_i 0
+         %59 = OpFAdd %half %57 %58
+         %60 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %60 %59 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f16_std140_uint_4_0 None %77
@@ -145,21 +145,21 @@
                OpLoopMerge %87 %85 None
                OpBranch %84
          %84 = OpLabel
-         %90 = OpUGreaterThanEqual %bool %88 %uint_4
-               OpSelectionMerge %91 None
-               OpBranchConditional %90 %92 %91
-         %92 = OpLabel
+         %91 = OpUGreaterThanEqual %bool %88 %uint_4
+               OpSelectionMerge %92 None
+               OpBranchConditional %91 %93 %92
+         %93 = OpLabel
                OpBranch %87
-         %91 = OpLabel
-         %93 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %79 %88
-         %94 = OpLoad %mat4x2_f16_std140 %93 None
-         %95 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %81 %88
-               OpStore %95 %94 None
+         %92 = OpLabel
+         %94 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %79 %88
+         %95 = OpLoad %mat4x2_f16_std140 %94 None
+         %96 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %81 %88
+               OpStore %96 %95 None
                OpBranch %85
          %85 = OpLabel
          %89 = OpIAdd %uint %88 %uint_1
                OpBranch %86
          %87 = OpLabel
-         %96 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %81 None
-               OpReturnValue %96
+         %90 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %81 None
+               OpReturnValue %90
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.spvasm
index 695da9e..b143f72 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.spvasm
@@ -71,14 +71,14 @@
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v2half_uint_4 = OpTypePointer Function %_arr_mat4v2half_uint_4
          %49 = OpConstantNull %_arr_mat4v2half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
+     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
+%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
         %102 = OpTypeFunction %_arr_mat4x2_f16_std140_uint_4_0 %_arr_mat4x2_f16_std140_uint_4
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4
         %107 = OpConstantNull %_arr_mat4x2_f16_std140_uint_4_0
@@ -121,52 +121,52 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %87 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %89 None
+               OpBranchConditional %87 %90 %89
+         %90 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v2half %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %45 %55
-         %65 = OpLoad %mat4x2_f16_std140 %63 None
-         %66 = OpCompositeExtract %v2half %65 0
-         %67 = OpCompositeExtract %v2half %65 1
-         %68 = OpCompositeExtract %v2half %65 2
-         %69 = OpCompositeExtract %v2half %65 3
-         %70 = OpCompositeConstruct %mat4v2half %66 %67 %68 %69
-               OpStore %61 %70 None
+         %89 = OpLabel
+         %91 = OpAccessChain %_ptr_Function_mat4v2half %47 %55
+         %93 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %45 %55
+         %95 = OpLoad %mat4x2_f16_std140 %93 None
+         %96 = OpCompositeExtract %v2half %95 0
+         %97 = OpCompositeExtract %v2half %95 1
+         %98 = OpCompositeExtract %v2half %95 2
+         %99 = OpCompositeExtract %v2half %95 3
+        %100 = OpCompositeConstruct %mat4v2half %96 %97 %98 %99
+               OpStore %91 %100 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %72 = OpLoad %_arr_mat4v2half_uint_4 %47 None
-         %73 = OpFunctionCall %half %a %72
+         %57 = OpLoad %_arr_mat4v2half_uint_4 %47 None
+         %58 = OpFunctionCall %half %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v2half %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v2half %63 None
+         %65 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_2
+         %67 = OpLoad %v2half %65 None
+         %68 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_3
+         %70 = OpLoad %v2half %68 None
+         %71 = OpCompositeConstruct %mat4v2half %62 %64 %67 %70
+         %72 = OpFunctionCall %half %b %71
+         %73 = OpFAdd %half %58 %72
          %74 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_0
-         %76 = OpLoad %v2half %74 None
-         %77 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_1
-         %78 = OpLoad %v2half %77 None
-         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_2
-         %81 = OpLoad %v2half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_3
-         %84 = OpLoad %v2half %82 None
-         %85 = OpCompositeConstruct %mat4v2half %76 %78 %81 %84
-         %86 = OpFunctionCall %half %b %85
-         %87 = OpFAdd %half %73 %86
-         %88 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_0
-         %89 = OpLoad %v2half %88 None
-         %90 = OpVectorShuffle %v2half %89 %89 1 0
-         %91 = OpFunctionCall %half %c %90
-         %92 = OpFAdd %half %87 %91
-         %93 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_0
-         %94 = OpLoad %v2half %93 None
-         %95 = OpVectorShuffle %v2half %94 %94 1 0
-         %96 = OpCompositeExtract %half %95 0
-         %97 = OpFunctionCall %half %d %96
-         %98 = OpFAdd %half %92 %97
-         %99 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %99 %98 None
+         %75 = OpLoad %v2half %74 None
+         %76 = OpVectorShuffle %v2half %75 %75 1 0
+         %77 = OpFunctionCall %half %c %76
+         %78 = OpFAdd %half %73 %77
+         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_1 %uint_0
+         %80 = OpLoad %v2half %79 None
+         %81 = OpVectorShuffle %v2half %80 %80 1 0
+         %82 = OpCompositeExtract %half %81 0
+         %83 = OpFunctionCall %half %d %82
+         %84 = OpFAdd %half %78 %83
+         %85 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %85 %84 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f16_std140_uint_4_0 None %102
@@ -183,21 +183,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %104 %113
-        %119 = OpLoad %mat4x2_f16_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %104 %113
+        %120 = OpLoad %mat4x2_f16_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.spvasm
index b105098..cbc5f67 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.spvasm
@@ -62,11 +62,8 @@
 %_arr_mat4x2_f16_std140_uint_4_0 = OpTypeArray %mat4x2_f16_std140 %uint_4
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v2half_uint_4 = OpTypePointer Function %_arr_mat4v2half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat4v2half = OpTypePointer Private %mat4v2half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
@@ -74,6 +71,9 @@
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Private_half = OpTypePointer Private %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
+%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
          %88 = OpTypeFunction %_arr_mat4x2_f16_std140_uint_4_0 %_arr_mat4x2_f16_std140_uint_4
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4
          %93 = OpConstantNull %_arr_mat4x2_f16_std140_uint_4_0
@@ -93,55 +93,55 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %73 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %76 %75
+         %76 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat4v2half %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %29 %38
-         %48 = OpLoad %mat4x2_f16_std140 %46 None
-         %49 = OpCompositeExtract %v2half %48 0
-         %50 = OpCompositeExtract %v2half %48 1
-         %51 = OpCompositeExtract %v2half %48 2
-         %52 = OpCompositeExtract %v2half %48 3
-         %53 = OpCompositeConstruct %mat4v2half %49 %50 %51 %52
-               OpStore %44 %53 None
+         %75 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_mat4v2half %31 %38
+         %79 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %29 %38
+         %81 = OpLoad %mat4x2_f16_std140 %79 None
+         %82 = OpCompositeExtract %v2half %81 0
+         %83 = OpCompositeExtract %v2half %81 1
+         %84 = OpCompositeExtract %v2half %81 2
+         %85 = OpCompositeExtract %v2half %81 3
+         %86 = OpCompositeConstruct %mat4v2half %82 %83 %84 %85
+               OpStore %77 %86 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %55 = OpLoad %_arr_mat4v2half_uint_4 %31 None
-               OpStore %p %55 None
-         %56 = OpAccessChain %_ptr_Private_mat4v2half %p %uint_1
-         %58 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_0
-         %61 = OpLoad %v2half %58 None
-         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %63 = OpLoad %v2half %62 None
-         %64 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %65 = OpLoad %v2half %64 None
-         %66 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v2half %66 None
-         %69 = OpCompositeConstruct %mat4v2half %61 %63 %65 %68
-               OpStore %56 %69 None
-         %70 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
-         %73 = OpLoad %v2half %72 None
-         %74 = OpVectorShuffle %v2half %73 %73 1 0
-               OpStore %70 %74 None
-         %75 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
-         %77 = OpAccessChain %_ptr_Uniform_half %76 %uint_0
-         %79 = OpLoad %half %77 None
-         %80 = OpAccessChain %_ptr_Private_half %75 %uint_0
-               OpStore %80 %79 None
-         %82 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Private_half %82 %uint_0
-         %84 = OpLoad %half %83 None
-         %85 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %85 %84 None
+         %40 = OpLoad %_arr_mat4v2half_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat4v2half %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v2half %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v2half %48 None
+         %50 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %51 = OpLoad %v2half %50 None
+         %52 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %54 = OpLoad %v2half %52 None
+         %55 = OpCompositeConstruct %mat4v2half %47 %49 %51 %54
+               OpStore %41 %55 None
+         %56 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_0
+         %58 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
+         %59 = OpLoad %v2half %58 None
+         %60 = OpVectorShuffle %v2half %59 %59 1 0
+               OpStore %56 %60 None
+         %61 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
+         %63 = OpAccessChain %_ptr_Uniform_half %62 %uint_0
+         %65 = OpLoad %half %63 None
+         %66 = OpAccessChain %_ptr_Private_half %61 %uint_0
+               OpStore %66 %65 None
+         %68 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Private_half %68 %uint_0
+         %70 = OpLoad %half %69 None
+         %71 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %71 %70 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f16_std140_uint_4_0 None %88
@@ -158,21 +158,21 @@
                OpLoopMerge %98 %96 None
                OpBranch %95
          %95 = OpLabel
-        %101 = OpUGreaterThanEqual %bool %99 %uint_4
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %102
-        %103 = OpLabel
+        %102 = OpUGreaterThanEqual %bool %99 %uint_4
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
+        %104 = OpLabel
                OpBranch %98
-        %102 = OpLabel
-        %104 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %90 %99
-        %105 = OpLoad %mat4x2_f16_std140 %104 None
-        %106 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %92 %99
-               OpStore %106 %105 None
+        %103 = OpLabel
+        %105 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %90 %99
+        %106 = OpLoad %mat4x2_f16_std140 %105 None
+        %107 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %92 %99
+               OpStore %107 %106 None
                OpBranch %96
          %96 = OpLabel
         %100 = OpIAdd %uint %99 %uint_1
                OpBranch %97
          %98 = OpLabel
-        %107 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %92 None
-               OpReturnValue %107
+        %101 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %92 None
+               OpReturnValue %101
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.spvasm
index 150eb41..d1fbe04 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.spvasm
@@ -65,18 +65,18 @@
 %_arr_mat4v2half_uint_4_0 = OpTypeArray %mat4v2half %uint_4
 %_ptr_Function__arr_mat4v2half_uint_4_0 = OpTypePointer Function %_arr_mat4v2half_uint_4_0
          %31 = OpConstantNull %_arr_mat4v2half_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_StorageBuffer__arr_mat4v2half_uint_4 = OpTypePointer StorageBuffer %_arr_mat4v2half_uint_4
 %_ptr_StorageBuffer_mat4v2half = OpTypePointer StorageBuffer %mat4v2half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
+%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
          %86 = OpTypeFunction %_arr_mat4v2half_uint_4 %_arr_mat4v2half_uint_4_0
 %_ptr_Function__arr_mat4v2half_uint_4 = OpTypePointer Function %_arr_mat4v2half_uint_4
          %91 = OpConstantNull %_arr_mat4v2half_uint_4
@@ -99,52 +99,52 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %71 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %74 %73
+         %74 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat4v2half %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %26 %37
-         %47 = OpLoad %mat4x2_f16_std140 %45 None
-         %48 = OpCompositeExtract %v2half %47 0
-         %49 = OpCompositeExtract %v2half %47 1
-         %50 = OpCompositeExtract %v2half %47 2
-         %51 = OpCompositeExtract %v2half %47 3
-         %52 = OpCompositeConstruct %mat4v2half %48 %49 %50 %51
-               OpStore %43 %52 None
+         %73 = OpLabel
+         %75 = OpAccessChain %_ptr_Function_mat4v2half %28 %37
+         %77 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %26 %37
+         %79 = OpLoad %mat4x2_f16_std140 %77 None
+         %80 = OpCompositeExtract %v2half %79 0
+         %81 = OpCompositeExtract %v2half %79 1
+         %82 = OpCompositeExtract %v2half %79 2
+         %83 = OpCompositeExtract %v2half %79 3
+         %84 = OpCompositeConstruct %mat4v2half %80 %81 %82 %83
+               OpStore %75 %84 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %54 = OpLoad %_arr_mat4v2half_uint_4_0 %28 None
-         %55 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v2half_uint_4 %10 %uint_0
-         %57 = OpFunctionCall %_arr_mat4v2half_uint_4 %tint_convert_explicit_layout %54
-               OpStore %55 %57 None
-         %59 = OpAccessChain %_ptr_StorageBuffer_mat4v2half %10 %uint_0 %uint_1
-         %61 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_0
-         %64 = OpLoad %v2half %61 None
-         %65 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %66 = OpLoad %v2half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %68 = OpLoad %v2half %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %71 = OpLoad %v2half %69 None
-         %72 = OpCompositeConstruct %mat4v2half %64 %66 %68 %71
-               OpStore %59 %72 None
-         %73 = OpAccessChain %_ptr_StorageBuffer_v2half %10 %uint_0 %uint_1 %uint_0
-         %75 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
-         %76 = OpLoad %v2half %75 None
-         %77 = OpVectorShuffle %v2half %76 %76 1 0
-               OpStore %73 %77 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_v2half %10 %uint_0 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
-         %80 = OpAccessChain %_ptr_Uniform_half %79 %uint_0
-         %82 = OpLoad %half %80 None
-         %83 = OpAccessChain %_ptr_StorageBuffer_half %78 %uint_0
-               OpStore %83 %82 None
+         %39 = OpLoad %_arr_mat4v2half_uint_4_0 %28 None
+         %40 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v2half_uint_4 %10 %uint_0
+         %42 = OpFunctionCall %_arr_mat4v2half_uint_4 %tint_convert_explicit_layout %39
+               OpStore %40 %42 None
+         %44 = OpAccessChain %_ptr_StorageBuffer_mat4v2half %10 %uint_0 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_0
+         %50 = OpLoad %v2half %47 None
+         %51 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %v2half %51 None
+         %53 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %54 = OpLoad %v2half %53 None
+         %55 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %57 = OpLoad %v2half %55 None
+         %58 = OpCompositeConstruct %mat4v2half %50 %52 %54 %57
+               OpStore %44 %58 None
+         %59 = OpAccessChain %_ptr_StorageBuffer_v2half %10 %uint_0 %uint_1 %uint_0
+         %61 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
+         %62 = OpLoad %v2half %61 None
+         %63 = OpVectorShuffle %v2half %62 %62 1 0
+               OpStore %59 %63 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_v2half %10 %uint_0 %uint_1 %uint_0
+         %65 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
+         %66 = OpAccessChain %_ptr_Uniform_half %65 %uint_0
+         %68 = OpLoad %half %66 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_half %64 %uint_0
+               OpStore %69 %68 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4v2half_uint_4 None %86
@@ -161,23 +161,23 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_mat4v2half %88 %97
-        %103 = OpLoad %mat4v2half %102 None
-        %104 = OpAccessChain %_ptr_Function_mat4v2half %89 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_mat4v2half %88 %97
+        %104 = OpLoad %mat4v2half %103 None
+        %105 = OpAccessChain %_ptr_Function_mat4v2half %89 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_mat4v2half_uint_4 %89 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_mat4v2half_uint_4 %89 None
+               OpReturnValue %99
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4x2_f16_std140_uint_4_0 None %107
 %tint_source_0 = OpFunctionParameter %_arr_mat4x2_f16_std140_uint_4
@@ -193,21 +193,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %109 %118
-        %124 = OpLoad %mat4x2_f16_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %109 %118
+        %125 = OpLoad %mat4x2_f16_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
index 84d7849..8d632bb 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
@@ -52,10 +52,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat4v2half = OpTypePointer Workgroup %mat4v2half
-         %34 = OpConstantNull %mat4v2half
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat4x2_f16_std140_uint_4 = OpTypePointer Uniform %_arr_mat4x2_f16_std140_uint_4
@@ -63,14 +59,18 @@
 %_arr_mat4x2_f16_std140_uint_4_0 = OpTypeArray %mat4x2_f16_std140 %uint_4
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v2half_uint_4 = OpTypePointer Function %_arr_mat4v2half_uint_4
-         %50 = OpConstantNull %_arr_mat4v2half_uint_4
-%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
-%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
+         %42 = OpConstantNull %_arr_mat4v2half_uint_4
+%_ptr_Workgroup_mat4v2half = OpTypePointer Workgroup %mat4v2half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+       %bool = OpTypeBool
+         %82 = OpConstantNull %mat4v2half
+%_ptr_Function_mat4v2half = OpTypePointer Function %mat4v2half
+%_ptr_Function_mat4x2_f16_std140 = OpTypePointer Function %mat4x2_f16_std140
          %97 = OpTypeFunction %void
         %102 = OpTypeFunction %_arr_mat4x2_f16_std140_uint_4_0 %_arr_mat4x2_f16_std140_uint_4
 %_ptr_Function__arr_mat4x2_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f16_std140_uint_4
@@ -78,8 +78,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat4x2_f16_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat4v2half_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat4x2_f16_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat4v2half_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -88,76 +88,76 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat4v2half %w %26
-               OpStore %32 %34 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_mat4v2half %w %26
+               OpStore %81 %82 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat4x2_f16_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat4x2_f16_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat4x2_f16_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v2half %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %46 %56
-         %65 = OpLoad %mat4x2_f16_std140 %63 None
-         %66 = OpCompositeExtract %v2half %65 0
-         %67 = OpCompositeExtract %v2half %65 1
-         %68 = OpCompositeExtract %v2half %65 2
-         %69 = OpCompositeExtract %v2half %65 3
-         %70 = OpCompositeConstruct %mat4v2half %66 %67 %68 %69
-               OpStore %61 %70 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %71 = OpLoad %_arr_mat4v2half_uint_4 %48 None
-               OpStore %w %71 None
-         %72 = OpAccessChain %_ptr_Workgroup_mat4v2half %w %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_0
-         %75 = OpLoad %v2half %73 None
-         %76 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %77 = OpLoad %v2half %76 None
-         %78 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %79 = OpLoad %v2half %78 None
-         %80 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %82 = OpLoad %v2half %80 None
-         %83 = OpCompositeConstruct %mat4v2half %75 %77 %79 %82
-               OpStore %72 %83 None
-         %84 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_0
-         %86 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
-         %87 = OpLoad %v2half %86 None
-         %88 = OpVectorShuffle %v2half %87 %87 1 0
-               OpStore %84 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_0
-         %90 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
-         %91 = OpAccessChain %_ptr_Uniform_half %90 %uint_0
-         %93 = OpLoad %half %91 None
-         %94 = OpAccessChain %_ptr_Workgroup_half %89 %uint_0
-               OpStore %94 %93 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat4x2_f16_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat4x2_f16_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat4x2_f16_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %47
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_mat4v2half %40 %48
+         %88 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %38 %48
+         %90 = OpLoad %mat4x2_f16_std140 %88 None
+         %91 = OpCompositeExtract %v2half %90 0
+         %92 = OpCompositeExtract %v2half %90 1
+         %93 = OpCompositeExtract %v2half %90 2
+         %94 = OpCompositeExtract %v2half %90 3
+         %95 = OpCompositeConstruct %mat4v2half %91 %92 %93 %94
+               OpStore %86 %95 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat4v2half_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat4v2half %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v2half %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v2half %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v2half %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v2half %61 None
+         %64 = OpCompositeConstruct %mat4v2half %56 %58 %60 %63
+               OpStore %51 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
+         %68 = OpLoad %v2half %67 None
+         %69 = OpVectorShuffle %v2half %68 %68 1 0
+               OpStore %65 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_1
+         %72 = OpAccessChain %_ptr_Uniform_half %71 %uint_0
+         %74 = OpLoad %half %72 None
+         %75 = OpAccessChain %_ptr_Workgroup_half %70 %uint_0
+               OpStore %75 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %97
@@ -180,21 +180,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %104 %113
-        %119 = OpLoad %mat4x2_f16_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %104 %113
+        %120 = OpLoad %mat4x2_f16_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x2_f16_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x2_f16_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index a79e6d5..e397eba 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -74,9 +74,9 @@
 %_arr_mat4v2float_uint_4 = OpTypeArray %mat4v2float %uint_4
 %_ptr_Function__arr_mat4v2float_uint_4 = OpTypePointer Function %_arr_mat4v2float_uint_4
          %66 = OpConstantNull %_arr_mat4v2float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %98 = OpTypeFunction %_arr_mat4x2_f32_std140_uint_4_0 %_arr_mat4x2_f32_std140_uint_4
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4
         %103 = OpConstantNull %_arr_mat4x2_f32_std140_uint_4_0
@@ -123,36 +123,36 @@
                OpLoopMerge %71 %69 None
                OpBranch %68
          %68 = OpLabel
-         %74 = OpUGreaterThanEqual %bool %72 %uint_4
-               OpSelectionMerge %76 None
-               OpBranchConditional %74 %77 %76
-         %77 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %72 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %71
-         %76 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_mat4v2float %63 %72
-         %79 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %61 %72
-         %81 = OpLoad %mat4x2_f32_std140 %79 None
-         %82 = OpCompositeExtract %v2float %81 0
-         %83 = OpCompositeExtract %v2float %81 1
-         %84 = OpCompositeExtract %v2float %81 2
-         %85 = OpCompositeExtract %v2float %81 3
-         %86 = OpCompositeConstruct %mat4v2float %82 %83 %84 %85
-               OpStore %78 %86 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_mat4v2float %63 %72
+         %89 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %61 %72
+         %91 = OpLoad %mat4x2_f32_std140 %89 None
+         %92 = OpCompositeExtract %v2float %91 0
+         %93 = OpCompositeExtract %v2float %91 1
+         %94 = OpCompositeExtract %v2float %91 2
+         %95 = OpCompositeExtract %v2float %91 3
+         %96 = OpCompositeConstruct %mat4v2float %92 %93 %94 %95
+               OpStore %88 %96 None
                OpBranch %69
          %69 = OpLabel
          %73 = OpIAdd %uint %72 %uint_1
                OpBranch %70
          %71 = OpLabel
         %l_a = OpLoad %_arr_mat4v2float_uint_4 %63 None
-         %88 = OpCompositeExtract %float %l_a_i_i 0
-         %89 = OpCompositeExtract %float %l_a 0 0 0
-         %90 = OpFAdd %float %88 %89
-         %91 = OpCompositeExtract %float %l_a_i 0 0
-         %92 = OpFAdd %float %90 %91
-         %93 = OpCompositeExtract %float %l_a_i_i 0
-         %94 = OpFAdd %float %92 %93
-         %95 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %95 %94 None
+         %75 = OpCompositeExtract %float %l_a_i_i 0
+         %76 = OpCompositeExtract %float %l_a 0 0 0
+         %77 = OpFAdd %float %75 %76
+         %78 = OpCompositeExtract %float %l_a_i 0 0
+         %79 = OpFAdd %float %77 %78
+         %80 = OpCompositeExtract %float %l_a_i_i 0
+         %81 = OpFAdd %float %79 %80
+         %82 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %82 %81 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f32_std140_uint_4_0 None %98
@@ -169,21 +169,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %100 %109
-        %115 = OpLoad %mat4x2_f32_std140 %114 None
-        %116 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %102 %109
-               OpStore %116 %115 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %100 %109
+        %116 = OpLoad %mat4x2_f32_std140 %115 None
+        %117 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %102 %109
+               OpStore %117 %116 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %117 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %102 None
-               OpReturnValue %117
+        %111 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %102 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm
index a3dd822..02ec5d1 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -63,10 +63,10 @@
 %_arr_mat4v2float_uint_4 = OpTypeArray %mat4v2float %uint_4
 %_ptr_Function__arr_mat4v2float_uint_4 = OpTypePointer Function %_arr_mat4v2float_uint_4
          %44 = OpConstantNull %_arr_mat4v2float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
 %_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %77 = OpTypeFunction %_arr_mat4x2_f32_std140_uint_4_0 %_arr_mat4x2_f32_std140_uint_4
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4
          %82 = OpConstantNull %_arr_mat4x2_f32_std140_uint_4_0
@@ -96,36 +96,36 @@
                OpLoopMerge %49 %47 None
                OpBranch %46
          %46 = OpLabel
-         %52 = OpUGreaterThanEqual %bool %50 %uint_4
-               OpSelectionMerge %54 None
-               OpBranchConditional %52 %55 %54
-         %55 = OpLabel
+         %62 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %64 None
+               OpBranchConditional %62 %65 %64
+         %65 = OpLabel
                OpBranch %49
-         %54 = OpLabel
-         %56 = OpAccessChain %_ptr_Function_mat4v2float %41 %50
-         %58 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %39 %50
-         %60 = OpLoad %mat4x2_f32_std140 %58 None
-         %61 = OpCompositeExtract %v2float %60 0
-         %62 = OpCompositeExtract %v2float %60 1
-         %63 = OpCompositeExtract %v2float %60 2
-         %64 = OpCompositeExtract %v2float %60 3
-         %65 = OpCompositeConstruct %mat4v2float %61 %62 %63 %64
-               OpStore %56 %65 None
+         %64 = OpLabel
+         %66 = OpAccessChain %_ptr_Function_mat4v2float %41 %50
+         %68 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %39 %50
+         %70 = OpLoad %mat4x2_f32_std140 %68 None
+         %71 = OpCompositeExtract %v2float %70 0
+         %72 = OpCompositeExtract %v2float %70 1
+         %73 = OpCompositeExtract %v2float %70 2
+         %74 = OpCompositeExtract %v2float %70 3
+         %75 = OpCompositeConstruct %mat4v2float %71 %72 %73 %74
+               OpStore %66 %75 None
                OpBranch %47
          %47 = OpLabel
          %51 = OpIAdd %uint %50 %uint_1
                OpBranch %48
          %49 = OpLabel
         %l_a = OpLoad %_arr_mat4v2float_uint_4 %41 None
-         %67 = OpCompositeExtract %float %l_a_i_i 0
-         %68 = OpCompositeExtract %float %l_a 0 0 0
-         %69 = OpFAdd %float %67 %68
-         %70 = OpCompositeExtract %float %l_a_i 0 0
-         %71 = OpFAdd %float %69 %70
-         %72 = OpCompositeExtract %float %l_a_i_i 0
-         %73 = OpFAdd %float %71 %72
-         %74 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %74 %73 None
+         %53 = OpCompositeExtract %float %l_a_i_i 0
+         %54 = OpCompositeExtract %float %l_a 0 0 0
+         %55 = OpFAdd %float %53 %54
+         %56 = OpCompositeExtract %float %l_a_i 0 0
+         %57 = OpFAdd %float %55 %56
+         %58 = OpCompositeExtract %float %l_a_i_i 0
+         %59 = OpFAdd %float %57 %58
+         %60 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %60 %59 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f32_std140_uint_4_0 None %77
@@ -142,21 +142,21 @@
                OpLoopMerge %87 %85 None
                OpBranch %84
          %84 = OpLabel
-         %90 = OpUGreaterThanEqual %bool %88 %uint_4
-               OpSelectionMerge %91 None
-               OpBranchConditional %90 %92 %91
-         %92 = OpLabel
+         %91 = OpUGreaterThanEqual %bool %88 %uint_4
+               OpSelectionMerge %92 None
+               OpBranchConditional %91 %93 %92
+         %93 = OpLabel
                OpBranch %87
-         %91 = OpLabel
-         %93 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %79 %88
-         %94 = OpLoad %mat4x2_f32_std140 %93 None
-         %95 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %81 %88
-               OpStore %95 %94 None
+         %92 = OpLabel
+         %94 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %79 %88
+         %95 = OpLoad %mat4x2_f32_std140 %94 None
+         %96 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %81 %88
+               OpStore %96 %95 None
                OpBranch %85
          %85 = OpLabel
          %89 = OpIAdd %uint %88 %uint_1
                OpBranch %86
          %87 = OpLabel
-         %96 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %81 None
-               OpReturnValue %96
+         %90 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %81 None
+               OpReturnValue %90
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.spvasm
index 341b149..d90d516 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.spvasm
@@ -68,14 +68,14 @@
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4_0
 %_ptr_Function__arr_mat4v2float_uint_4 = OpTypePointer Function %_arr_mat4v2float_uint_4
          %49 = OpConstantNull %_arr_mat4v2float_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
+%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
         %102 = OpTypeFunction %_arr_mat4x2_f32_std140_uint_4_0 %_arr_mat4x2_f32_std140_uint_4
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4
         %107 = OpConstantNull %_arr_mat4x2_f32_std140_uint_4_0
@@ -118,52 +118,52 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %87 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %89 None
+               OpBranchConditional %87 %90 %89
+         %90 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v2float %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %45 %55
-         %65 = OpLoad %mat4x2_f32_std140 %63 None
-         %66 = OpCompositeExtract %v2float %65 0
-         %67 = OpCompositeExtract %v2float %65 1
-         %68 = OpCompositeExtract %v2float %65 2
-         %69 = OpCompositeExtract %v2float %65 3
-         %70 = OpCompositeConstruct %mat4v2float %66 %67 %68 %69
-               OpStore %61 %70 None
+         %89 = OpLabel
+         %91 = OpAccessChain %_ptr_Function_mat4v2float %47 %55
+         %93 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %45 %55
+         %95 = OpLoad %mat4x2_f32_std140 %93 None
+         %96 = OpCompositeExtract %v2float %95 0
+         %97 = OpCompositeExtract %v2float %95 1
+         %98 = OpCompositeExtract %v2float %95 2
+         %99 = OpCompositeExtract %v2float %95 3
+        %100 = OpCompositeConstruct %mat4v2float %96 %97 %98 %99
+               OpStore %91 %100 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %72 = OpLoad %_arr_mat4v2float_uint_4 %47 None
-         %73 = OpFunctionCall %float %a %72
+         %57 = OpLoad %_arr_mat4v2float_uint_4 %47 None
+         %58 = OpFunctionCall %float %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v2float %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v2float %63 None
+         %65 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_2
+         %67 = OpLoad %v2float %65 None
+         %68 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_3
+         %70 = OpLoad %v2float %68 None
+         %71 = OpCompositeConstruct %mat4v2float %62 %64 %67 %70
+         %72 = OpFunctionCall %float %b %71
+         %73 = OpFAdd %float %58 %72
          %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
-         %76 = OpLoad %v2float %74 None
-         %77 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_1
-         %78 = OpLoad %v2float %77 None
-         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_2
-         %81 = OpLoad %v2float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_3
-         %84 = OpLoad %v2float %82 None
-         %85 = OpCompositeConstruct %mat4v2float %76 %78 %81 %84
-         %86 = OpFunctionCall %float %b %85
-         %87 = OpFAdd %float %73 %86
-         %88 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
-         %89 = OpLoad %v2float %88 None
-         %90 = OpVectorShuffle %v2float %89 %89 1 0
-         %91 = OpFunctionCall %float %c %90
-         %92 = OpFAdd %float %87 %91
-         %93 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
-         %94 = OpLoad %v2float %93 None
-         %95 = OpVectorShuffle %v2float %94 %94 1 0
-         %96 = OpCompositeExtract %float %95 0
-         %97 = OpFunctionCall %float %d %96
-         %98 = OpFAdd %float %92 %97
-         %99 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %99 %98 None
+         %75 = OpLoad %v2float %74 None
+         %76 = OpVectorShuffle %v2float %75 %75 1 0
+         %77 = OpFunctionCall %float %c %76
+         %78 = OpFAdd %float %73 %77
+         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1 %uint_0
+         %80 = OpLoad %v2float %79 None
+         %81 = OpVectorShuffle %v2float %80 %80 1 0
+         %82 = OpCompositeExtract %float %81 0
+         %83 = OpFunctionCall %float %d %82
+         %84 = OpFAdd %float %78 %83
+         %85 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %85 %84 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f32_std140_uint_4_0 None %102
@@ -180,21 +180,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %104 %113
-        %119 = OpLoad %mat4x2_f32_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %104 %113
+        %120 = OpLoad %mat4x2_f32_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.spvasm
index 43c621e..9dd33f3 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.spvasm
@@ -59,11 +59,8 @@
 %_arr_mat4x2_f32_std140_uint_4_0 = OpTypeArray %mat4x2_f32_std140 %uint_4
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4_0
 %_ptr_Function__arr_mat4v2float_uint_4 = OpTypePointer Function %_arr_mat4v2float_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat4v2float = OpTypePointer Private %mat4v2float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
@@ -71,6 +68,9 @@
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Private_float = OpTypePointer Private %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
+%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
          %88 = OpTypeFunction %_arr_mat4x2_f32_std140_uint_4_0 %_arr_mat4x2_f32_std140_uint_4
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4
          %93 = OpConstantNull %_arr_mat4x2_f32_std140_uint_4_0
@@ -90,55 +90,55 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %73 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %76 %75
+         %76 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat4v2float %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %29 %38
-         %48 = OpLoad %mat4x2_f32_std140 %46 None
-         %49 = OpCompositeExtract %v2float %48 0
-         %50 = OpCompositeExtract %v2float %48 1
-         %51 = OpCompositeExtract %v2float %48 2
-         %52 = OpCompositeExtract %v2float %48 3
-         %53 = OpCompositeConstruct %mat4v2float %49 %50 %51 %52
-               OpStore %44 %53 None
+         %75 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_mat4v2float %31 %38
+         %79 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %29 %38
+         %81 = OpLoad %mat4x2_f32_std140 %79 None
+         %82 = OpCompositeExtract %v2float %81 0
+         %83 = OpCompositeExtract %v2float %81 1
+         %84 = OpCompositeExtract %v2float %81 2
+         %85 = OpCompositeExtract %v2float %81 3
+         %86 = OpCompositeConstruct %mat4v2float %82 %83 %84 %85
+               OpStore %77 %86 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %55 = OpLoad %_arr_mat4v2float_uint_4 %31 None
-               OpStore %p %55 None
-         %56 = OpAccessChain %_ptr_Private_mat4v2float %p %uint_1
-         %58 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
-         %61 = OpLoad %v2float %58 None
-         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %63 = OpLoad %v2float %62 None
-         %64 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %65 = OpLoad %v2float %64 None
-         %66 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v2float %66 None
-         %69 = OpCompositeConstruct %mat4v2float %61 %63 %65 %68
-               OpStore %56 %69 None
-         %70 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %73 = OpLoad %v2float %72 None
-         %74 = OpVectorShuffle %v2float %73 %73 1 0
-               OpStore %70 %74 None
-         %75 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %77 = OpAccessChain %_ptr_Uniform_float %76 %uint_0
-         %79 = OpLoad %float %77 None
-         %80 = OpAccessChain %_ptr_Private_float %75 %uint_0
-               OpStore %80 %79 None
-         %82 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Private_float %82 %uint_0
-         %84 = OpLoad %float %83 None
-         %85 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %85 %84 None
+         %40 = OpLoad %_arr_mat4v2float_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat4v2float %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v2float %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v2float %48 None
+         %50 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %51 = OpLoad %v2float %50 None
+         %52 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %54 = OpLoad %v2float %52 None
+         %55 = OpCompositeConstruct %mat4v2float %47 %49 %51 %54
+               OpStore %41 %55 None
+         %56 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
+         %58 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %59 = OpLoad %v2float %58 None
+         %60 = OpVectorShuffle %v2float %59 %59 1 0
+               OpStore %56 %60 None
+         %61 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %63 = OpAccessChain %_ptr_Uniform_float %62 %uint_0
+         %65 = OpLoad %float %63 None
+         %66 = OpAccessChain %_ptr_Private_float %61 %uint_0
+               OpStore %66 %65 None
+         %68 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Private_float %68 %uint_0
+         %70 = OpLoad %float %69 None
+         %71 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %71 %70 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x2_f32_std140_uint_4_0 None %88
@@ -155,21 +155,21 @@
                OpLoopMerge %98 %96 None
                OpBranch %95
          %95 = OpLabel
-        %101 = OpUGreaterThanEqual %bool %99 %uint_4
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %102
-        %103 = OpLabel
+        %102 = OpUGreaterThanEqual %bool %99 %uint_4
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
+        %104 = OpLabel
                OpBranch %98
-        %102 = OpLabel
-        %104 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %90 %99
-        %105 = OpLoad %mat4x2_f32_std140 %104 None
-        %106 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %92 %99
-               OpStore %106 %105 None
+        %103 = OpLabel
+        %105 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %90 %99
+        %106 = OpLoad %mat4x2_f32_std140 %105 None
+        %107 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %92 %99
+               OpStore %107 %106 None
                OpBranch %96
          %96 = OpLabel
         %100 = OpIAdd %uint %99 %uint_1
                OpBranch %97
          %98 = OpLabel
-        %107 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %92 None
-               OpReturnValue %107
+        %101 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %92 None
+               OpReturnValue %101
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.spvasm
index 8ef06a1..6bb19af 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.spvasm
@@ -62,18 +62,18 @@
 %_arr_mat4v2float_uint_4_0 = OpTypeArray %mat4v2float %uint_4
 %_ptr_Function__arr_mat4v2float_uint_4_0 = OpTypePointer Function %_arr_mat4v2float_uint_4_0
          %31 = OpConstantNull %_arr_mat4v2float_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_StorageBuffer__arr_mat4v2float_uint_4 = OpTypePointer StorageBuffer %_arr_mat4v2float_uint_4
 %_ptr_StorageBuffer_mat4v2float = OpTypePointer StorageBuffer %mat4v2float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
+%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
          %86 = OpTypeFunction %_arr_mat4v2float_uint_4 %_arr_mat4v2float_uint_4_0
 %_ptr_Function__arr_mat4v2float_uint_4 = OpTypePointer Function %_arr_mat4v2float_uint_4
          %91 = OpConstantNull %_arr_mat4v2float_uint_4
@@ -96,52 +96,52 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %71 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %74 %73
+         %74 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat4v2float %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %26 %37
-         %47 = OpLoad %mat4x2_f32_std140 %45 None
-         %48 = OpCompositeExtract %v2float %47 0
-         %49 = OpCompositeExtract %v2float %47 1
-         %50 = OpCompositeExtract %v2float %47 2
-         %51 = OpCompositeExtract %v2float %47 3
-         %52 = OpCompositeConstruct %mat4v2float %48 %49 %50 %51
-               OpStore %43 %52 None
+         %73 = OpLabel
+         %75 = OpAccessChain %_ptr_Function_mat4v2float %28 %37
+         %77 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %26 %37
+         %79 = OpLoad %mat4x2_f32_std140 %77 None
+         %80 = OpCompositeExtract %v2float %79 0
+         %81 = OpCompositeExtract %v2float %79 1
+         %82 = OpCompositeExtract %v2float %79 2
+         %83 = OpCompositeExtract %v2float %79 3
+         %84 = OpCompositeConstruct %mat4v2float %80 %81 %82 %83
+               OpStore %75 %84 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %54 = OpLoad %_arr_mat4v2float_uint_4_0 %28 None
-         %55 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v2float_uint_4 %10 %uint_0
-         %57 = OpFunctionCall %_arr_mat4v2float_uint_4 %tint_convert_explicit_layout %54
-               OpStore %55 %57 None
-         %59 = OpAccessChain %_ptr_StorageBuffer_mat4v2float %10 %uint_0 %uint_1
-         %61 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
-         %64 = OpLoad %v2float %61 None
-         %65 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %66 = OpLoad %v2float %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %68 = OpLoad %v2float %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %71 = OpLoad %v2float %69 None
-         %72 = OpCompositeConstruct %mat4v2float %64 %66 %68 %71
-               OpStore %59 %72 None
-         %73 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
-         %75 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %76 = OpLoad %v2float %75 None
-         %77 = OpVectorShuffle %v2float %76 %76 1 0
-               OpStore %73 %77 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %80 = OpAccessChain %_ptr_Uniform_float %79 %uint_0
-         %82 = OpLoad %float %80 None
-         %83 = OpAccessChain %_ptr_StorageBuffer_float %78 %uint_0
-               OpStore %83 %82 None
+         %39 = OpLoad %_arr_mat4v2float_uint_4_0 %28 None
+         %40 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v2float_uint_4 %10 %uint_0
+         %42 = OpFunctionCall %_arr_mat4v2float_uint_4 %tint_convert_explicit_layout %39
+               OpStore %40 %42 None
+         %44 = OpAccessChain %_ptr_StorageBuffer_mat4v2float %10 %uint_0 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
+         %50 = OpLoad %v2float %47 None
+         %51 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %v2float %51 None
+         %53 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %54 = OpLoad %v2float %53 None
+         %55 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %57 = OpLoad %v2float %55 None
+         %58 = OpCompositeConstruct %mat4v2float %50 %52 %54 %57
+               OpStore %44 %58 None
+         %59 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
+         %61 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %62 = OpLoad %v2float %61 None
+         %63 = OpVectorShuffle %v2float %62 %62 1 0
+               OpStore %59 %63 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_v2float %10 %uint_0 %uint_1 %uint_0
+         %65 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %66 = OpAccessChain %_ptr_Uniform_float %65 %uint_0
+         %68 = OpLoad %float %66 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_float %64 %uint_0
+               OpStore %69 %68 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4v2float_uint_4 None %86
@@ -158,23 +158,23 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_mat4v2float %88 %97
-        %103 = OpLoad %mat4v2float %102 None
-        %104 = OpAccessChain %_ptr_Function_mat4v2float %89 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_mat4v2float %88 %97
+        %104 = OpLoad %mat4v2float %103 None
+        %105 = OpAccessChain %_ptr_Function_mat4v2float %89 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_mat4v2float_uint_4 %89 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_mat4v2float_uint_4 %89 None
+               OpReturnValue %99
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4x2_f32_std140_uint_4_0 None %107
 %tint_source_0 = OpFunctionParameter %_arr_mat4x2_f32_std140_uint_4
@@ -190,21 +190,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %109 %118
-        %124 = OpLoad %mat4x2_f32_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %109 %118
+        %125 = OpLoad %mat4x2_f32_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
index 9faf708..6e01d85 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -49,10 +49,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat4v2float = OpTypePointer Workgroup %mat4v2float
-         %34 = OpConstantNull %mat4v2float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat4x2_f32_std140_uint_4 = OpTypePointer Uniform %_arr_mat4x2_f32_std140_uint_4
@@ -60,14 +56,18 @@
 %_arr_mat4x2_f32_std140_uint_4_0 = OpTypeArray %mat4x2_f32_std140 %uint_4
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4_0
 %_ptr_Function__arr_mat4v2float_uint_4 = OpTypePointer Function %_arr_mat4v2float_uint_4
-         %50 = OpConstantNull %_arr_mat4v2float_uint_4
-%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
-%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
+         %42 = OpConstantNull %_arr_mat4v2float_uint_4
+%_ptr_Workgroup_mat4v2float = OpTypePointer Workgroup %mat4v2float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %82 = OpConstantNull %mat4v2float
+%_ptr_Function_mat4v2float = OpTypePointer Function %mat4v2float
+%_ptr_Function_mat4x2_f32_std140 = OpTypePointer Function %mat4x2_f32_std140
          %97 = OpTypeFunction %void
         %102 = OpTypeFunction %_arr_mat4x2_f32_std140_uint_4_0 %_arr_mat4x2_f32_std140_uint_4
 %_ptr_Function__arr_mat4x2_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x2_f32_std140_uint_4
@@ -75,8 +75,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat4x2_f32_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat4v2float_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat4x2_f32_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat4v2float_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -85,76 +85,76 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat4v2float %w %26
-               OpStore %32 %34 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_mat4v2float %w %26
+               OpStore %81 %82 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat4x2_f32_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat4x2_f32_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat4x2_f32_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v2float %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %46 %56
-         %65 = OpLoad %mat4x2_f32_std140 %63 None
-         %66 = OpCompositeExtract %v2float %65 0
-         %67 = OpCompositeExtract %v2float %65 1
-         %68 = OpCompositeExtract %v2float %65 2
-         %69 = OpCompositeExtract %v2float %65 3
-         %70 = OpCompositeConstruct %mat4v2float %66 %67 %68 %69
-               OpStore %61 %70 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %71 = OpLoad %_arr_mat4v2float_uint_4 %48 None
-               OpStore %w %71 None
-         %72 = OpAccessChain %_ptr_Workgroup_mat4v2float %w %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
-         %75 = OpLoad %v2float %73 None
-         %76 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %77 = OpLoad %v2float %76 None
-         %78 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %79 = OpLoad %v2float %78 None
-         %80 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %82 = OpLoad %v2float %80 None
-         %83 = OpCompositeConstruct %mat4v2float %75 %77 %79 %82
-               OpStore %72 %83 None
-         %84 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
-         %86 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %87 = OpLoad %v2float %86 None
-         %88 = OpVectorShuffle %v2float %87 %87 1 0
-               OpStore %84 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
-         %90 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
-         %91 = OpAccessChain %_ptr_Uniform_float %90 %uint_0
-         %93 = OpLoad %float %91 None
-         %94 = OpAccessChain %_ptr_Workgroup_float %89 %uint_0
-               OpStore %94 %93 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat4x2_f32_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat4x2_f32_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat4x2_f32_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %47
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_mat4v2float %40 %48
+         %88 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %38 %48
+         %90 = OpLoad %mat4x2_f32_std140 %88 None
+         %91 = OpCompositeExtract %v2float %90 0
+         %92 = OpCompositeExtract %v2float %90 1
+         %93 = OpCompositeExtract %v2float %90 2
+         %94 = OpCompositeExtract %v2float %90 3
+         %95 = OpCompositeConstruct %mat4v2float %91 %92 %93 %94
+               OpStore %86 %95 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat4v2float_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat4v2float %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v2float %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v2float %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v2float %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v2float %61 None
+         %64 = OpCompositeConstruct %mat4v2float %56 %58 %60 %63
+               OpStore %51 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %68 = OpLoad %v2float %67 None
+         %69 = OpVectorShuffle %v2float %68 %68 1 0
+               OpStore %65 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_1
+         %72 = OpAccessChain %_ptr_Uniform_float %71 %uint_0
+         %74 = OpLoad %float %72 None
+         %75 = OpAccessChain %_ptr_Workgroup_float %70 %uint_0
+               OpStore %75 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %97
@@ -177,21 +177,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %104 %113
-        %119 = OpLoad %mat4x2_f32_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %104 %113
+        %120 = OpLoad %mat4x2_f32_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x2_f32_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x2_f32_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index d85262d..efa2753 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -77,9 +77,9 @@
 %_arr_mat4v3half_uint_4 = OpTypeArray %mat4v3half %uint_4
 %_ptr_Function__arr_mat4v3half_uint_4 = OpTypePointer Function %_arr_mat4v3half_uint_4
          %66 = OpConstantNull %_arr_mat4v3half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %98 = OpTypeFunction %_arr_mat4x3_f16_std140_uint_4_0 %_arr_mat4x3_f16_std140_uint_4
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4
         %103 = OpConstantNull %_arr_mat4x3_f16_std140_uint_4_0
@@ -126,36 +126,36 @@
                OpLoopMerge %71 %69 None
                OpBranch %68
          %68 = OpLabel
-         %74 = OpUGreaterThanEqual %bool %72 %uint_4
-               OpSelectionMerge %76 None
-               OpBranchConditional %74 %77 %76
-         %77 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %72 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %71
-         %76 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_mat4v3half %63 %72
-         %79 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %61 %72
-         %81 = OpLoad %mat4x3_f16_std140 %79 None
-         %82 = OpCompositeExtract %v3half %81 0
-         %83 = OpCompositeExtract %v3half %81 1
-         %84 = OpCompositeExtract %v3half %81 2
-         %85 = OpCompositeExtract %v3half %81 3
-         %86 = OpCompositeConstruct %mat4v3half %82 %83 %84 %85
-               OpStore %78 %86 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_mat4v3half %63 %72
+         %89 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %61 %72
+         %91 = OpLoad %mat4x3_f16_std140 %89 None
+         %92 = OpCompositeExtract %v3half %91 0
+         %93 = OpCompositeExtract %v3half %91 1
+         %94 = OpCompositeExtract %v3half %91 2
+         %95 = OpCompositeExtract %v3half %91 3
+         %96 = OpCompositeConstruct %mat4v3half %92 %93 %94 %95
+               OpStore %88 %96 None
                OpBranch %69
          %69 = OpLabel
          %73 = OpIAdd %uint %72 %uint_1
                OpBranch %70
          %71 = OpLabel
         %l_a = OpLoad %_arr_mat4v3half_uint_4 %63 None
-         %88 = OpCompositeExtract %half %l_a_i_i 0
-         %89 = OpCompositeExtract %half %l_a 0 0 0
-         %90 = OpFAdd %half %88 %89
-         %91 = OpCompositeExtract %half %l_a_i 0 0
-         %92 = OpFAdd %half %90 %91
-         %93 = OpCompositeExtract %half %l_a_i_i 0
-         %94 = OpFAdd %half %92 %93
-         %95 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %95 %94 None
+         %75 = OpCompositeExtract %half %l_a_i_i 0
+         %76 = OpCompositeExtract %half %l_a 0 0 0
+         %77 = OpFAdd %half %75 %76
+         %78 = OpCompositeExtract %half %l_a_i 0 0
+         %79 = OpFAdd %half %77 %78
+         %80 = OpCompositeExtract %half %l_a_i_i 0
+         %81 = OpFAdd %half %79 %80
+         %82 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %82 %81 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f16_std140_uint_4_0 None %98
@@ -172,21 +172,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %100 %109
-        %115 = OpLoad %mat4x3_f16_std140 %114 None
-        %116 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %102 %109
-               OpStore %116 %115 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %100 %109
+        %116 = OpLoad %mat4x3_f16_std140 %115 None
+        %117 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %102 %109
+               OpStore %117 %116 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %117 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %102 None
-               OpReturnValue %117
+        %111 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %102 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm
index e680cb0..620a6e7 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -66,10 +66,10 @@
 %_arr_mat4v3half_uint_4 = OpTypeArray %mat4v3half %uint_4
 %_ptr_Function__arr_mat4v3half_uint_4 = OpTypePointer Function %_arr_mat4v3half_uint_4
          %44 = OpConstantNull %_arr_mat4v3half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
 %_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %77 = OpTypeFunction %_arr_mat4x3_f16_std140_uint_4_0 %_arr_mat4x3_f16_std140_uint_4
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4
          %82 = OpConstantNull %_arr_mat4x3_f16_std140_uint_4_0
@@ -99,36 +99,36 @@
                OpLoopMerge %49 %47 None
                OpBranch %46
          %46 = OpLabel
-         %52 = OpUGreaterThanEqual %bool %50 %uint_4
-               OpSelectionMerge %54 None
-               OpBranchConditional %52 %55 %54
-         %55 = OpLabel
+         %62 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %64 None
+               OpBranchConditional %62 %65 %64
+         %65 = OpLabel
                OpBranch %49
-         %54 = OpLabel
-         %56 = OpAccessChain %_ptr_Function_mat4v3half %41 %50
-         %58 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %39 %50
-         %60 = OpLoad %mat4x3_f16_std140 %58 None
-         %61 = OpCompositeExtract %v3half %60 0
-         %62 = OpCompositeExtract %v3half %60 1
-         %63 = OpCompositeExtract %v3half %60 2
-         %64 = OpCompositeExtract %v3half %60 3
-         %65 = OpCompositeConstruct %mat4v3half %61 %62 %63 %64
-               OpStore %56 %65 None
+         %64 = OpLabel
+         %66 = OpAccessChain %_ptr_Function_mat4v3half %41 %50
+         %68 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %39 %50
+         %70 = OpLoad %mat4x3_f16_std140 %68 None
+         %71 = OpCompositeExtract %v3half %70 0
+         %72 = OpCompositeExtract %v3half %70 1
+         %73 = OpCompositeExtract %v3half %70 2
+         %74 = OpCompositeExtract %v3half %70 3
+         %75 = OpCompositeConstruct %mat4v3half %71 %72 %73 %74
+               OpStore %66 %75 None
                OpBranch %47
          %47 = OpLabel
          %51 = OpIAdd %uint %50 %uint_1
                OpBranch %48
          %49 = OpLabel
         %l_a = OpLoad %_arr_mat4v3half_uint_4 %41 None
-         %67 = OpCompositeExtract %half %l_a_i_i 0
-         %68 = OpCompositeExtract %half %l_a 0 0 0
-         %69 = OpFAdd %half %67 %68
-         %70 = OpCompositeExtract %half %l_a_i 0 0
-         %71 = OpFAdd %half %69 %70
-         %72 = OpCompositeExtract %half %l_a_i_i 0
-         %73 = OpFAdd %half %71 %72
-         %74 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %74 %73 None
+         %53 = OpCompositeExtract %half %l_a_i_i 0
+         %54 = OpCompositeExtract %half %l_a 0 0 0
+         %55 = OpFAdd %half %53 %54
+         %56 = OpCompositeExtract %half %l_a_i 0 0
+         %57 = OpFAdd %half %55 %56
+         %58 = OpCompositeExtract %half %l_a_i_i 0
+         %59 = OpFAdd %half %57 %58
+         %60 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %60 %59 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f16_std140_uint_4_0 None %77
@@ -145,21 +145,21 @@
                OpLoopMerge %87 %85 None
                OpBranch %84
          %84 = OpLabel
-         %90 = OpUGreaterThanEqual %bool %88 %uint_4
-               OpSelectionMerge %91 None
-               OpBranchConditional %90 %92 %91
-         %92 = OpLabel
+         %91 = OpUGreaterThanEqual %bool %88 %uint_4
+               OpSelectionMerge %92 None
+               OpBranchConditional %91 %93 %92
+         %93 = OpLabel
                OpBranch %87
-         %91 = OpLabel
-         %93 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %79 %88
-         %94 = OpLoad %mat4x3_f16_std140 %93 None
-         %95 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %81 %88
-               OpStore %95 %94 None
+         %92 = OpLabel
+         %94 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %79 %88
+         %95 = OpLoad %mat4x3_f16_std140 %94 None
+         %96 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %81 %88
+               OpStore %96 %95 None
                OpBranch %85
          %85 = OpLabel
          %89 = OpIAdd %uint %88 %uint_1
                OpBranch %86
          %87 = OpLabel
-         %96 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %81 None
-               OpReturnValue %96
+         %90 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %81 None
+               OpReturnValue %90
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.spvasm
index c6375fe..37a474f 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.spvasm
@@ -71,14 +71,14 @@
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v3half_uint_4 = OpTypePointer Function %_arr_mat4v3half_uint_4
          %49 = OpConstantNull %_arr_mat4v3half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
+     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
+%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
         %102 = OpTypeFunction %_arr_mat4x3_f16_std140_uint_4_0 %_arr_mat4x3_f16_std140_uint_4
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4
         %107 = OpConstantNull %_arr_mat4x3_f16_std140_uint_4_0
@@ -121,52 +121,52 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %87 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %89 None
+               OpBranchConditional %87 %90 %89
+         %90 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v3half %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %45 %55
-         %65 = OpLoad %mat4x3_f16_std140 %63 None
-         %66 = OpCompositeExtract %v3half %65 0
-         %67 = OpCompositeExtract %v3half %65 1
-         %68 = OpCompositeExtract %v3half %65 2
-         %69 = OpCompositeExtract %v3half %65 3
-         %70 = OpCompositeConstruct %mat4v3half %66 %67 %68 %69
-               OpStore %61 %70 None
+         %89 = OpLabel
+         %91 = OpAccessChain %_ptr_Function_mat4v3half %47 %55
+         %93 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %45 %55
+         %95 = OpLoad %mat4x3_f16_std140 %93 None
+         %96 = OpCompositeExtract %v3half %95 0
+         %97 = OpCompositeExtract %v3half %95 1
+         %98 = OpCompositeExtract %v3half %95 2
+         %99 = OpCompositeExtract %v3half %95 3
+        %100 = OpCompositeConstruct %mat4v3half %96 %97 %98 %99
+               OpStore %91 %100 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %72 = OpLoad %_arr_mat4v3half_uint_4 %47 None
-         %73 = OpFunctionCall %half %a %72
+         %57 = OpLoad %_arr_mat4v3half_uint_4 %47 None
+         %58 = OpFunctionCall %half %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v3half %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v3half %63 None
+         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_2
+         %67 = OpLoad %v3half %65 None
+         %68 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_3
+         %70 = OpLoad %v3half %68 None
+         %71 = OpCompositeConstruct %mat4v3half %62 %64 %67 %70
+         %72 = OpFunctionCall %half %b %71
+         %73 = OpFAdd %half %58 %72
          %74 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
-         %76 = OpLoad %v3half %74 None
-         %77 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_1
-         %78 = OpLoad %v3half %77 None
-         %79 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_2
-         %81 = OpLoad %v3half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_3
-         %84 = OpLoad %v3half %82 None
-         %85 = OpCompositeConstruct %mat4v3half %76 %78 %81 %84
-         %86 = OpFunctionCall %half %b %85
-         %87 = OpFAdd %half %73 %86
-         %88 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
-         %89 = OpLoad %v3half %88 None
-         %90 = OpVectorShuffle %v3half %89 %89 2 0 1
-         %91 = OpFunctionCall %half %c %90
-         %92 = OpFAdd %half %87 %91
-         %93 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
-         %94 = OpLoad %v3half %93 None
-         %95 = OpVectorShuffle %v3half %94 %94 2 0 1
-         %96 = OpCompositeExtract %half %95 0
-         %97 = OpFunctionCall %half %d %96
-         %98 = OpFAdd %half %92 %97
-         %99 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %99 %98 None
+         %75 = OpLoad %v3half %74 None
+         %76 = OpVectorShuffle %v3half %75 %75 2 0 1
+         %77 = OpFunctionCall %half %c %76
+         %78 = OpFAdd %half %73 %77
+         %79 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_1 %uint_0
+         %80 = OpLoad %v3half %79 None
+         %81 = OpVectorShuffle %v3half %80 %80 2 0 1
+         %82 = OpCompositeExtract %half %81 0
+         %83 = OpFunctionCall %half %d %82
+         %84 = OpFAdd %half %78 %83
+         %85 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %85 %84 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f16_std140_uint_4_0 None %102
@@ -183,21 +183,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %104 %113
-        %119 = OpLoad %mat4x3_f16_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %104 %113
+        %120 = OpLoad %mat4x3_f16_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.spvasm
index 2319364..e61d7e1 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.spvasm
@@ -62,11 +62,8 @@
 %_arr_mat4x3_f16_std140_uint_4_0 = OpTypeArray %mat4x3_f16_std140 %uint_4
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v3half_uint_4 = OpTypePointer Function %_arr_mat4v3half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat4v3half = OpTypePointer Private %mat4v3half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
@@ -74,6 +71,9 @@
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Private_half = OpTypePointer Private %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
+%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
          %88 = OpTypeFunction %_arr_mat4x3_f16_std140_uint_4_0 %_arr_mat4x3_f16_std140_uint_4
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4
          %93 = OpConstantNull %_arr_mat4x3_f16_std140_uint_4_0
@@ -93,55 +93,55 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %73 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %76 %75
+         %76 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat4v3half %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %29 %38
-         %48 = OpLoad %mat4x3_f16_std140 %46 None
-         %49 = OpCompositeExtract %v3half %48 0
-         %50 = OpCompositeExtract %v3half %48 1
-         %51 = OpCompositeExtract %v3half %48 2
-         %52 = OpCompositeExtract %v3half %48 3
-         %53 = OpCompositeConstruct %mat4v3half %49 %50 %51 %52
-               OpStore %44 %53 None
+         %75 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_mat4v3half %31 %38
+         %79 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %29 %38
+         %81 = OpLoad %mat4x3_f16_std140 %79 None
+         %82 = OpCompositeExtract %v3half %81 0
+         %83 = OpCompositeExtract %v3half %81 1
+         %84 = OpCompositeExtract %v3half %81 2
+         %85 = OpCompositeExtract %v3half %81 3
+         %86 = OpCompositeConstruct %mat4v3half %82 %83 %84 %85
+               OpStore %77 %86 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %55 = OpLoad %_arr_mat4v3half_uint_4 %31 None
-               OpStore %p %55 None
-         %56 = OpAccessChain %_ptr_Private_mat4v3half %p %uint_1
-         %58 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
-         %61 = OpLoad %v3half %58 None
-         %62 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %63 = OpLoad %v3half %62 None
-         %64 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %65 = OpLoad %v3half %64 None
-         %66 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v3half %66 None
-         %69 = OpCompositeConstruct %mat4v3half %61 %63 %65 %68
-               OpStore %56 %69 None
-         %70 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %73 = OpLoad %v3half %72 None
-         %74 = OpVectorShuffle %v3half %73 %73 2 0 1
-               OpStore %70 %74 None
-         %75 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %77 = OpAccessChain %_ptr_Uniform_half %76 %uint_0
-         %79 = OpLoad %half %77 None
-         %80 = OpAccessChain %_ptr_Private_half %75 %uint_0
-               OpStore %80 %79 None
-         %82 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Private_half %82 %uint_0
-         %84 = OpLoad %half %83 None
-         %85 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %85 %84 None
+         %40 = OpLoad %_arr_mat4v3half_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat4v3half %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v3half %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v3half %48 None
+         %50 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %51 = OpLoad %v3half %50 None
+         %52 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %54 = OpLoad %v3half %52 None
+         %55 = OpCompositeConstruct %mat4v3half %47 %49 %51 %54
+               OpStore %41 %55 None
+         %56 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
+         %58 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %59 = OpLoad %v3half %58 None
+         %60 = OpVectorShuffle %v3half %59 %59 2 0 1
+               OpStore %56 %60 None
+         %61 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %63 = OpAccessChain %_ptr_Uniform_half %62 %uint_0
+         %65 = OpLoad %half %63 None
+         %66 = OpAccessChain %_ptr_Private_half %61 %uint_0
+               OpStore %66 %65 None
+         %68 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Private_half %68 %uint_0
+         %70 = OpLoad %half %69 None
+         %71 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %71 %70 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f16_std140_uint_4_0 None %88
@@ -158,21 +158,21 @@
                OpLoopMerge %98 %96 None
                OpBranch %95
          %95 = OpLabel
-        %101 = OpUGreaterThanEqual %bool %99 %uint_4
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %102
-        %103 = OpLabel
+        %102 = OpUGreaterThanEqual %bool %99 %uint_4
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
+        %104 = OpLabel
                OpBranch %98
-        %102 = OpLabel
-        %104 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %90 %99
-        %105 = OpLoad %mat4x3_f16_std140 %104 None
-        %106 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %92 %99
-               OpStore %106 %105 None
+        %103 = OpLabel
+        %105 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %90 %99
+        %106 = OpLoad %mat4x3_f16_std140 %105 None
+        %107 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %92 %99
+               OpStore %107 %106 None
                OpBranch %96
          %96 = OpLabel
         %100 = OpIAdd %uint %99 %uint_1
                OpBranch %97
          %98 = OpLabel
-        %107 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %92 None
-               OpReturnValue %107
+        %101 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %92 None
+               OpReturnValue %101
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.spvasm
index 603123c..78af9b7 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.spvasm
@@ -68,17 +68,17 @@
 %_arr_mat4v3half_uint_4_0 = OpTypeArray %mat4v3half %uint_4
 %_ptr_Function__arr_mat4v3half_uint_4_0 = OpTypePointer Function %_arr_mat4v3half_uint_4_0
          %31 = OpConstantNull %_arr_mat4v3half_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
+%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
          %86 = OpTypeFunction %void %_arr_mat4v3half_uint_4_0
         %105 = OpTypeFunction %void %_arr_uint_uint_1 %mat4v3half
         %117 = OpTypeFunction %_arr_mat4x3_f16_std140_uint_4_0 %_arr_mat4x3_f16_std140_uint_4
@@ -100,50 +100,50 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %71 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %74 %73
+         %74 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat4v3half %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %26 %37
-         %47 = OpLoad %mat4x3_f16_std140 %45 None
-         %48 = OpCompositeExtract %v3half %47 0
-         %49 = OpCompositeExtract %v3half %47 1
-         %50 = OpCompositeExtract %v3half %47 2
-         %51 = OpCompositeExtract %v3half %47 3
-         %52 = OpCompositeConstruct %mat4v3half %48 %49 %50 %51
-               OpStore %43 %52 None
+         %73 = OpLabel
+         %75 = OpAccessChain %_ptr_Function_mat4v3half %28 %37
+         %77 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %26 %37
+         %79 = OpLoad %mat4x3_f16_std140 %77 None
+         %80 = OpCompositeExtract %v3half %79 0
+         %81 = OpCompositeExtract %v3half %79 1
+         %82 = OpCompositeExtract %v3half %79 2
+         %83 = OpCompositeExtract %v3half %79 3
+         %84 = OpCompositeConstruct %mat4v3half %80 %81 %82 %83
+               OpStore %75 %84 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %54 = OpLoad %_arr_mat4v3half_uint_4_0 %28 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
-         %60 = OpLoad %v3half %57 None
-         %61 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %39 = OpLoad %_arr_mat4v3half_uint_4_0 %28 None
+         %40 = OpFunctionCall %void %tint_store_and_preserve_padding %39
+         %42 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
+         %45 = OpLoad %v3half %42 None
+         %46 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %48 = OpLoad %v3half %46 None
+         %49 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %50 = OpLoad %v3half %49 None
+         %51 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %53 = OpLoad %v3half %51 None
+         %54 = OpCompositeConstruct %mat4v3half %45 %48 %50 %53
+         %56 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %57 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %56 %54
+         %59 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
+         %61 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
          %62 = OpLoad %v3half %61 None
-         %63 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %64 = OpLoad %v3half %63 None
-         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %67 = OpLoad %v3half %65 None
-         %68 = OpCompositeConstruct %mat4v3half %60 %62 %64 %67
-         %70 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %71 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %70 %68
-         %73 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
-         %75 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %76 = OpLoad %v3half %75 None
-         %77 = OpVectorShuffle %v3half %76 %76 2 0 1
-               OpStore %73 %77 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %80 = OpAccessChain %_ptr_Uniform_half %79 %uint_0
-         %82 = OpLoad %half %80 None
-         %83 = OpAccessChain %_ptr_StorageBuffer_half %78 %uint_0
-               OpStore %83 %82 None
+         %63 = OpVectorShuffle %v3half %62 %62 2 0 1
+               OpStore %59 %63 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_v3half %10 %uint_0 %uint_1 %uint_0
+         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %66 = OpAccessChain %_ptr_Uniform_half %65 %uint_0
+         %68 = OpLoad %half %66 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_half %64 %uint_0
+               OpStore %69 %68 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %86
@@ -209,21 +209,21 @@
                OpLoopMerge %127 %125 None
                OpBranch %124
         %124 = OpLabel
-        %130 = OpUGreaterThanEqual %bool %128 %uint_4
-               OpSelectionMerge %131 None
-               OpBranchConditional %130 %132 %131
-        %132 = OpLabel
+        %131 = OpUGreaterThanEqual %bool %128 %uint_4
+               OpSelectionMerge %132 None
+               OpBranchConditional %131 %133 %132
+        %133 = OpLabel
                OpBranch %127
-        %131 = OpLabel
-        %133 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %119 %128
-        %134 = OpLoad %mat4x3_f16_std140 %133 None
-        %135 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %121 %128
-               OpStore %135 %134 None
+        %132 = OpLabel
+        %134 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %119 %128
+        %135 = OpLoad %mat4x3_f16_std140 %134 None
+        %136 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %121 %128
+               OpStore %136 %135 None
                OpBranch %125
         %125 = OpLabel
         %129 = OpIAdd %uint %128 %uint_1
                OpBranch %126
         %127 = OpLabel
-        %136 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %121 None
-               OpReturnValue %136
+        %130 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %121 None
+               OpReturnValue %130
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
index 4c748a8..f037a8f 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -52,10 +52,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat4v3half = OpTypePointer Workgroup %mat4v3half
-         %34 = OpConstantNull %mat4v3half
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat4x3_f16_std140_uint_4 = OpTypePointer Uniform %_arr_mat4x3_f16_std140_uint_4
@@ -63,14 +59,18 @@
 %_arr_mat4x3_f16_std140_uint_4_0 = OpTypeArray %mat4x3_f16_std140 %uint_4
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v3half_uint_4 = OpTypePointer Function %_arr_mat4v3half_uint_4
-         %50 = OpConstantNull %_arr_mat4v3half_uint_4
-%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
-%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
+         %42 = OpConstantNull %_arr_mat4v3half_uint_4
+%_ptr_Workgroup_mat4v3half = OpTypePointer Workgroup %mat4v3half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+       %bool = OpTypeBool
+         %82 = OpConstantNull %mat4v3half
+%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
+%_ptr_Function_mat4x3_f16_std140 = OpTypePointer Function %mat4x3_f16_std140
          %97 = OpTypeFunction %void
         %102 = OpTypeFunction %_arr_mat4x3_f16_std140_uint_4_0 %_arr_mat4x3_f16_std140_uint_4
 %_ptr_Function__arr_mat4x3_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f16_std140_uint_4
@@ -78,8 +78,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat4x3_f16_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat4v3half_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat4x3_f16_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat4v3half_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -88,76 +88,76 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat4v3half %w %26
-               OpStore %32 %34 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_mat4v3half %w %26
+               OpStore %81 %82 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat4x3_f16_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat4x3_f16_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat4x3_f16_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v3half %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %46 %56
-         %65 = OpLoad %mat4x3_f16_std140 %63 None
-         %66 = OpCompositeExtract %v3half %65 0
-         %67 = OpCompositeExtract %v3half %65 1
-         %68 = OpCompositeExtract %v3half %65 2
-         %69 = OpCompositeExtract %v3half %65 3
-         %70 = OpCompositeConstruct %mat4v3half %66 %67 %68 %69
-               OpStore %61 %70 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %71 = OpLoad %_arr_mat4v3half_uint_4 %48 None
-               OpStore %w %71 None
-         %72 = OpAccessChain %_ptr_Workgroup_mat4v3half %w %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
-         %75 = OpLoad %v3half %73 None
-         %76 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %77 = OpLoad %v3half %76 None
-         %78 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %79 = OpLoad %v3half %78 None
-         %80 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %82 = OpLoad %v3half %80 None
-         %83 = OpCompositeConstruct %mat4v3half %75 %77 %79 %82
-               OpStore %72 %83 None
-         %84 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
-         %86 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %87 = OpLoad %v3half %86 None
-         %88 = OpVectorShuffle %v3half %87 %87 2 0 1
-               OpStore %84 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
-         %90 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
-         %91 = OpAccessChain %_ptr_Uniform_half %90 %uint_0
-         %93 = OpLoad %half %91 None
-         %94 = OpAccessChain %_ptr_Workgroup_half %89 %uint_0
-               OpStore %94 %93 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat4x3_f16_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat4x3_f16_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat4x3_f16_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %47
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_mat4v3half %40 %48
+         %88 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %38 %48
+         %90 = OpLoad %mat4x3_f16_std140 %88 None
+         %91 = OpCompositeExtract %v3half %90 0
+         %92 = OpCompositeExtract %v3half %90 1
+         %93 = OpCompositeExtract %v3half %90 2
+         %94 = OpCompositeExtract %v3half %90 3
+         %95 = OpCompositeConstruct %mat4v3half %91 %92 %93 %94
+               OpStore %86 %95 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat4v3half_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat4v3half %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v3half %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3half %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3half %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v3half %61 None
+         %64 = OpCompositeConstruct %mat4v3half %56 %58 %60 %63
+               OpStore %51 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %68 = OpLoad %v3half %67 None
+         %69 = OpVectorShuffle %v3half %68 %68 2 0 1
+               OpStore %65 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_1
+         %72 = OpAccessChain %_ptr_Uniform_half %71 %uint_0
+         %74 = OpLoad %half %72 None
+         %75 = OpAccessChain %_ptr_Workgroup_half %70 %uint_0
+               OpStore %75 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %97
@@ -180,21 +180,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %104 %113
-        %119 = OpLoad %mat4x3_f16_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %104 %113
+        %120 = OpLoad %mat4x3_f16_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x3_f16_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x3_f16_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index ddbf072..d664283 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -74,9 +74,9 @@
 %_arr_mat4v3float_uint_4 = OpTypeArray %mat4v3float %uint_4
 %_ptr_Function__arr_mat4v3float_uint_4 = OpTypePointer Function %_arr_mat4v3float_uint_4
          %66 = OpConstantNull %_arr_mat4v3float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %98 = OpTypeFunction %_arr_mat4x3_f32_std140_uint_4_0 %_arr_mat4x3_f32_std140_uint_4
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4
         %103 = OpConstantNull %_arr_mat4x3_f32_std140_uint_4_0
@@ -123,36 +123,36 @@
                OpLoopMerge %71 %69 None
                OpBranch %68
          %68 = OpLabel
-         %74 = OpUGreaterThanEqual %bool %72 %uint_4
-               OpSelectionMerge %76 None
-               OpBranchConditional %74 %77 %76
-         %77 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %72 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %71
-         %76 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_mat4v3float %63 %72
-         %79 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %61 %72
-         %81 = OpLoad %mat4x3_f32_std140 %79 None
-         %82 = OpCompositeExtract %v3float %81 0
-         %83 = OpCompositeExtract %v3float %81 1
-         %84 = OpCompositeExtract %v3float %81 2
-         %85 = OpCompositeExtract %v3float %81 3
-         %86 = OpCompositeConstruct %mat4v3float %82 %83 %84 %85
-               OpStore %78 %86 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_mat4v3float %63 %72
+         %89 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %61 %72
+         %91 = OpLoad %mat4x3_f32_std140 %89 None
+         %92 = OpCompositeExtract %v3float %91 0
+         %93 = OpCompositeExtract %v3float %91 1
+         %94 = OpCompositeExtract %v3float %91 2
+         %95 = OpCompositeExtract %v3float %91 3
+         %96 = OpCompositeConstruct %mat4v3float %92 %93 %94 %95
+               OpStore %88 %96 None
                OpBranch %69
          %69 = OpLabel
          %73 = OpIAdd %uint %72 %uint_1
                OpBranch %70
          %71 = OpLabel
         %l_a = OpLoad %_arr_mat4v3float_uint_4 %63 None
-         %88 = OpCompositeExtract %float %l_a_i_i 0
-         %89 = OpCompositeExtract %float %l_a 0 0 0
-         %90 = OpFAdd %float %88 %89
-         %91 = OpCompositeExtract %float %l_a_i 0 0
-         %92 = OpFAdd %float %90 %91
-         %93 = OpCompositeExtract %float %l_a_i_i 0
-         %94 = OpFAdd %float %92 %93
-         %95 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %95 %94 None
+         %75 = OpCompositeExtract %float %l_a_i_i 0
+         %76 = OpCompositeExtract %float %l_a 0 0 0
+         %77 = OpFAdd %float %75 %76
+         %78 = OpCompositeExtract %float %l_a_i 0 0
+         %79 = OpFAdd %float %77 %78
+         %80 = OpCompositeExtract %float %l_a_i_i 0
+         %81 = OpFAdd %float %79 %80
+         %82 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %82 %81 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f32_std140_uint_4_0 None %98
@@ -169,21 +169,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %100 %109
-        %115 = OpLoad %mat4x3_f32_std140 %114 None
-        %116 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %102 %109
-               OpStore %116 %115 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %100 %109
+        %116 = OpLoad %mat4x3_f32_std140 %115 None
+        %117 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %102 %109
+               OpStore %117 %116 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %117 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %102 None
-               OpReturnValue %117
+        %111 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %102 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm
index f44befa..0ae7086 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -63,10 +63,10 @@
 %_arr_mat4v3float_uint_4 = OpTypeArray %mat4v3float %uint_4
 %_ptr_Function__arr_mat4v3float_uint_4 = OpTypePointer Function %_arr_mat4v3float_uint_4
          %44 = OpConstantNull %_arr_mat4v3float_uint_4
+%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
        %bool = OpTypeBool
 %_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
 %_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
          %77 = OpTypeFunction %_arr_mat4x3_f32_std140_uint_4_0 %_arr_mat4x3_f32_std140_uint_4
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4
          %82 = OpConstantNull %_arr_mat4x3_f32_std140_uint_4_0
@@ -96,36 +96,36 @@
                OpLoopMerge %49 %47 None
                OpBranch %46
          %46 = OpLabel
-         %52 = OpUGreaterThanEqual %bool %50 %uint_4
-               OpSelectionMerge %54 None
-               OpBranchConditional %52 %55 %54
-         %55 = OpLabel
+         %62 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %64 None
+               OpBranchConditional %62 %65 %64
+         %65 = OpLabel
                OpBranch %49
-         %54 = OpLabel
-         %56 = OpAccessChain %_ptr_Function_mat4v3float %41 %50
-         %58 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %39 %50
-         %60 = OpLoad %mat4x3_f32_std140 %58 None
-         %61 = OpCompositeExtract %v3float %60 0
-         %62 = OpCompositeExtract %v3float %60 1
-         %63 = OpCompositeExtract %v3float %60 2
-         %64 = OpCompositeExtract %v3float %60 3
-         %65 = OpCompositeConstruct %mat4v3float %61 %62 %63 %64
-               OpStore %56 %65 None
+         %64 = OpLabel
+         %66 = OpAccessChain %_ptr_Function_mat4v3float %41 %50
+         %68 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %39 %50
+         %70 = OpLoad %mat4x3_f32_std140 %68 None
+         %71 = OpCompositeExtract %v3float %70 0
+         %72 = OpCompositeExtract %v3float %70 1
+         %73 = OpCompositeExtract %v3float %70 2
+         %74 = OpCompositeExtract %v3float %70 3
+         %75 = OpCompositeConstruct %mat4v3float %71 %72 %73 %74
+               OpStore %66 %75 None
                OpBranch %47
          %47 = OpLabel
          %51 = OpIAdd %uint %50 %uint_1
                OpBranch %48
          %49 = OpLabel
         %l_a = OpLoad %_arr_mat4v3float_uint_4 %41 None
-         %67 = OpCompositeExtract %float %l_a_i_i 0
-         %68 = OpCompositeExtract %float %l_a 0 0 0
-         %69 = OpFAdd %float %67 %68
-         %70 = OpCompositeExtract %float %l_a_i 0 0
-         %71 = OpFAdd %float %69 %70
-         %72 = OpCompositeExtract %float %l_a_i_i 0
-         %73 = OpFAdd %float %71 %72
-         %74 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %74 %73 None
+         %53 = OpCompositeExtract %float %l_a_i_i 0
+         %54 = OpCompositeExtract %float %l_a 0 0 0
+         %55 = OpFAdd %float %53 %54
+         %56 = OpCompositeExtract %float %l_a_i 0 0
+         %57 = OpFAdd %float %55 %56
+         %58 = OpCompositeExtract %float %l_a_i_i 0
+         %59 = OpFAdd %float %57 %58
+         %60 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %60 %59 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f32_std140_uint_4_0 None %77
@@ -142,21 +142,21 @@
                OpLoopMerge %87 %85 None
                OpBranch %84
          %84 = OpLabel
-         %90 = OpUGreaterThanEqual %bool %88 %uint_4
-               OpSelectionMerge %91 None
-               OpBranchConditional %90 %92 %91
-         %92 = OpLabel
+         %91 = OpUGreaterThanEqual %bool %88 %uint_4
+               OpSelectionMerge %92 None
+               OpBranchConditional %91 %93 %92
+         %93 = OpLabel
                OpBranch %87
-         %91 = OpLabel
-         %93 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %79 %88
-         %94 = OpLoad %mat4x3_f32_std140 %93 None
-         %95 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %81 %88
-               OpStore %95 %94 None
+         %92 = OpLabel
+         %94 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %79 %88
+         %95 = OpLoad %mat4x3_f32_std140 %94 None
+         %96 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %81 %88
+               OpStore %96 %95 None
                OpBranch %85
          %85 = OpLabel
          %89 = OpIAdd %uint %88 %uint_1
                OpBranch %86
          %87 = OpLabel
-         %96 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %81 None
-               OpReturnValue %96
+         %90 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %81 None
+               OpReturnValue %90
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.spvasm
index 6a4f56d..7572d06 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.spvasm
@@ -68,14 +68,14 @@
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat4v3float_uint_4 = OpTypePointer Function %_arr_mat4v3float_uint_4
          %49 = OpConstantNull %_arr_mat4v3float_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
+%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
         %102 = OpTypeFunction %_arr_mat4x3_f32_std140_uint_4_0 %_arr_mat4x3_f32_std140_uint_4
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4
         %107 = OpConstantNull %_arr_mat4x3_f32_std140_uint_4_0
@@ -118,52 +118,52 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %87 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %89 None
+               OpBranchConditional %87 %90 %89
+         %90 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v3float %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %45 %55
-         %65 = OpLoad %mat4x3_f32_std140 %63 None
-         %66 = OpCompositeExtract %v3float %65 0
-         %67 = OpCompositeExtract %v3float %65 1
-         %68 = OpCompositeExtract %v3float %65 2
-         %69 = OpCompositeExtract %v3float %65 3
-         %70 = OpCompositeConstruct %mat4v3float %66 %67 %68 %69
-               OpStore %61 %70 None
+         %89 = OpLabel
+         %91 = OpAccessChain %_ptr_Function_mat4v3float %47 %55
+         %93 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %45 %55
+         %95 = OpLoad %mat4x3_f32_std140 %93 None
+         %96 = OpCompositeExtract %v3float %95 0
+         %97 = OpCompositeExtract %v3float %95 1
+         %98 = OpCompositeExtract %v3float %95 2
+         %99 = OpCompositeExtract %v3float %95 3
+        %100 = OpCompositeConstruct %mat4v3float %96 %97 %98 %99
+               OpStore %91 %100 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %72 = OpLoad %_arr_mat4v3float_uint_4 %47 None
-         %73 = OpFunctionCall %float %a %72
+         %57 = OpLoad %_arr_mat4v3float_uint_4 %47 None
+         %58 = OpFunctionCall %float %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v3float %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v3float %63 None
+         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_2
+         %67 = OpLoad %v3float %65 None
+         %68 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_3
+         %70 = OpLoad %v3float %68 None
+         %71 = OpCompositeConstruct %mat4v3float %62 %64 %67 %70
+         %72 = OpFunctionCall %float %b %71
+         %73 = OpFAdd %float %58 %72
          %74 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %76 = OpLoad %v3float %74 None
-         %77 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_1
-         %78 = OpLoad %v3float %77 None
-         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_2
-         %81 = OpLoad %v3float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_3
-         %84 = OpLoad %v3float %82 None
-         %85 = OpCompositeConstruct %mat4v3float %76 %78 %81 %84
-         %86 = OpFunctionCall %float %b %85
-         %87 = OpFAdd %float %73 %86
-         %88 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %89 = OpLoad %v3float %88 None
-         %90 = OpVectorShuffle %v3float %89 %89 2 0 1
-         %91 = OpFunctionCall %float %c %90
-         %92 = OpFAdd %float %87 %91
-         %93 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
-         %94 = OpLoad %v3float %93 None
-         %95 = OpVectorShuffle %v3float %94 %94 2 0 1
-         %96 = OpCompositeExtract %float %95 0
-         %97 = OpFunctionCall %float %d %96
-         %98 = OpFAdd %float %92 %97
-         %99 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %99 %98 None
+         %75 = OpLoad %v3float %74 None
+         %76 = OpVectorShuffle %v3float %75 %75 2 0 1
+         %77 = OpFunctionCall %float %c %76
+         %78 = OpFAdd %float %73 %77
+         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_1 %uint_0
+         %80 = OpLoad %v3float %79 None
+         %81 = OpVectorShuffle %v3float %80 %80 2 0 1
+         %82 = OpCompositeExtract %float %81 0
+         %83 = OpFunctionCall %float %d %82
+         %84 = OpFAdd %float %78 %83
+         %85 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %85 %84 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f32_std140_uint_4_0 None %102
@@ -180,21 +180,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %104 %113
-        %119 = OpLoad %mat4x3_f32_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %104 %113
+        %120 = OpLoad %mat4x3_f32_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.spvasm
index 6180dae..4166830 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.spvasm
@@ -59,11 +59,8 @@
 %_arr_mat4x3_f32_std140_uint_4_0 = OpTypeArray %mat4x3_f32_std140 %uint_4
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat4v3float_uint_4 = OpTypePointer Function %_arr_mat4v3float_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat4v3float = OpTypePointer Private %mat4v3float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
@@ -71,6 +68,9 @@
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Private_float = OpTypePointer Private %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
+%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
          %88 = OpTypeFunction %_arr_mat4x3_f32_std140_uint_4_0 %_arr_mat4x3_f32_std140_uint_4
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4
          %93 = OpConstantNull %_arr_mat4x3_f32_std140_uint_4_0
@@ -90,55 +90,55 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %73 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %76 %75
+         %76 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat4v3float %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %29 %38
-         %48 = OpLoad %mat4x3_f32_std140 %46 None
-         %49 = OpCompositeExtract %v3float %48 0
-         %50 = OpCompositeExtract %v3float %48 1
-         %51 = OpCompositeExtract %v3float %48 2
-         %52 = OpCompositeExtract %v3float %48 3
-         %53 = OpCompositeConstruct %mat4v3float %49 %50 %51 %52
-               OpStore %44 %53 None
+         %75 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_mat4v3float %31 %38
+         %79 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %29 %38
+         %81 = OpLoad %mat4x3_f32_std140 %79 None
+         %82 = OpCompositeExtract %v3float %81 0
+         %83 = OpCompositeExtract %v3float %81 1
+         %84 = OpCompositeExtract %v3float %81 2
+         %85 = OpCompositeExtract %v3float %81 3
+         %86 = OpCompositeConstruct %mat4v3float %82 %83 %84 %85
+               OpStore %77 %86 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %55 = OpLoad %_arr_mat4v3float_uint_4 %31 None
-               OpStore %p %55 None
-         %56 = OpAccessChain %_ptr_Private_mat4v3float %p %uint_1
-         %58 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %61 = OpLoad %v3float %58 None
-         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %63 = OpLoad %v3float %62 None
-         %64 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %65 = OpLoad %v3float %64 None
-         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v3float %66 None
-         %69 = OpCompositeConstruct %mat4v3float %61 %63 %65 %68
-               OpStore %56 %69 None
-         %70 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %73 = OpLoad %v3float %72 None
-         %74 = OpVectorShuffle %v3float %73 %73 2 0 1
-               OpStore %70 %74 None
-         %75 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %77 = OpAccessChain %_ptr_Uniform_float %76 %uint_0
-         %79 = OpLoad %float %77 None
-         %80 = OpAccessChain %_ptr_Private_float %75 %uint_0
-               OpStore %80 %79 None
-         %82 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Private_float %82 %uint_0
-         %84 = OpLoad %float %83 None
-         %85 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
-               OpStore %85 %84 None
+         %40 = OpLoad %_arr_mat4v3float_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat4v3float %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v3float %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v3float %48 None
+         %50 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %51 = OpLoad %v3float %50 None
+         %52 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %54 = OpLoad %v3float %52 None
+         %55 = OpCompositeConstruct %mat4v3float %47 %49 %51 %54
+               OpStore %41 %55 None
+         %56 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %58 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %59 = OpLoad %v3float %58 None
+         %60 = OpVectorShuffle %v3float %59 %59 2 0 1
+               OpStore %56 %60 None
+         %61 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %63 = OpAccessChain %_ptr_Uniform_float %62 %uint_0
+         %65 = OpLoad %float %63 None
+         %66 = OpAccessChain %_ptr_Private_float %61 %uint_0
+               OpStore %66 %65 None
+         %68 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Private_float %68 %uint_0
+         %70 = OpLoad %float %69 None
+         %71 = OpAccessChain %_ptr_StorageBuffer_float %10 %uint_0
+               OpStore %71 %70 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x3_f32_std140_uint_4_0 None %88
@@ -155,21 +155,21 @@
                OpLoopMerge %98 %96 None
                OpBranch %95
          %95 = OpLabel
-        %101 = OpUGreaterThanEqual %bool %99 %uint_4
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %102
-        %103 = OpLabel
+        %102 = OpUGreaterThanEqual %bool %99 %uint_4
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
+        %104 = OpLabel
                OpBranch %98
-        %102 = OpLabel
-        %104 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %90 %99
-        %105 = OpLoad %mat4x3_f32_std140 %104 None
-        %106 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %92 %99
-               OpStore %106 %105 None
+        %103 = OpLabel
+        %105 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %90 %99
+        %106 = OpLoad %mat4x3_f32_std140 %105 None
+        %107 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %92 %99
+               OpStore %107 %106 None
                OpBranch %96
          %96 = OpLabel
         %100 = OpIAdd %uint %99 %uint_1
                OpBranch %97
          %98 = OpLabel
-        %107 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %92 None
-               OpReturnValue %107
+        %101 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %92 None
+               OpReturnValue %101
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.spvasm
index 9e256bf..6593b74 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.spvasm
@@ -65,17 +65,17 @@
 %_arr_mat4v3float_uint_4_0 = OpTypeArray %mat4v3float %uint_4
 %_ptr_Function__arr_mat4v3float_uint_4_0 = OpTypePointer Function %_arr_mat4v3float_uint_4_0
          %31 = OpConstantNull %_arr_mat4v3float_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
+%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
          %86 = OpTypeFunction %void %_arr_mat4v3float_uint_4_0
         %105 = OpTypeFunction %void %_arr_uint_uint_1 %mat4v3float
         %117 = OpTypeFunction %_arr_mat4x3_f32_std140_uint_4_0 %_arr_mat4x3_f32_std140_uint_4
@@ -97,50 +97,50 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %71 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %74 %73
+         %74 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat4v3float %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %26 %37
-         %47 = OpLoad %mat4x3_f32_std140 %45 None
-         %48 = OpCompositeExtract %v3float %47 0
-         %49 = OpCompositeExtract %v3float %47 1
-         %50 = OpCompositeExtract %v3float %47 2
-         %51 = OpCompositeExtract %v3float %47 3
-         %52 = OpCompositeConstruct %mat4v3float %48 %49 %50 %51
-               OpStore %43 %52 None
+         %73 = OpLabel
+         %75 = OpAccessChain %_ptr_Function_mat4v3float %28 %37
+         %77 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %26 %37
+         %79 = OpLoad %mat4x3_f32_std140 %77 None
+         %80 = OpCompositeExtract %v3float %79 0
+         %81 = OpCompositeExtract %v3float %79 1
+         %82 = OpCompositeExtract %v3float %79 2
+         %83 = OpCompositeExtract %v3float %79 3
+         %84 = OpCompositeConstruct %mat4v3float %80 %81 %82 %83
+               OpStore %75 %84 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %54 = OpLoad %_arr_mat4v3float_uint_4_0 %28 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %60 = OpLoad %v3float %57 None
-         %61 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %39 = OpLoad %_arr_mat4v3float_uint_4_0 %28 None
+         %40 = OpFunctionCall %void %tint_store_and_preserve_padding %39
+         %42 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %45 = OpLoad %v3float %42 None
+         %46 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %48 = OpLoad %v3float %46 None
+         %49 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %50 = OpLoad %v3float %49 None
+         %51 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %53 = OpLoad %v3float %51 None
+         %54 = OpCompositeConstruct %mat4v3float %45 %48 %50 %53
+         %56 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %57 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %56 %54
+         %59 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
+         %61 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
          %62 = OpLoad %v3float %61 None
-         %63 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %64 = OpLoad %v3float %63 None
-         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %67 = OpLoad %v3float %65 None
-         %68 = OpCompositeConstruct %mat4v3float %60 %62 %64 %67
-         %70 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %71 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %70 %68
-         %73 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
-         %75 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %76 = OpLoad %v3float %75 None
-         %77 = OpVectorShuffle %v3float %76 %76 2 0 1
-               OpStore %73 %77 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %80 = OpAccessChain %_ptr_Uniform_float %79 %uint_0
-         %82 = OpLoad %float %80 None
-         %83 = OpAccessChain %_ptr_StorageBuffer_float %78 %uint_0
-               OpStore %83 %82 None
+         %63 = OpVectorShuffle %v3float %62 %62 2 0 1
+               OpStore %59 %63 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_v3float %10 %uint_0 %uint_1 %uint_0
+         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %66 = OpAccessChain %_ptr_Uniform_float %65 %uint_0
+         %68 = OpLoad %float %66 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_float %64 %uint_0
+               OpStore %69 %68 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %86
@@ -206,21 +206,21 @@
                OpLoopMerge %127 %125 None
                OpBranch %124
         %124 = OpLabel
-        %130 = OpUGreaterThanEqual %bool %128 %uint_4
-               OpSelectionMerge %131 None
-               OpBranchConditional %130 %132 %131
-        %132 = OpLabel
+        %131 = OpUGreaterThanEqual %bool %128 %uint_4
+               OpSelectionMerge %132 None
+               OpBranchConditional %131 %133 %132
+        %133 = OpLabel
                OpBranch %127
-        %131 = OpLabel
-        %133 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %119 %128
-        %134 = OpLoad %mat4x3_f32_std140 %133 None
-        %135 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %121 %128
-               OpStore %135 %134 None
+        %132 = OpLabel
+        %134 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %119 %128
+        %135 = OpLoad %mat4x3_f32_std140 %134 None
+        %136 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %121 %128
+               OpStore %136 %135 None
                OpBranch %125
         %125 = OpLabel
         %129 = OpIAdd %uint %128 %uint_1
                OpBranch %126
         %127 = OpLabel
-        %136 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %121 None
-               OpReturnValue %136
+        %130 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %121 None
+               OpReturnValue %130
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
index efa5272..227242f 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -49,10 +49,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat4v3float = OpTypePointer Workgroup %mat4v3float
-         %34 = OpConstantNull %mat4v3float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat4x3_f32_std140_uint_4 = OpTypePointer Uniform %_arr_mat4x3_f32_std140_uint_4
@@ -60,14 +56,18 @@
 %_arr_mat4x3_f32_std140_uint_4_0 = OpTypeArray %mat4x3_f32_std140 %uint_4
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4_0
 %_ptr_Function__arr_mat4v3float_uint_4 = OpTypePointer Function %_arr_mat4v3float_uint_4
-         %50 = OpConstantNull %_arr_mat4v3float_uint_4
-%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
-%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
+         %42 = OpConstantNull %_arr_mat4v3float_uint_4
+%_ptr_Workgroup_mat4v3float = OpTypePointer Workgroup %mat4v3float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %82 = OpConstantNull %mat4v3float
+%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
+%_ptr_Function_mat4x3_f32_std140 = OpTypePointer Function %mat4x3_f32_std140
          %97 = OpTypeFunction %void
         %102 = OpTypeFunction %_arr_mat4x3_f32_std140_uint_4_0 %_arr_mat4x3_f32_std140_uint_4
 %_ptr_Function__arr_mat4x3_f32_std140_uint_4 = OpTypePointer Function %_arr_mat4x3_f32_std140_uint_4
@@ -75,8 +75,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat4x3_f32_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat4v3float_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat4x3_f32_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat4v3float_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -85,76 +85,76 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat4v3float %w %26
-               OpStore %32 %34 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_mat4v3float %w %26
+               OpStore %81 %82 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat4x3_f32_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat4x3_f32_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat4x3_f32_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v3float %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %46 %56
-         %65 = OpLoad %mat4x3_f32_std140 %63 None
-         %66 = OpCompositeExtract %v3float %65 0
-         %67 = OpCompositeExtract %v3float %65 1
-         %68 = OpCompositeExtract %v3float %65 2
-         %69 = OpCompositeExtract %v3float %65 3
-         %70 = OpCompositeConstruct %mat4v3float %66 %67 %68 %69
-               OpStore %61 %70 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %71 = OpLoad %_arr_mat4v3float_uint_4 %48 None
-               OpStore %w %71 None
-         %72 = OpAccessChain %_ptr_Workgroup_mat4v3float %w %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
-         %75 = OpLoad %v3float %73 None
-         %76 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %77 = OpLoad %v3float %76 None
-         %78 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %79 = OpLoad %v3float %78 None
-         %80 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %82 = OpLoad %v3float %80 None
-         %83 = OpCompositeConstruct %mat4v3float %75 %77 %79 %82
-               OpStore %72 %83 None
-         %84 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
-         %86 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %87 = OpLoad %v3float %86 None
-         %88 = OpVectorShuffle %v3float %87 %87 2 0 1
-               OpStore %84 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
-         %90 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
-         %91 = OpAccessChain %_ptr_Uniform_float %90 %uint_0
-         %93 = OpLoad %float %91 None
-         %94 = OpAccessChain %_ptr_Workgroup_float %89 %uint_0
-               OpStore %94 %93 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat4x3_f32_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat4x3_f32_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat4x3_f32_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %47
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_mat4v3float %40 %48
+         %88 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %38 %48
+         %90 = OpLoad %mat4x3_f32_std140 %88 None
+         %91 = OpCompositeExtract %v3float %90 0
+         %92 = OpCompositeExtract %v3float %90 1
+         %93 = OpCompositeExtract %v3float %90 2
+         %94 = OpCompositeExtract %v3float %90 3
+         %95 = OpCompositeConstruct %mat4v3float %91 %92 %93 %94
+               OpStore %86 %95 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat4v3float_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat4v3float %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v3float %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3float %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3float %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v3float %61 None
+         %64 = OpCompositeConstruct %mat4v3float %56 %58 %60 %63
+               OpStore %51 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %68 = OpLoad %v3float %67 None
+         %69 = OpVectorShuffle %v3float %68 %68 2 0 1
+               OpStore %65 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_1
+         %72 = OpAccessChain %_ptr_Uniform_float %71 %uint_0
+         %74 = OpLoad %float %72 None
+         %75 = OpAccessChain %_ptr_Workgroup_float %70 %uint_0
+               OpStore %75 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %97
@@ -177,21 +177,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %104 %113
-        %119 = OpLoad %mat4x3_f32_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %104 %113
+        %120 = OpLoad %mat4x3_f32_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x3_f32_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x3_f32_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index a81adc9..0eec30d 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -77,9 +77,9 @@
 %_arr_mat4v4half_uint_4 = OpTypeArray %mat4v4half %uint_4
 %_ptr_Function__arr_mat4v4half_uint_4 = OpTypePointer Function %_arr_mat4v4half_uint_4
          %66 = OpConstantNull %_arr_mat4v4half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %98 = OpTypeFunction %_arr_mat4x4_f16_std140_uint_4_0 %_arr_mat4x4_f16_std140_uint_4
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4
         %103 = OpConstantNull %_arr_mat4x4_f16_std140_uint_4_0
@@ -126,36 +126,36 @@
                OpLoopMerge %71 %69 None
                OpBranch %68
          %68 = OpLabel
-         %74 = OpUGreaterThanEqual %bool %72 %uint_4
-               OpSelectionMerge %76 None
-               OpBranchConditional %74 %77 %76
-         %77 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %72 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %71
-         %76 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_mat4v4half %63 %72
-         %79 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %61 %72
-         %81 = OpLoad %mat4x4_f16_std140 %79 None
-         %82 = OpCompositeExtract %v4half %81 0
-         %83 = OpCompositeExtract %v4half %81 1
-         %84 = OpCompositeExtract %v4half %81 2
-         %85 = OpCompositeExtract %v4half %81 3
-         %86 = OpCompositeConstruct %mat4v4half %82 %83 %84 %85
-               OpStore %78 %86 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_mat4v4half %63 %72
+         %89 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %61 %72
+         %91 = OpLoad %mat4x4_f16_std140 %89 None
+         %92 = OpCompositeExtract %v4half %91 0
+         %93 = OpCompositeExtract %v4half %91 1
+         %94 = OpCompositeExtract %v4half %91 2
+         %95 = OpCompositeExtract %v4half %91 3
+         %96 = OpCompositeConstruct %mat4v4half %92 %93 %94 %95
+               OpStore %88 %96 None
                OpBranch %69
          %69 = OpLabel
          %73 = OpIAdd %uint %72 %uint_1
                OpBranch %70
          %71 = OpLabel
         %l_a = OpLoad %_arr_mat4v4half_uint_4 %63 None
-         %88 = OpCompositeExtract %half %l_a_i_i 0
-         %89 = OpCompositeExtract %half %l_a 0 0 0
-         %90 = OpFAdd %half %88 %89
-         %91 = OpCompositeExtract %half %l_a_i 0 0
-         %92 = OpFAdd %half %90 %91
-         %93 = OpCompositeExtract %half %l_a_i_i 0
-         %94 = OpFAdd %half %92 %93
-         %95 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %95 %94 None
+         %75 = OpCompositeExtract %half %l_a_i_i 0
+         %76 = OpCompositeExtract %half %l_a 0 0 0
+         %77 = OpFAdd %half %75 %76
+         %78 = OpCompositeExtract %half %l_a_i 0 0
+         %79 = OpFAdd %half %77 %78
+         %80 = OpCompositeExtract %half %l_a_i_i 0
+         %81 = OpFAdd %half %79 %80
+         %82 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %82 %81 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x4_f16_std140_uint_4_0 None %98
@@ -172,21 +172,21 @@
                OpLoopMerge %108 %106 None
                OpBranch %105
         %105 = OpLabel
-        %111 = OpUGreaterThanEqual %bool %109 %uint_4
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %112
-        %113 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %109 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %112 %114 %113
+        %114 = OpLabel
                OpBranch %108
-        %112 = OpLabel
-        %114 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %100 %109
-        %115 = OpLoad %mat4x4_f16_std140 %114 None
-        %116 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %102 %109
-               OpStore %116 %115 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %100 %109
+        %116 = OpLoad %mat4x4_f16_std140 %115 None
+        %117 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %102 %109
+               OpStore %117 %116 None
                OpBranch %106
         %106 = OpLabel
         %110 = OpIAdd %uint %109 %uint_1
                OpBranch %107
         %108 = OpLabel
-        %117 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %102 None
-               OpReturnValue %117
+        %111 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %102 None
+               OpReturnValue %111
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm
index 41e9364..9a68921 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -66,10 +66,10 @@
 %_arr_mat4v4half_uint_4 = OpTypeArray %mat4v4half %uint_4
 %_ptr_Function__arr_mat4v4half_uint_4 = OpTypePointer Function %_arr_mat4v4half_uint_4
          %44 = OpConstantNull %_arr_mat4v4half_uint_4
+%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
        %bool = OpTypeBool
 %_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
 %_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
-%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
          %77 = OpTypeFunction %_arr_mat4x4_f16_std140_uint_4_0 %_arr_mat4x4_f16_std140_uint_4
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4
          %82 = OpConstantNull %_arr_mat4x4_f16_std140_uint_4_0
@@ -99,36 +99,36 @@
                OpLoopMerge %49 %47 None
                OpBranch %46
          %46 = OpLabel
-         %52 = OpUGreaterThanEqual %bool %50 %uint_4
-               OpSelectionMerge %54 None
-               OpBranchConditional %52 %55 %54
-         %55 = OpLabel
+         %62 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %64 None
+               OpBranchConditional %62 %65 %64
+         %65 = OpLabel
                OpBranch %49
-         %54 = OpLabel
-         %56 = OpAccessChain %_ptr_Function_mat4v4half %41 %50
-         %58 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %39 %50
-         %60 = OpLoad %mat4x4_f16_std140 %58 None
-         %61 = OpCompositeExtract %v4half %60 0
-         %62 = OpCompositeExtract %v4half %60 1
-         %63 = OpCompositeExtract %v4half %60 2
-         %64 = OpCompositeExtract %v4half %60 3
-         %65 = OpCompositeConstruct %mat4v4half %61 %62 %63 %64
-               OpStore %56 %65 None
+         %64 = OpLabel
+         %66 = OpAccessChain %_ptr_Function_mat4v4half %41 %50
+         %68 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %39 %50
+         %70 = OpLoad %mat4x4_f16_std140 %68 None
+         %71 = OpCompositeExtract %v4half %70 0
+         %72 = OpCompositeExtract %v4half %70 1
+         %73 = OpCompositeExtract %v4half %70 2
+         %74 = OpCompositeExtract %v4half %70 3
+         %75 = OpCompositeConstruct %mat4v4half %71 %72 %73 %74
+               OpStore %66 %75 None
                OpBranch %47
          %47 = OpLabel
          %51 = OpIAdd %uint %50 %uint_1
                OpBranch %48
          %49 = OpLabel
         %l_a = OpLoad %_arr_mat4v4half_uint_4 %41 None
-         %67 = OpCompositeExtract %half %l_a_i_i 0
-         %68 = OpCompositeExtract %half %l_a 0 0 0
-         %69 = OpFAdd %half %67 %68
-         %70 = OpCompositeExtract %half %l_a_i 0 0
-         %71 = OpFAdd %half %69 %70
-         %72 = OpCompositeExtract %half %l_a_i_i 0
-         %73 = OpFAdd %half %71 %72
-         %74 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %74 %73 None
+         %53 = OpCompositeExtract %half %l_a_i_i 0
+         %54 = OpCompositeExtract %half %l_a 0 0 0
+         %55 = OpFAdd %half %53 %54
+         %56 = OpCompositeExtract %half %l_a_i 0 0
+         %57 = OpFAdd %half %55 %56
+         %58 = OpCompositeExtract %half %l_a_i_i 0
+         %59 = OpFAdd %half %57 %58
+         %60 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %60 %59 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x4_f16_std140_uint_4_0 None %77
@@ -145,21 +145,21 @@
                OpLoopMerge %87 %85 None
                OpBranch %84
          %84 = OpLabel
-         %90 = OpUGreaterThanEqual %bool %88 %uint_4
-               OpSelectionMerge %91 None
-               OpBranchConditional %90 %92 %91
-         %92 = OpLabel
+         %91 = OpUGreaterThanEqual %bool %88 %uint_4
+               OpSelectionMerge %92 None
+               OpBranchConditional %91 %93 %92
+         %93 = OpLabel
                OpBranch %87
-         %91 = OpLabel
-         %93 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %79 %88
-         %94 = OpLoad %mat4x4_f16_std140 %93 None
-         %95 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %81 %88
-               OpStore %95 %94 None
+         %92 = OpLabel
+         %94 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %79 %88
+         %95 = OpLoad %mat4x4_f16_std140 %94 None
+         %96 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %81 %88
+               OpStore %96 %95 None
                OpBranch %85
          %85 = OpLabel
          %89 = OpIAdd %uint %88 %uint_1
                OpBranch %86
          %87 = OpLabel
-         %96 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %81 None
-               OpReturnValue %96
+         %90 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %81 None
+               OpReturnValue %90
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.spvasm
index 005d978..15f5620 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.spvasm
@@ -71,14 +71,14 @@
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v4half_uint_4 = OpTypePointer Function %_arr_mat4v4half_uint_4
          %49 = OpConstantNull %_arr_mat4v4half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
+     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
+%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
         %102 = OpTypeFunction %_arr_mat4x4_f16_std140_uint_4_0 %_arr_mat4x4_f16_std140_uint_4
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4
         %107 = OpConstantNull %_arr_mat4x4_f16_std140_uint_4_0
@@ -121,52 +121,52 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %87 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %89 None
+               OpBranchConditional %87 %90 %89
+         %90 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v4half %47 %55
-         %63 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %45 %55
-         %65 = OpLoad %mat4x4_f16_std140 %63 None
-         %66 = OpCompositeExtract %v4half %65 0
-         %67 = OpCompositeExtract %v4half %65 1
-         %68 = OpCompositeExtract %v4half %65 2
-         %69 = OpCompositeExtract %v4half %65 3
-         %70 = OpCompositeConstruct %mat4v4half %66 %67 %68 %69
-               OpStore %61 %70 None
+         %89 = OpLabel
+         %91 = OpAccessChain %_ptr_Function_mat4v4half %47 %55
+         %93 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %45 %55
+         %95 = OpLoad %mat4x4_f16_std140 %93 None
+         %96 = OpCompositeExtract %v4half %95 0
+         %97 = OpCompositeExtract %v4half %95 1
+         %98 = OpCompositeExtract %v4half %95 2
+         %99 = OpCompositeExtract %v4half %95 3
+        %100 = OpCompositeConstruct %mat4v4half %96 %97 %98 %99
+               OpStore %91 %100 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %72 = OpLoad %_arr_mat4v4half_uint_4 %47 None
-         %73 = OpFunctionCall %half %a %72
+         %57 = OpLoad %_arr_mat4v4half_uint_4 %47 None
+         %58 = OpFunctionCall %half %a %57
+         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
+         %62 = OpLoad %v4half %59 None
+         %63 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_1
+         %64 = OpLoad %v4half %63 None
+         %65 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_2
+         %67 = OpLoad %v4half %65 None
+         %68 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_3
+         %70 = OpLoad %v4half %68 None
+         %71 = OpCompositeConstruct %mat4v4half %62 %64 %67 %70
+         %72 = OpFunctionCall %half %b %71
+         %73 = OpFAdd %half %58 %72
          %74 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
-         %76 = OpLoad %v4half %74 None
-         %77 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_1
-         %78 = OpLoad %v4half %77 None
-         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_2
-         %81 = OpLoad %v4half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_3
-         %84 = OpLoad %v4half %82 None
-         %85 = OpCompositeConstruct %mat4v4half %76 %78 %81 %84
-         %86 = OpFunctionCall %half %b %85
-         %87 = OpFAdd %half %73 %86
-         %88 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
-         %89 = OpLoad %v4half %88 None
-         %90 = OpVectorShuffle %v4half %89 %89 1 3 0 2
-         %91 = OpFunctionCall %half %c %90
-         %92 = OpFAdd %half %87 %91
-         %93 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
-         %94 = OpLoad %v4half %93 None
-         %95 = OpVectorShuffle %v4half %94 %94 1 3 0 2
-         %96 = OpCompositeExtract %half %95 0
-         %97 = OpFunctionCall %half %d %96
-         %98 = OpFAdd %half %92 %97
-         %99 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %99 %98 None
+         %75 = OpLoad %v4half %74 None
+         %76 = OpVectorShuffle %v4half %75 %75 1 3 0 2
+         %77 = OpFunctionCall %half %c %76
+         %78 = OpFAdd %half %73 %77
+         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_1 %uint_0
+         %80 = OpLoad %v4half %79 None
+         %81 = OpVectorShuffle %v4half %80 %80 1 3 0 2
+         %82 = OpCompositeExtract %half %81 0
+         %83 = OpFunctionCall %half %d %82
+         %84 = OpFAdd %half %78 %83
+         %85 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %85 %84 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x4_f16_std140_uint_4_0 None %102
@@ -183,21 +183,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %104 %113
-        %119 = OpLoad %mat4x4_f16_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %104 %113
+        %120 = OpLoad %mat4x4_f16_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.spvasm
index 16b3ff48..2ce6354 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.spvasm
@@ -62,11 +62,8 @@
 %_arr_mat4x4_f16_std140_uint_4_0 = OpTypeArray %mat4x4_f16_std140 %uint_4
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v4half_uint_4 = OpTypePointer Function %_arr_mat4v4half_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_mat4v4half = OpTypePointer Private %mat4v4half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
@@ -74,6 +71,9 @@
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Private_half = OpTypePointer Private %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
+%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
          %88 = OpTypeFunction %_arr_mat4x4_f16_std140_uint_4_0 %_arr_mat4x4_f16_std140_uint_4
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4
          %93 = OpConstantNull %_arr_mat4x4_f16_std140_uint_4_0
@@ -93,55 +93,55 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %73 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %76 %75
+         %76 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_mat4v4half %31 %38
-         %46 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %29 %38
-         %48 = OpLoad %mat4x4_f16_std140 %46 None
-         %49 = OpCompositeExtract %v4half %48 0
-         %50 = OpCompositeExtract %v4half %48 1
-         %51 = OpCompositeExtract %v4half %48 2
-         %52 = OpCompositeExtract %v4half %48 3
-         %53 = OpCompositeConstruct %mat4v4half %49 %50 %51 %52
-               OpStore %44 %53 None
+         %75 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_mat4v4half %31 %38
+         %79 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %29 %38
+         %81 = OpLoad %mat4x4_f16_std140 %79 None
+         %82 = OpCompositeExtract %v4half %81 0
+         %83 = OpCompositeExtract %v4half %81 1
+         %84 = OpCompositeExtract %v4half %81 2
+         %85 = OpCompositeExtract %v4half %81 3
+         %86 = OpCompositeConstruct %mat4v4half %82 %83 %84 %85
+               OpStore %77 %86 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %55 = OpLoad %_arr_mat4v4half_uint_4 %31 None
-               OpStore %p %55 None
-         %56 = OpAccessChain %_ptr_Private_mat4v4half %p %uint_1
-         %58 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
-         %61 = OpLoad %v4half %58 None
-         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %63 = OpLoad %v4half %62 None
-         %64 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %65 = OpLoad %v4half %64 None
-         %66 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v4half %66 None
-         %69 = OpCompositeConstruct %mat4v4half %61 %63 %65 %68
-               OpStore %56 %69 None
-         %70 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %73 = OpLoad %v4half %72 None
-         %74 = OpVectorShuffle %v4half %73 %73 1 3 0 2
-               OpStore %70 %74 None
-         %75 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
-         %76 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %77 = OpAccessChain %_ptr_Uniform_half %76 %uint_0
-         %79 = OpLoad %half %77 None
-         %80 = OpAccessChain %_ptr_Private_half %75 %uint_0
-               OpStore %80 %79 None
-         %82 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
-         %83 = OpAccessChain %_ptr_Private_half %82 %uint_0
-         %84 = OpLoad %half %83 None
-         %85 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
-               OpStore %85 %84 None
+         %40 = OpLoad %_arr_mat4v4half_uint_4 %31 None
+               OpStore %p %40 None
+         %41 = OpAccessChain %_ptr_Private_mat4v4half %p %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
+         %47 = OpLoad %v4half %44 None
+         %48 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %49 = OpLoad %v4half %48 None
+         %50 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %51 = OpLoad %v4half %50 None
+         %52 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %54 = OpLoad %v4half %52 None
+         %55 = OpCompositeConstruct %mat4v4half %47 %49 %51 %54
+               OpStore %41 %55 None
+         %56 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
+         %58 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %59 = OpLoad %v4half %58 None
+         %60 = OpVectorShuffle %v4half %59 %59 1 3 0 2
+               OpStore %56 %60 None
+         %61 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %63 = OpAccessChain %_ptr_Uniform_half %62 %uint_0
+         %65 = OpLoad %half %63 None
+         %66 = OpAccessChain %_ptr_Private_half %61 %uint_0
+               OpStore %66 %65 None
+         %68 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Private_half %68 %uint_0
+         %70 = OpLoad %half %69 None
+         %71 = OpAccessChain %_ptr_StorageBuffer_half %10 %uint_0
+               OpStore %71 %70 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4x4_f16_std140_uint_4_0 None %88
@@ -158,21 +158,21 @@
                OpLoopMerge %98 %96 None
                OpBranch %95
          %95 = OpLabel
-        %101 = OpUGreaterThanEqual %bool %99 %uint_4
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %102
-        %103 = OpLabel
+        %102 = OpUGreaterThanEqual %bool %99 %uint_4
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
+        %104 = OpLabel
                OpBranch %98
-        %102 = OpLabel
-        %104 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %90 %99
-        %105 = OpLoad %mat4x4_f16_std140 %104 None
-        %106 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %92 %99
-               OpStore %106 %105 None
+        %103 = OpLabel
+        %105 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %90 %99
+        %106 = OpLoad %mat4x4_f16_std140 %105 None
+        %107 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %92 %99
+               OpStore %107 %106 None
                OpBranch %96
          %96 = OpLabel
         %100 = OpIAdd %uint %99 %uint_1
                OpBranch %97
          %98 = OpLabel
-        %107 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %92 None
-               OpReturnValue %107
+        %101 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %92 None
+               OpReturnValue %101
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.spvasm
index 1dc249d..8c9c387 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.spvasm
@@ -65,18 +65,18 @@
 %_arr_mat4v4half_uint_4_0 = OpTypeArray %mat4v4half %uint_4
 %_ptr_Function__arr_mat4v4half_uint_4_0 = OpTypePointer Function %_arr_mat4v4half_uint_4_0
          %31 = OpConstantNull %_arr_mat4v4half_uint_4_0
-       %bool = OpTypeBool
-%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_StorageBuffer__arr_mat4v4half_uint_4 = OpTypePointer StorageBuffer %_arr_mat4v4half_uint_4
 %_ptr_StorageBuffer_mat4v4half = OpTypePointer StorageBuffer %mat4v4half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
      %uint_2 = OpConstant %uint 2
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
+%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
          %86 = OpTypeFunction %_arr_mat4v4half_uint_4 %_arr_mat4v4half_uint_4_0
 %_ptr_Function__arr_mat4v4half_uint_4 = OpTypePointer Function %_arr_mat4v4half_uint_4
          %91 = OpConstantNull %_arr_mat4v4half_uint_4
@@ -99,52 +99,52 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %71 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %74 %73
+         %74 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_mat4v4half %28 %37
-         %45 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %26 %37
-         %47 = OpLoad %mat4x4_f16_std140 %45 None
-         %48 = OpCompositeExtract %v4half %47 0
-         %49 = OpCompositeExtract %v4half %47 1
-         %50 = OpCompositeExtract %v4half %47 2
-         %51 = OpCompositeExtract %v4half %47 3
-         %52 = OpCompositeConstruct %mat4v4half %48 %49 %50 %51
-               OpStore %43 %52 None
+         %73 = OpLabel
+         %75 = OpAccessChain %_ptr_Function_mat4v4half %28 %37
+         %77 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %26 %37
+         %79 = OpLoad %mat4x4_f16_std140 %77 None
+         %80 = OpCompositeExtract %v4half %79 0
+         %81 = OpCompositeExtract %v4half %79 1
+         %82 = OpCompositeExtract %v4half %79 2
+         %83 = OpCompositeExtract %v4half %79 3
+         %84 = OpCompositeConstruct %mat4v4half %80 %81 %82 %83
+               OpStore %75 %84 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %54 = OpLoad %_arr_mat4v4half_uint_4_0 %28 None
-         %55 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v4half_uint_4 %10 %uint_0
-         %57 = OpFunctionCall %_arr_mat4v4half_uint_4 %tint_convert_explicit_layout %54
-               OpStore %55 %57 None
-         %59 = OpAccessChain %_ptr_StorageBuffer_mat4v4half %10 %uint_0 %uint_1
-         %61 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
-         %64 = OpLoad %v4half %61 None
-         %65 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %66 = OpLoad %v4half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %68 = OpLoad %v4half %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %71 = OpLoad %v4half %69 None
-         %72 = OpCompositeConstruct %mat4v4half %64 %66 %68 %71
-               OpStore %59 %72 None
-         %73 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
-         %75 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %76 = OpLoad %v4half %75 None
-         %77 = OpVectorShuffle %v4half %76 %76 1 3 0 2
-               OpStore %73 %77 None
-         %78 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %80 = OpAccessChain %_ptr_Uniform_half %79 %uint_0
-         %82 = OpLoad %half %80 None
-         %83 = OpAccessChain %_ptr_StorageBuffer_half %78 %uint_0
-               OpStore %83 %82 None
+         %39 = OpLoad %_arr_mat4v4half_uint_4_0 %28 None
+         %40 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v4half_uint_4 %10 %uint_0
+         %42 = OpFunctionCall %_arr_mat4v4half_uint_4 %tint_convert_explicit_layout %39
+               OpStore %40 %42 None
+         %44 = OpAccessChain %_ptr_StorageBuffer_mat4v4half %10 %uint_0 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
+         %50 = OpLoad %v4half %47 None
+         %51 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %v4half %51 None
+         %53 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %54 = OpLoad %v4half %53 None
+         %55 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %57 = OpLoad %v4half %55 None
+         %58 = OpCompositeConstruct %mat4v4half %50 %52 %54 %57
+               OpStore %44 %58 None
+         %59 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
+         %61 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %62 = OpLoad %v4half %61 None
+         %63 = OpVectorShuffle %v4half %62 %62 1 3 0 2
+               OpStore %59 %63 None
+         %64 = OpAccessChain %_ptr_StorageBuffer_v4half %10 %uint_0 %uint_1 %uint_0
+         %65 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %66 = OpAccessChain %_ptr_Uniform_half %65 %uint_0
+         %68 = OpLoad %half %66 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_half %64 %uint_0
+               OpStore %69 %68 None
                OpReturn
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_mat4v4half_uint_4 None %86
@@ -161,23 +161,23 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_mat4v4half %88 %97
-        %103 = OpLoad %mat4v4half %102 None
-        %104 = OpAccessChain %_ptr_Function_mat4v4half %89 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_mat4v4half %88 %97
+        %104 = OpLoad %mat4v4half %103 None
+        %105 = OpAccessChain %_ptr_Function_mat4v4half %89 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_mat4v4half_uint_4 %89 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_mat4v4half_uint_4 %89 None
+               OpReturnValue %99
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4x4_f16_std140_uint_4_0 None %107
 %tint_source_0 = OpFunctionParameter %_arr_mat4x4_f16_std140_uint_4
@@ -193,21 +193,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %109 %118
-        %124 = OpLoad %mat4x4_f16_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %109 %118
+        %125 = OpLoad %mat4x4_f16_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
index b3cbe04..a635bb6 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -52,10 +52,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %19 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat4v4half = OpTypePointer Workgroup %mat4v4half
-         %34 = OpConstantNull %mat4v4half
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat4x4_f16_std140_uint_4 = OpTypePointer Uniform %_arr_mat4x4_f16_std140_uint_4
@@ -63,14 +59,18 @@
 %_arr_mat4x4_f16_std140_uint_4_0 = OpTypeArray %mat4x4_f16_std140 %uint_4
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4_0 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4_0
 %_ptr_Function__arr_mat4v4half_uint_4 = OpTypePointer Function %_arr_mat4v4half_uint_4
-         %50 = OpConstantNull %_arr_mat4v4half_uint_4
-%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
-%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
+         %42 = OpConstantNull %_arr_mat4v4half_uint_4
+%_ptr_Workgroup_mat4v4half = OpTypePointer Workgroup %mat4v4half
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+       %bool = OpTypeBool
+         %82 = OpConstantNull %mat4v4half
+%_ptr_Function_mat4v4half = OpTypePointer Function %mat4v4half
+%_ptr_Function_mat4x4_f16_std140 = OpTypePointer Function %mat4x4_f16_std140
          %97 = OpTypeFunction %void
         %102 = OpTypeFunction %_arr_mat4x4_f16_std140_uint_4_0 %_arr_mat4x4_f16_std140_uint_4
 %_ptr_Function__arr_mat4x4_f16_std140_uint_4 = OpTypePointer Function %_arr_mat4x4_f16_std140_uint_4
@@ -78,8 +78,8 @@
     %f_inner = OpFunction %void None %19
 %tint_local_index = OpFunctionParameter %uint
          %20 = OpLabel
-         %46 = OpVariable %_ptr_Function__arr_mat4x4_f16_std140_uint_4_0 Function
-         %48 = OpVariable %_ptr_Function__arr_mat4v4half_uint_4 Function %50
+         %38 = OpVariable %_ptr_Function__arr_mat4x4_f16_std140_uint_4_0 Function
+         %40 = OpVariable %_ptr_Function__arr_mat4v4half_uint_4 Function %42
                OpBranch %21
          %21 = OpLabel
                OpBranch %24
@@ -88,76 +88,76 @@
                OpLoopMerge %25 %23 None
                OpBranch %22
          %22 = OpLabel
-         %28 = OpUGreaterThanEqual %bool %26 %uint_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %31 %30
-         %31 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %26 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %25
-         %30 = OpLabel
-         %32 = OpAccessChain %_ptr_Workgroup_mat4v4half %w %26
-               OpStore %32 %34 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_mat4v4half %w %26
+               OpStore %81 %82 None
                OpBranch %23
          %23 = OpLabel
          %27 = OpIAdd %uint %26 %uint_1
                OpBranch %24
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Uniform__arr_mat4x4_f16_std140_uint_4 %1 %uint_0
-         %42 = OpLoad %_arr_mat4x4_f16_std140_uint_4 %39 None
-         %43 = OpFunctionCall %_arr_mat4x4_f16_std140_uint_4_0 %tint_convert_explicit_layout %42
-               OpStore %46 %43
-               OpBranch %51
-         %51 = OpLabel
-               OpBranch %54
-         %54 = OpLabel
-         %56 = OpPhi %uint %uint_0 %51 %57 %53
-               OpLoopMerge %55 %53 None
-               OpBranch %52
-         %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpBranch %55
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_mat4v4half %48 %56
-         %63 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %46 %56
-         %65 = OpLoad %mat4x4_f16_std140 %63 None
-         %66 = OpCompositeExtract %v4half %65 0
-         %67 = OpCompositeExtract %v4half %65 1
-         %68 = OpCompositeExtract %v4half %65 2
-         %69 = OpCompositeExtract %v4half %65 3
-         %70 = OpCompositeConstruct %mat4v4half %66 %67 %68 %69
-               OpStore %61 %70 None
-               OpBranch %53
-         %53 = OpLabel
-         %57 = OpIAdd %uint %56 %uint_1
-               OpBranch %54
-         %55 = OpLabel
-         %71 = OpLoad %_arr_mat4v4half_uint_4 %48 None
-               OpStore %w %71 None
-         %72 = OpAccessChain %_ptr_Workgroup_mat4v4half %w %uint_1
-         %73 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
-         %75 = OpLoad %v4half %73 None
-         %76 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %77 = OpLoad %v4half %76 None
-         %78 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %79 = OpLoad %v4half %78 None
-         %80 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %82 = OpLoad %v4half %80 None
-         %83 = OpCompositeConstruct %mat4v4half %75 %77 %79 %82
-               OpStore %72 %83 None
-         %84 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
-         %86 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %87 = OpLoad %v4half %86 None
-         %88 = OpVectorShuffle %v4half %87 %87 1 3 0 2
-               OpStore %84 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
-         %90 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
-         %91 = OpAccessChain %_ptr_Uniform_half %90 %uint_0
-         %93 = OpLoad %half %91 None
-         %94 = OpAccessChain %_ptr_Workgroup_half %89 %uint_0
-               OpStore %94 %93 None
+         %31 = OpAccessChain %_ptr_Uniform__arr_mat4x4_f16_std140_uint_4 %1 %uint_0
+         %34 = OpLoad %_arr_mat4x4_f16_std140_uint_4 %31 None
+         %35 = OpFunctionCall %_arr_mat4x4_f16_std140_uint_4_0 %tint_convert_explicit_layout %34
+               OpStore %38 %35
+               OpBranch %43
+         %43 = OpLabel
+               OpBranch %46
+         %46 = OpLabel
+         %48 = OpPhi %uint %uint_0 %43 %49 %45
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %48 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %47
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_mat4v4half %40 %48
+         %88 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %38 %48
+         %90 = OpLoad %mat4x4_f16_std140 %88 None
+         %91 = OpCompositeExtract %v4half %90 0
+         %92 = OpCompositeExtract %v4half %90 1
+         %93 = OpCompositeExtract %v4half %90 2
+         %94 = OpCompositeExtract %v4half %90 3
+         %95 = OpCompositeConstruct %mat4v4half %91 %92 %93 %94
+               OpStore %86 %95 None
+               OpBranch %45
+         %45 = OpLabel
+         %49 = OpIAdd %uint %48 %uint_1
+               OpBranch %46
+         %47 = OpLabel
+         %50 = OpLoad %_arr_mat4v4half_uint_4 %40 None
+               OpStore %w %50 None
+         %51 = OpAccessChain %_ptr_Workgroup_mat4v4half %w %uint_1
+         %54 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_0
+         %56 = OpLoad %v4half %54 None
+         %57 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v4half %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v4half %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v4half %61 None
+         %64 = OpCompositeConstruct %mat4v4half %56 %58 %60 %63
+               OpStore %51 %64 None
+         %65 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %68 = OpLoad %v4half %67 None
+         %69 = OpVectorShuffle %v4half %68 %68 1 3 0 2
+               OpStore %65 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_1
+         %72 = OpAccessChain %_ptr_Uniform_half %71 %uint_0
+         %74 = OpLoad %half %72 None
+         %75 = OpAccessChain %_ptr_Workgroup_half %70 %uint_0
+               OpStore %75 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %97
@@ -180,21 +180,21 @@
                OpLoopMerge %112 %110 None
                OpBranch %109
         %109 = OpLabel
-        %115 = OpUGreaterThanEqual %bool %113 %uint_4
-               OpSelectionMerge %116 None
-               OpBranchConditional %115 %117 %116
-        %117 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %113 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
                OpBranch %112
-        %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %104 %113
-        %119 = OpLoad %mat4x4_f16_std140 %118 None
-        %120 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %106 %113
-               OpStore %120 %119 None
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %104 %113
+        %120 = OpLoad %mat4x4_f16_std140 %119 None
+        %121 = OpAccessChain %_ptr_Function_mat4x4_f16_std140 %106 %113
+               OpStore %121 %120 None
                OpBranch %110
         %110 = OpLabel
         %114 = OpIAdd %uint %113 %uint_1
                OpBranch %111
         %112 = OpLabel
-        %121 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %106 None
-               OpReturnValue %121
+        %115 = OpLoad %_arr_mat4x4_f16_std140_uint_4_0 %106 None
+               OpReturnValue %115
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 397fd19..ce91537 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -120,21 +120,21 @@
                OpLoopMerge %72 %70 None
                OpBranch %69
          %69 = OpLabel
-         %75 = OpUGreaterThanEqual %bool %73 %uint_4
-               OpSelectionMerge %77 None
-               OpBranchConditional %75 %78 %77
-         %78 = OpLabel
+         %76 = OpUGreaterThanEqual %bool %73 %uint_4
+               OpSelectionMerge %78 None
+               OpBranchConditional %76 %79 %78
+         %79 = OpLabel
                OpBranch %72
-         %77 = OpLabel
-         %79 = OpAccessChain %_ptr_Function_mat4v4float %63 %73
-         %81 = OpLoad %mat4v4float %79 None
-         %82 = OpAccessChain %_ptr_Function_mat4v4float %65 %73
-               OpStore %82 %81 None
+         %78 = OpLabel
+         %80 = OpAccessChain %_ptr_Function_mat4v4float %63 %73
+         %82 = OpLoad %mat4v4float %80 None
+         %83 = OpAccessChain %_ptr_Function_mat4v4float %65 %73
+               OpStore %83 %82 None
                OpBranch %70
          %70 = OpLabel
          %74 = OpIAdd %uint %73 %uint_1
                OpBranch %71
          %72 = OpLabel
-         %84 = OpLoad %_arr_mat4v4float_uint_4_0 %65 None
-               OpReturnValue %84
+         %75 = OpLoad %_arr_mat4v4float_uint_4_0 %65 None
+               OpReturnValue %75
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm
index 748852b..52755aa 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -97,21 +97,21 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %59 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %61
+         %62 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_mat4v4float %46 %56
-         %64 = OpLoad %mat4v4float %62 None
-         %65 = OpAccessChain %_ptr_Function_mat4v4float %48 %56
-               OpStore %65 %64 None
+         %61 = OpLabel
+         %63 = OpAccessChain %_ptr_Function_mat4v4float %46 %56
+         %65 = OpLoad %mat4v4float %63 None
+         %66 = OpAccessChain %_ptr_Function_mat4v4float %48 %56
+               OpStore %66 %65 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
-         %66 = OpLoad %_arr_mat4v4float_uint_4_0 %48 None
-               OpReturnValue %66
+         %58 = OpLoad %_arr_mat4v4float_uint_4_0 %48 None
+               OpReturnValue %58
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.spvasm
index 3b63319..f4261e0 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.spvasm
@@ -128,21 +128,21 @@
                OpLoopMerge %76 %74 None
                OpBranch %73
          %73 = OpLabel
-         %79 = OpUGreaterThanEqual %bool %77 %uint_4
-               OpSelectionMerge %81 None
-               OpBranchConditional %79 %82 %81
-         %82 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %80 %83 %82
+         %83 = OpLabel
                OpBranch %76
-         %81 = OpLabel
-         %83 = OpAccessChain %_ptr_Function_mat4v4float %67 %77
-         %85 = OpLoad %mat4v4float %83 None
-         %86 = OpAccessChain %_ptr_Function_mat4v4float %69 %77
-               OpStore %86 %85 None
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_mat4v4float %67 %77
+         %86 = OpLoad %mat4v4float %84 None
+         %87 = OpAccessChain %_ptr_Function_mat4v4float %69 %77
+               OpStore %87 %86 None
                OpBranch %74
          %74 = OpLabel
          %78 = OpIAdd %uint %77 %uint_1
                OpBranch %75
          %76 = OpLabel
-         %87 = OpLoad %_arr_mat4v4float_uint_4_0 %69 None
-               OpReturnValue %87
+         %79 = OpLoad %_arr_mat4v4float_uint_4_0 %69 None
+               OpReturnValue %79
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.spvasm
index b3c7f13..6a5d3d7 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.spvasm
@@ -104,21 +104,21 @@
                OpLoopMerge %63 %61 None
                OpBranch %60
          %60 = OpLabel
-         %66 = OpUGreaterThanEqual %bool %64 %uint_4
-               OpSelectionMerge %68 None
-               OpBranchConditional %66 %69 %68
-         %69 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %64 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %63
-         %68 = OpLabel
-         %70 = OpAccessChain %_ptr_Function_mat4v4float %55 %64
-         %72 = OpLoad %mat4v4float %70 None
-         %73 = OpAccessChain %_ptr_Function_mat4v4float %57 %64
-               OpStore %73 %72 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_mat4v4float %55 %64
+         %73 = OpLoad %mat4v4float %71 None
+         %74 = OpAccessChain %_ptr_Function_mat4v4float %57 %64
+               OpStore %74 %73 None
                OpBranch %61
          %61 = OpLabel
          %65 = OpIAdd %uint %64 %uint_1
                OpBranch %62
          %63 = OpLabel
-         %74 = OpLoad %_arr_mat4v4float_uint_4_0 %57 None
-               OpReturnValue %74
+         %66 = OpLoad %_arr_mat4v4float_uint_4_0 %57 None
+               OpReturnValue %66
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.spvasm
index a3e6616..651912d 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.spvasm
@@ -104,23 +104,23 @@
                OpLoopMerge %60 %58 None
                OpBranch %57
          %57 = OpLabel
-         %63 = OpUGreaterThanEqual %bool %61 %uint_4
-               OpSelectionMerge %65 None
-               OpBranchConditional %63 %66 %65
-         %66 = OpLabel
+         %64 = OpUGreaterThanEqual %bool %61 %uint_4
+               OpSelectionMerge %66 None
+               OpBranchConditional %64 %67 %66
+         %67 = OpLabel
                OpBranch %60
-         %65 = OpLabel
-         %67 = OpAccessChain %_ptr_Function_mat4v4float %51 %61
-         %69 = OpLoad %mat4v4float %67 None
-         %70 = OpAccessChain %_ptr_Function_mat4v4float %53 %61
-               OpStore %70 %69 None
+         %66 = OpLabel
+         %68 = OpAccessChain %_ptr_Function_mat4v4float %51 %61
+         %70 = OpLoad %mat4v4float %68 None
+         %71 = OpAccessChain %_ptr_Function_mat4v4float %53 %61
+               OpStore %71 %70 None
                OpBranch %58
          %58 = OpLabel
          %62 = OpIAdd %uint %61 %uint_1
                OpBranch %59
          %60 = OpLabel
-         %71 = OpLoad %_arr_mat4v4float_uint_4_0 %53 None
-               OpReturnValue %71
+         %63 = OpLoad %_arr_mat4v4float_uint_4_0 %53 None
+               OpReturnValue %63
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %_arr_mat4v4float_uint_4 None %73
 %tint_source_0 = OpFunctionParameter %_arr_mat4v4float_uint_4_0
@@ -136,21 +136,21 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %86 None
-               OpBranchConditional %85 %87 %86
-         %87 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %87 None
+               OpBranchConditional %86 %88 %87
+         %88 = OpLabel
                OpBranch %82
-         %86 = OpLabel
-         %88 = OpAccessChain %_ptr_Function_mat4v4float %75 %83
-         %89 = OpLoad %mat4v4float %88 None
-         %90 = OpAccessChain %_ptr_Function_mat4v4float %76 %83
-               OpStore %90 %89 None
+         %87 = OpLabel
+         %89 = OpAccessChain %_ptr_Function_mat4v4float %75 %83
+         %90 = OpLoad %mat4v4float %89 None
+         %91 = OpAccessChain %_ptr_Function_mat4v4float %76 %83
+               OpStore %91 %90 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
-         %91 = OpLoad %_arr_mat4v4float_uint_4 %76 None
-               OpReturnValue %91
+         %85 = OpLoad %_arr_mat4v4float_uint_4 %76 None
+               OpReturnValue %85
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
index 234f243..c4e28e9 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -41,19 +41,19 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %18 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_mat4v4float = OpTypePointer Workgroup %mat4v4float
-         %33 = OpConstantNull %mat4v4float
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_mat4v4float_uint_4 = OpTypePointer Uniform %_arr_mat4v4float_uint_4
      %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_mat4v4float = OpTypePointer Workgroup %mat4v4float
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
 %_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+       %bool = OpTypeBool
+         %60 = OpConstantNull %mat4v4float
          %62 = OpTypeFunction %void
          %67 = OpTypeFunction %_arr_mat4v4float_uint_4_0 %_arr_mat4v4float_uint_4
 %_ptr_Function__arr_mat4v4float_uint_4 = OpTypePointer Function %_arr_mat4v4float_uint_4
@@ -71,39 +71,39 @@
                OpLoopMerge %24 %22 None
                OpBranch %21
          %21 = OpLabel
-         %27 = OpUGreaterThanEqual %bool %25 %uint_4
-               OpSelectionMerge %29 None
-               OpBranchConditional %27 %30 %29
-         %30 = OpLabel
+         %55 = OpUGreaterThanEqual %bool %25 %uint_4
+               OpSelectionMerge %57 None
+               OpBranchConditional %55 %58 %57
+         %58 = OpLabel
                OpBranch %24
-         %29 = OpLabel
-         %31 = OpAccessChain %_ptr_Workgroup_mat4v4float %w %25
-               OpStore %31 %33 None
+         %57 = OpLabel
+         %59 = OpAccessChain %_ptr_Workgroup_mat4v4float %w %25
+               OpStore %59 %60 None
                OpBranch %22
          %22 = OpLabel
          %26 = OpIAdd %uint %25 %uint_1
                OpBranch %23
          %24 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %38 = OpAccessChain %_ptr_Uniform__arr_mat4v4float_uint_4 %1 %uint_0
-         %41 = OpLoad %_arr_mat4v4float_uint_4 %38 None
-         %42 = OpFunctionCall %_arr_mat4v4float_uint_4_0 %tint_convert_explicit_layout %41
-               OpStore %w %42 None
-         %44 = OpAccessChain %_ptr_Workgroup_mat4v4float %w %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_mat4v4float %1 %uint_0 %uint_2
-         %47 = OpLoad %mat4v4float %45 None
-               OpStore %44 %47 None
+         %30 = OpAccessChain %_ptr_Uniform__arr_mat4v4float_uint_4 %1 %uint_0
+         %33 = OpLoad %_arr_mat4v4float_uint_4 %30 None
+         %34 = OpFunctionCall %_arr_mat4v4float_uint_4_0 %tint_convert_explicit_layout %33
+               OpStore %w %34 None
+         %36 = OpAccessChain %_ptr_Workgroup_mat4v4float %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_mat4v4float %1 %uint_0 %uint_2
+         %41 = OpLoad %mat4v4float %39 None
+               OpStore %36 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
+         %44 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
+         %46 = OpLoad %v4float %44 None
+         %47 = OpVectorShuffle %v4float %46 %46 1 3 0 2
+               OpStore %42 %47 None
          %48 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
-         %50 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
-         %52 = OpLoad %v4float %50 None
-         %53 = OpVectorShuffle %v4float %52 %52 1 3 0 2
-               OpStore %48 %53 None
-         %54 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_0
-         %55 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_float %55 %uint_0
-         %58 = OpLoad %float %56 None
-         %59 = OpAccessChain %_ptr_Workgroup_float %54 %uint_0
-               OpStore %59 %58 None
+         %49 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1
+         %50 = OpAccessChain %_ptr_Uniform_float %49 %uint_0
+         %52 = OpLoad %float %50 None
+         %53 = OpAccessChain %_ptr_Workgroup_float %48 %uint_0
+               OpStore %53 %52 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %62
@@ -126,21 +126,21 @@
                OpLoopMerge %78 %76 None
                OpBranch %75
          %75 = OpLabel
-         %81 = OpUGreaterThanEqual %bool %79 %uint_4
-               OpSelectionMerge %82 None
-               OpBranchConditional %81 %83 %82
-         %83 = OpLabel
+         %82 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %83 None
+               OpBranchConditional %82 %84 %83
+         %84 = OpLabel
                OpBranch %78
-         %82 = OpLabel
-         %84 = OpAccessChain %_ptr_Function_mat4v4float %69 %79
-         %86 = OpLoad %mat4v4float %84 None
-         %87 = OpAccessChain %_ptr_Function_mat4v4float %71 %79
-               OpStore %87 %86 None
+         %83 = OpLabel
+         %85 = OpAccessChain %_ptr_Function_mat4v4float %69 %79
+         %87 = OpLoad %mat4v4float %85 None
+         %88 = OpAccessChain %_ptr_Function_mat4v4float %71 %79
+               OpStore %88 %87 None
                OpBranch %76
          %76 = OpLabel
          %80 = OpIAdd %uint %79 %uint_1
                OpBranch %77
          %78 = OpLabel
-         %88 = OpLoad %_arr_mat4v4float_uint_4_0 %71 None
-               OpReturnValue %88
+         %81 = OpLoad %_arr_mat4v4float_uint_4_0 %71 None
+               OpReturnValue %81
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 1873679..30d14d1 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -94,12 +94,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %74 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %95 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %105 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %131 = OpTypeFunction %Inner %Inner_std140
@@ -125,8 +125,8 @@
          %52 = OpVariable %_ptr_Function_mat2v2half Function
          %66 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %68 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %74
-        %101 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %103 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+         %91 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %93 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -159,60 +159,60 @@
                OpLoopMerge %79 %77 None
                OpBranch %76
          %76 = OpLabel
-         %82 = OpUGreaterThanEqual %bool %80 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %82 %85 %84
-         %85 = OpLabel
+        %111 = OpUGreaterThanEqual %bool %80 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %111 %114 %113
+        %114 = OpLabel
                OpBranch %79
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_Outer %68 %80
-         %88 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
-         %90 = OpLoad %Outer_std140 %88 None
-         %91 = OpFunctionCall %Outer %tint_convert_Outer %90
-               OpStore %86 %91 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_Outer %68 %80
+        %117 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
+        %119 = OpLoad %Outer_std140 %117 None
+        %120 = OpFunctionCall %Outer %tint_convert_Outer %119
+               OpStore %115 %120 None
                OpBranch %77
          %77 = OpLabel
          %81 = OpIAdd %uint %80 %uint_1
                OpBranch %78
          %79 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %68 None
-         %94 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %95 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %94
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %95
-         %98 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-         %99 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %98
-               OpStore %101 %99
-               OpBranch %106
-        %106 = OpLabel
-               OpBranch %109
-        %109 = OpLabel
-        %111 = OpPhi %uint %uint_0 %106 %112 %108
-               OpLoopMerge %110 %108 None
-               OpBranch %107
-        %107 = OpLabel
-        %113 = OpUGreaterThanEqual %bool %111 %uint_4
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %114
-        %115 = OpLabel
-               OpBranch %110
-        %114 = OpLabel
-        %116 = OpAccessChain %_ptr_Function_Inner %103 %111
-        %118 = OpAccessChain %_ptr_Function_Inner_std140 %101 %111
-        %120 = OpLoad %Inner_std140 %118 None
-        %121 = OpFunctionCall %Inner %tint_convert_Inner %120
-               OpStore %116 %121 None
-               OpBranch %108
-        %108 = OpLabel
-        %112 = OpIAdd %uint %111 %uint_1
-               OpBranch %109
-        %110 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %103 None
-        %124 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %124
-        %126 = OpFunctionCall %int %i
-        %127 = OpBitcast %uint %126
-        %128 = OpExtInst %uint %33 UMin %127 %uint_1
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %128
+         %83 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %84 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %83
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %84
+         %88 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %89 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %88
+               OpStore %91 %89
+               OpBranch %96
+         %96 = OpLabel
+               OpBranch %99
+         %99 = OpLabel
+        %101 = OpPhi %uint %uint_0 %96 %102 %98
+               OpLoopMerge %100 %98 None
+               OpBranch %97
+         %97 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %101 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
+               OpBranch %100
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_Inner %93 %101
+        %126 = OpAccessChain %_ptr_Function_Inner_std140 %91 %101
+        %128 = OpLoad %Inner_std140 %126 None
+        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
+               OpStore %124 %129 None
+               OpBranch %98
+         %98 = OpLabel
+        %102 = OpIAdd %uint %101 %uint_1
+               OpBranch %99
+        %100 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %93 None
+        %104 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %104
+        %107 = OpFunctionCall %int %i
+        %108 = OpBitcast %uint %107
+        %109 = OpExtInst %uint %33 UMin %108 %uint_1
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %109
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %131
@@ -228,7 +228,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %139 = OpLabel
         %141 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %142 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+        %142 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
         %140 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %141 %140
                OpBranch %143
@@ -239,25 +239,25 @@
                OpLoopMerge %147 %145 None
                OpBranch %144
         %144 = OpLabel
-        %150 = OpUGreaterThanEqual %bool %148 %uint_4
-               OpSelectionMerge %151 None
-               OpBranchConditional %150 %152 %151
-        %152 = OpLabel
+        %152 = OpUGreaterThanEqual %bool %148 %uint_4
+               OpSelectionMerge %153 None
+               OpBranchConditional %152 %154 %153
+        %154 = OpLabel
                OpBranch %147
-        %151 = OpLabel
-        %153 = OpAccessChain %_ptr_Function_Inner %142 %148
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %141 %148
-        %155 = OpLoad %Inner_std140 %154 None
-        %156 = OpFunctionCall %Inner %tint_convert_Inner %155
-               OpStore %153 %156 None
+        %153 = OpLabel
+        %155 = OpAccessChain %_ptr_Function_Inner %142 %148
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %148
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpFunctionCall %Inner %tint_convert_Inner %157
+               OpStore %155 %158 None
                OpBranch %145
         %145 = OpLabel
         %149 = OpIAdd %uint %148 %uint_1
                OpBranch %146
         %147 = OpLabel
-        %157 = OpLoad %_arr_Inner_uint_4 %142 None
-        %158 = OpCompositeConstruct %Outer %157
-               OpReturnValue %158
+        %150 = OpLoad %_arr_Inner_uint_4 %142 None
+        %151 = OpCompositeConstruct %Outer %150
+               OpReturnValue %151
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %160
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -273,23 +273,23 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Inner_std140 %162 %171
-        %177 = OpLoad %Inner_std140 %176 None
-        %178 = OpAccessChain %_ptr_Function_Inner_std140 %164 %171
-               OpStore %178 %177 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Inner_std140 %162 %171
+        %178 = OpLoad %Inner_std140 %177 None
+        %179 = OpAccessChain %_ptr_Function_Inner_std140 %164 %171
+               OpStore %179 %178 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %179 = OpLoad %_arr_Inner_std140_uint_4_0 %164 None
-               OpReturnValue %179
+        %173 = OpLoad %_arr_Inner_std140_uint_4_0 %164 None
+               OpReturnValue %173
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %181
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -313,22 +313,22 @@
                OpLoopMerge %197 %195 None
                OpBranch %194
         %194 = OpLabel
-        %200 = OpUGreaterThanEqual %bool %198 %uint_4
-               OpSelectionMerge %201 None
-               OpBranchConditional %200 %202 %201
-        %202 = OpLabel
+        %201 = OpUGreaterThanEqual %bool %198 %uint_4
+               OpSelectionMerge %202 None
+               OpBranchConditional %201 %203 %202
+        %203 = OpLabel
                OpBranch %197
-        %201 = OpLabel
-        %203 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %189 %198
-        %205 = OpLoad %Outer_std140_tint_explicit_layout %203 None
-        %206 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %205
-        %207 = OpAccessChain %_ptr_Function_Outer_std140 %191 %198
-               OpStore %207 %206 None
+        %202 = OpLabel
+        %204 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %189 %198
+        %206 = OpLoad %Outer_std140_tint_explicit_layout %204 None
+        %207 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %206
+        %208 = OpAccessChain %_ptr_Function_Outer_std140 %191 %198
+               OpStore %208 %207 None
                OpBranch %195
         %195 = OpLabel
         %199 = OpIAdd %uint %198 %uint_1
                OpBranch %196
         %197 = OpLabel
-        %208 = OpLoad %_arr_Outer_std140_uint_4 %191 None
-               OpReturnValue %208
+        %200 = OpLoad %_arr_Outer_std140_uint_4 %191 None
+               OpReturnValue %200
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.spvasm
index fa57c8b..3ce4dd7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -84,12 +84,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %50 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %71 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %81 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %104 = OpTypeFunction %Inner %Inner_std140
@@ -106,8 +106,8 @@
          %15 = OpLabel
          %42 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %44 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %50
-         %77 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %79 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+         %67 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %69 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -129,56 +129,56 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_Outer %44 %56
-         %64 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
-         %66 = OpLoad %Outer_std140 %64 None
-         %67 = OpFunctionCall %Outer %tint_convert_Outer %66
-               OpStore %62 %67 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_Outer %44 %56
+         %90 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
+         %92 = OpLoad %Outer_std140 %90 None
+         %93 = OpFunctionCall %Outer %tint_convert_Outer %92
+               OpStore %88 %93 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %44 None
-         %70 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %71 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %70
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %71
-         %74 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %75 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %74
-               OpStore %77 %75
-               OpBranch %82
-         %82 = OpLabel
-               OpBranch %85
-         %85 = OpLabel
-         %87 = OpPhi %uint %uint_0 %82 %88 %84
-               OpLoopMerge %86 %84 None
-               OpBranch %83
-         %83 = OpLabel
-         %89 = OpUGreaterThanEqual %bool %87 %uint_4
-               OpSelectionMerge %90 None
-               OpBranchConditional %89 %91 %90
-         %91 = OpLabel
-               OpBranch %86
-         %90 = OpLabel
-         %92 = OpAccessChain %_ptr_Function_Inner %79 %87
-         %94 = OpAccessChain %_ptr_Function_Inner_std140 %77 %87
-         %96 = OpLoad %Inner_std140 %94 None
-         %97 = OpFunctionCall %Inner %tint_convert_Inner %96
-               OpStore %92 %97 None
-               OpBranch %84
-         %84 = OpLabel
-         %88 = OpIAdd %uint %87 %uint_1
-               OpBranch %85
-         %86 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %79 None
-        %100 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %100
+         %59 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %60 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %59
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %60
+         %64 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %65 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %64
+               OpStore %67 %65
+               OpBranch %72
+         %72 = OpLabel
+               OpBranch %75
+         %75 = OpLabel
+         %77 = OpPhi %uint %uint_0 %72 %78 %74
+               OpLoopMerge %76 %74 None
+               OpBranch %73
+         %73 = OpLabel
+         %94 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %95 None
+               OpBranchConditional %94 %96 %95
+         %96 = OpLabel
+               OpBranch %76
+         %95 = OpLabel
+         %97 = OpAccessChain %_ptr_Function_Inner %69 %77
+         %99 = OpAccessChain %_ptr_Function_Inner_std140 %67 %77
+        %101 = OpLoad %Inner_std140 %99 None
+        %102 = OpFunctionCall %Inner %tint_convert_Inner %101
+               OpStore %97 %102 None
+               OpBranch %74
+         %74 = OpLabel
+         %78 = OpIAdd %uint %77 %uint_1
+               OpBranch %75
+         %76 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %69 None
+         %80 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %80
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -195,7 +195,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %112 = OpLabel
         %114 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
         %113 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %114 %113
                OpBranch %116
@@ -206,25 +206,25 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_Inner %115 %121
-        %127 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
-        %128 = OpLoad %Inner_std140 %127 None
-        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
-               OpStore %126 %129 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_Inner %115 %121
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
+        %130 = OpLoad %Inner_std140 %129 None
+        %131 = OpFunctionCall %Inner %tint_convert_Inner %130
+               OpStore %128 %131 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %130 = OpLoad %_arr_Inner_uint_4 %115 None
-        %131 = OpCompositeConstruct %Outer %130
-               OpReturnValue %131
+        %123 = OpLoad %_arr_Inner_uint_4 %115 None
+        %124 = OpCompositeConstruct %Outer %123
+               OpReturnValue %124
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %133
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -240,23 +240,23 @@
                OpLoopMerge %143 %141 None
                OpBranch %140
         %140 = OpLabel
-        %146 = OpUGreaterThanEqual %bool %144 %uint_4
-               OpSelectionMerge %147 None
-               OpBranchConditional %146 %148 %147
-        %148 = OpLabel
+        %147 = OpUGreaterThanEqual %bool %144 %uint_4
+               OpSelectionMerge %148 None
+               OpBranchConditional %147 %149 %148
+        %149 = OpLabel
                OpBranch %143
-        %147 = OpLabel
-        %149 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
-        %150 = OpLoad %Inner_std140 %149 None
-        %151 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
-               OpStore %151 %150 None
+        %148 = OpLabel
+        %150 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
+        %151 = OpLoad %Inner_std140 %150 None
+        %152 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
+               OpStore %152 %151 None
                OpBranch %141
         %141 = OpLabel
         %145 = OpIAdd %uint %144 %uint_1
                OpBranch %142
         %143 = OpLabel
-        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
-               OpReturnValue %152
+        %146 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
+               OpReturnValue %146
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %154
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -280,22 +280,22 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
-        %178 = OpLoad %Outer_std140_tint_explicit_layout %176 None
-        %179 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %178
-        %180 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
-               OpStore %180 %179 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
+        %179 = OpLoad %Outer_std140_tint_explicit_layout %177 None
+        %180 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %179
+        %181 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
+               OpStore %181 %180 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %181 = OpLoad %_arr_Outer_std140_uint_4 %164 None
-               OpReturnValue %181
+        %173 = OpLoad %_arr_Outer_std140_uint_4 %164 None
+               OpReturnValue %173
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.spvasm
index 17c2c88..26e1c12 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.spvasm
@@ -72,13 +72,13 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
+     %uint_1 = OpConstant %uint 1
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %94 = OpTypeFunction %S %S_std140
         %103 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -124,43 +124,43 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %86 %85
+         %86 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_S %47 %55
+         %89 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %91 = OpLoad %S_std140 %89 None
+         %92 = OpFunctionCall %S %tint_convert_S %91
+               OpStore %87 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v2half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v2half %80 None
-         %82 = OpCompositeConstruct %mat2v2half %79 %81
-         %83 = OpFunctionCall %void %c %82
-         %84 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %85 = OpLoad %v2half %84 None
-         %86 = OpVectorShuffle %v2half %85 %85 1 0
-         %87 = OpFunctionCall %void %d %86
-         %88 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %89 = OpLoad %v2half %88 None
-         %90 = OpVectorShuffle %v2half %89 %89 1 0
-         %91 = OpCompositeExtract %half %90 0
-         %92 = OpFunctionCall %void %e %91
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v2half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v2half %70 None
+         %72 = OpCompositeConstruct %mat2v2half %69 %71
+         %73 = OpFunctionCall %void %c %72
+         %74 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v2half %74 None
+         %76 = OpVectorShuffle %v2half %75 %75 1 0
+         %77 = OpFunctionCall %void %d %76
+         %78 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %79 = OpLoad %v2half %78 None
+         %80 = OpVectorShuffle %v2half %79 %79 1 0
+         %81 = OpCompositeExtract %half %80 0
+         %82 = OpFunctionCall %void %e %81
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %94
@@ -188,21 +188,21 @@
                OpLoopMerge %113 %111 None
                OpBranch %110
         %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
+        %117 = OpUGreaterThanEqual %bool %114 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %117 %119 %118
+        %119 = OpLabel
                OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_S_std140 %105 %114
-        %120 = OpLoad %S_std140 %119 None
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %114
-               OpStore %121 %120 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_S_std140 %105 %114
+        %121 = OpLoad %S_std140 %120 None
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %114
+               OpStore %122 %121 None
                OpBranch %111
         %111 = OpLabel
         %115 = OpIAdd %uint %114 %uint_1
                OpBranch %112
         %113 = OpLabel
-        %122 = OpLoad %_arr_S_std140_uint_4_0 %107 None
-               OpReturnValue %122
+        %116 = OpLoad %_arr_S_std140_uint_4_0 %107 None
+               OpReturnValue %116
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.spvasm
index 16eb963..17d5f75 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.spvasm
@@ -60,17 +60,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat2v2half = OpTypePointer Private %mat2v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_Private_v2half = OpTypePointer Private %v2half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %74 = OpTypeFunction %S %S_std140
          %83 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -91,41 +91,41 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %63 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %65 None
+               OpBranchConditional %63 %66 %65
+         %66 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %65 = OpLabel
+         %67 = OpAccessChain %_ptr_Function_S %30 %37
+         %69 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %71 = OpLoad %S_std140 %69 None
+         %72 = OpFunctionCall %S %tint_convert_S %71
+               OpStore %67 %72 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat2v2half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v2half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v2half %65 None
-         %67 = OpCompositeConstruct %mat2v2half %64 %66
-               OpStore %59 %67 None
-         %68 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %71 = OpLoad %v2half %70 None
-         %72 = OpVectorShuffle %v2half %71 %71 1 0
-               OpStore %68 %72 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat2v2half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v2half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v2half %55 None
+         %57 = OpCompositeConstruct %mat2v2half %54 %56
+               OpStore %49 %57 None
+         %58 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %61 = OpLoad %v2half %60 None
+         %62 = OpVectorShuffle %v2half %61 %61 1 0
+               OpStore %58 %62 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %74
@@ -153,21 +153,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S_std140 %85 %94
-        %100 = OpLoad %S_std140 %99 None
-        %101 = OpAccessChain %_ptr_Function_S_std140 %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S_std140 %85 %94
+        %101 = OpLoad %S_std140 %100 None
+        %102 = OpAccessChain %_ptr_Function_S_std140 %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_std140_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_std140_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.spvasm
index 9004867..1f8ac9f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.spvasm
@@ -84,17 +84,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat2v2half = OpTypePointer StorageBuffer %mat2v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %81 = OpTypeFunction %void %_arr_S_uint_4
         %100 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -118,41 +118,41 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %70 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %73 %72
+         %73 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %72 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_S %30 %40
+         %76 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %78 = OpLoad %S_std140 %76 None
+         %79 = OpFunctionCall %S %tint_convert_S %78
+               OpStore %74 %79 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat2v2half %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v2half %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v2half %72 None
-         %74 = OpCompositeConstruct %mat2v2half %71 %73
-               OpStore %66 %74 None
-         %75 = OpAccessChain %_ptr_StorageBuffer_v2half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %77 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %78 = OpLoad %v2half %77 None
-         %79 = OpVectorShuffle %v2half %78 %78 1 0
-               OpStore %75 %79 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat2v2half %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v2half %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v2half %62 None
+         %64 = OpCompositeConstruct %mat2v2half %61 %63
+               OpStore %56 %64 None
+         %65 = OpAccessChain %_ptr_StorageBuffer_v2half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %68 = OpLoad %v2half %67 None
+         %69 = OpVectorShuffle %v2half %68 %68 1 0
+               OpStore %65 %69 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %81
@@ -226,21 +226,21 @@
                OpLoopMerge %130 %128 None
                OpBranch %127
         %127 = OpLabel
-        %133 = OpUGreaterThanEqual %bool %131 %uint_4
-               OpSelectionMerge %134 None
-               OpBranchConditional %133 %135 %134
-        %135 = OpLabel
+        %134 = OpUGreaterThanEqual %bool %131 %uint_4
+               OpSelectionMerge %135 None
+               OpBranchConditional %134 %136 %135
+        %136 = OpLabel
                OpBranch %130
-        %134 = OpLabel
-        %136 = OpAccessChain %_ptr_Function_S_std140 %122 %131
-        %137 = OpLoad %S_std140 %136 None
-        %138 = OpAccessChain %_ptr_Function_S_std140 %124 %131
-               OpStore %138 %137 None
+        %135 = OpLabel
+        %137 = OpAccessChain %_ptr_Function_S_std140 %122 %131
+        %138 = OpLoad %S_std140 %137 None
+        %139 = OpAccessChain %_ptr_Function_S_std140 %124 %131
+               OpStore %139 %138 None
                OpBranch %128
         %128 = OpLabel
         %132 = OpIAdd %uint %131 %uint_1
                OpBranch %129
         %130 = OpLabel
-        %139 = OpLoad %_arr_S_std140_uint_4_0 %124 None
-               OpReturnValue %139
+        %133 = OpLoad %_arr_S_std140_uint_4_0 %124 None
+               OpReturnValue %133
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.spvasm
index c6dd24c..76ccef9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.spvasm
@@ -60,10 +60,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -71,14 +67,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat2v2half = OpTypePointer Workgroup %mat2v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half
+       %bool = OpTypeBool
+         %80 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %91 = OpTypeFunction %void
          %96 = OpTypeFunction %S %S_std140
         %105 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -87,8 +87,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -97,67 +97,67 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %75 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %78 %77
+         %78 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %77 = OpLabel
+         %79 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %79 %80 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat2v2half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v2half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v2half %82 None
-         %84 = OpCompositeConstruct %mat2v2half %81 %83
-               OpStore %76 %84 None
-         %85 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_1 %uint_0
-         %87 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v2half %87 None
-         %89 = OpVectorShuffle %v2half %88 %88 1 0
-               OpStore %85 %89 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %81 %83 %82
+         %83 = OpLabel
+               OpBranch %49
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %42 %50
+         %86 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %88 = OpLoad %S_std140 %86 None
+         %89 = OpFunctionCall %S %tint_convert_S %88
+               OpStore %84 %89 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat2v2half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v2half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v2half %67 None
+         %69 = OpCompositeConstruct %mat2v2half %66 %68
+               OpStore %61 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_1 %uint_0
+         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %73 = OpLoad %v2half %72 None
+         %74 = OpVectorShuffle %v2half %73 %73 1 0
+               OpStore %70 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %91
@@ -191,21 +191,21 @@
                OpLoopMerge %115 %113 None
                OpBranch %112
         %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
+        %119 = OpUGreaterThanEqual %bool %116 %uint_4
+               OpSelectionMerge %120 None
+               OpBranchConditional %119 %121 %120
+        %121 = OpLabel
                OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %116
-        %122 = OpLoad %S_std140 %121 None
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %116
-               OpStore %123 %122 None
+        %120 = OpLabel
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %116
+        %123 = OpLoad %S_std140 %122 None
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %116
+               OpStore %124 %123 None
                OpBranch %113
         %113 = OpLabel
         %117 = OpIAdd %uint %116 %uint_1
                OpBranch %114
         %115 = OpLabel
-        %124 = OpLoad %_arr_S_std140_uint_4_0 %109 None
-               OpReturnValue %124
+        %118 = OpLoad %_arr_S_std140_uint_4_0 %109 None
+               OpReturnValue %118
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 42a4ba6..0306c28 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -91,12 +91,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %74 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %95 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %105 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %131 = OpTypeFunction %Inner %Inner_std140
@@ -122,8 +122,8 @@
          %52 = OpVariable %_ptr_Function_mat2v2float Function
          %66 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %68 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %74
-        %101 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %103 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+         %91 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %93 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -156,60 +156,60 @@
                OpLoopMerge %79 %77 None
                OpBranch %76
          %76 = OpLabel
-         %82 = OpUGreaterThanEqual %bool %80 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %82 %85 %84
-         %85 = OpLabel
+        %111 = OpUGreaterThanEqual %bool %80 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %111 %114 %113
+        %114 = OpLabel
                OpBranch %79
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_Outer %68 %80
-         %88 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
-         %90 = OpLoad %Outer_std140 %88 None
-         %91 = OpFunctionCall %Outer %tint_convert_Outer %90
-               OpStore %86 %91 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_Outer %68 %80
+        %117 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
+        %119 = OpLoad %Outer_std140 %117 None
+        %120 = OpFunctionCall %Outer %tint_convert_Outer %119
+               OpStore %115 %120 None
                OpBranch %77
          %77 = OpLabel
          %81 = OpIAdd %uint %80 %uint_1
                OpBranch %78
          %79 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %68 None
-         %94 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %95 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %94
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %95
-         %98 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-         %99 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %98
-               OpStore %101 %99
-               OpBranch %106
-        %106 = OpLabel
-               OpBranch %109
-        %109 = OpLabel
-        %111 = OpPhi %uint %uint_0 %106 %112 %108
-               OpLoopMerge %110 %108 None
-               OpBranch %107
-        %107 = OpLabel
-        %113 = OpUGreaterThanEqual %bool %111 %uint_4
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %114
-        %115 = OpLabel
-               OpBranch %110
-        %114 = OpLabel
-        %116 = OpAccessChain %_ptr_Function_Inner %103 %111
-        %118 = OpAccessChain %_ptr_Function_Inner_std140 %101 %111
-        %120 = OpLoad %Inner_std140 %118 None
-        %121 = OpFunctionCall %Inner %tint_convert_Inner %120
-               OpStore %116 %121 None
-               OpBranch %108
-        %108 = OpLabel
-        %112 = OpIAdd %uint %111 %uint_1
-               OpBranch %109
-        %110 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %103 None
-        %124 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %124
-        %126 = OpFunctionCall %int %i
-        %127 = OpBitcast %uint %126
-        %128 = OpExtInst %uint %33 UMin %127 %uint_1
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %128
+         %83 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %84 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %83
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %84
+         %88 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %89 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %88
+               OpStore %91 %89
+               OpBranch %96
+         %96 = OpLabel
+               OpBranch %99
+         %99 = OpLabel
+        %101 = OpPhi %uint %uint_0 %96 %102 %98
+               OpLoopMerge %100 %98 None
+               OpBranch %97
+         %97 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %101 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
+               OpBranch %100
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_Inner %93 %101
+        %126 = OpAccessChain %_ptr_Function_Inner_std140 %91 %101
+        %128 = OpLoad %Inner_std140 %126 None
+        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
+               OpStore %124 %129 None
+               OpBranch %98
+         %98 = OpLabel
+        %102 = OpIAdd %uint %101 %uint_1
+               OpBranch %99
+        %100 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %93 None
+        %104 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %104
+        %107 = OpFunctionCall %int %i
+        %108 = OpBitcast %uint %107
+        %109 = OpExtInst %uint %33 UMin %108 %uint_1
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %109
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %131
@@ -225,7 +225,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %139 = OpLabel
         %141 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %142 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+        %142 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
         %140 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %141 %140
                OpBranch %143
@@ -236,25 +236,25 @@
                OpLoopMerge %147 %145 None
                OpBranch %144
         %144 = OpLabel
-        %150 = OpUGreaterThanEqual %bool %148 %uint_4
-               OpSelectionMerge %151 None
-               OpBranchConditional %150 %152 %151
-        %152 = OpLabel
+        %152 = OpUGreaterThanEqual %bool %148 %uint_4
+               OpSelectionMerge %153 None
+               OpBranchConditional %152 %154 %153
+        %154 = OpLabel
                OpBranch %147
-        %151 = OpLabel
-        %153 = OpAccessChain %_ptr_Function_Inner %142 %148
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %141 %148
-        %155 = OpLoad %Inner_std140 %154 None
-        %156 = OpFunctionCall %Inner %tint_convert_Inner %155
-               OpStore %153 %156 None
+        %153 = OpLabel
+        %155 = OpAccessChain %_ptr_Function_Inner %142 %148
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %148
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpFunctionCall %Inner %tint_convert_Inner %157
+               OpStore %155 %158 None
                OpBranch %145
         %145 = OpLabel
         %149 = OpIAdd %uint %148 %uint_1
                OpBranch %146
         %147 = OpLabel
-        %157 = OpLoad %_arr_Inner_uint_4 %142 None
-        %158 = OpCompositeConstruct %Outer %157
-               OpReturnValue %158
+        %150 = OpLoad %_arr_Inner_uint_4 %142 None
+        %151 = OpCompositeConstruct %Outer %150
+               OpReturnValue %151
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %160
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -270,23 +270,23 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Inner_std140 %162 %171
-        %177 = OpLoad %Inner_std140 %176 None
-        %178 = OpAccessChain %_ptr_Function_Inner_std140 %164 %171
-               OpStore %178 %177 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Inner_std140 %162 %171
+        %178 = OpLoad %Inner_std140 %177 None
+        %179 = OpAccessChain %_ptr_Function_Inner_std140 %164 %171
+               OpStore %179 %178 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %179 = OpLoad %_arr_Inner_std140_uint_4_0 %164 None
-               OpReturnValue %179
+        %173 = OpLoad %_arr_Inner_std140_uint_4_0 %164 None
+               OpReturnValue %173
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %181
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -310,22 +310,22 @@
                OpLoopMerge %197 %195 None
                OpBranch %194
         %194 = OpLabel
-        %200 = OpUGreaterThanEqual %bool %198 %uint_4
-               OpSelectionMerge %201 None
-               OpBranchConditional %200 %202 %201
-        %202 = OpLabel
+        %201 = OpUGreaterThanEqual %bool %198 %uint_4
+               OpSelectionMerge %202 None
+               OpBranchConditional %201 %203 %202
+        %203 = OpLabel
                OpBranch %197
-        %201 = OpLabel
-        %203 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %189 %198
-        %205 = OpLoad %Outer_std140_tint_explicit_layout %203 None
-        %206 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %205
-        %207 = OpAccessChain %_ptr_Function_Outer_std140 %191 %198
-               OpStore %207 %206 None
+        %202 = OpLabel
+        %204 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %189 %198
+        %206 = OpLoad %Outer_std140_tint_explicit_layout %204 None
+        %207 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %206
+        %208 = OpAccessChain %_ptr_Function_Outer_std140 %191 %198
+               OpStore %208 %207 None
                OpBranch %195
         %195 = OpLabel
         %199 = OpIAdd %uint %198 %uint_1
                OpBranch %196
         %197 = OpLabel
-        %208 = OpLoad %_arr_Outer_std140_uint_4 %191 None
-               OpReturnValue %208
+        %200 = OpLoad %_arr_Outer_std140_uint_4 %191 None
+               OpReturnValue %200
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm
index 228806e..4f16903 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -81,12 +81,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %50 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %71 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %81 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %104 = OpTypeFunction %Inner %Inner_std140
@@ -103,8 +103,8 @@
          %15 = OpLabel
          %42 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %44 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %50
-         %77 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %79 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+         %67 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %69 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -126,56 +126,56 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_Outer %44 %56
-         %64 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
-         %66 = OpLoad %Outer_std140 %64 None
-         %67 = OpFunctionCall %Outer %tint_convert_Outer %66
-               OpStore %62 %67 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_Outer %44 %56
+         %90 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
+         %92 = OpLoad %Outer_std140 %90 None
+         %93 = OpFunctionCall %Outer %tint_convert_Outer %92
+               OpStore %88 %93 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %44 None
-         %70 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %71 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %70
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %71
-         %74 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %75 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %74
-               OpStore %77 %75
-               OpBranch %82
-         %82 = OpLabel
-               OpBranch %85
-         %85 = OpLabel
-         %87 = OpPhi %uint %uint_0 %82 %88 %84
-               OpLoopMerge %86 %84 None
-               OpBranch %83
-         %83 = OpLabel
-         %89 = OpUGreaterThanEqual %bool %87 %uint_4
-               OpSelectionMerge %90 None
-               OpBranchConditional %89 %91 %90
-         %91 = OpLabel
-               OpBranch %86
-         %90 = OpLabel
-         %92 = OpAccessChain %_ptr_Function_Inner %79 %87
-         %94 = OpAccessChain %_ptr_Function_Inner_std140 %77 %87
-         %96 = OpLoad %Inner_std140 %94 None
-         %97 = OpFunctionCall %Inner %tint_convert_Inner %96
-               OpStore %92 %97 None
-               OpBranch %84
-         %84 = OpLabel
-         %88 = OpIAdd %uint %87 %uint_1
-               OpBranch %85
-         %86 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %79 None
-        %100 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %100
+         %59 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %60 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %59
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %60
+         %64 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %65 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %64
+               OpStore %67 %65
+               OpBranch %72
+         %72 = OpLabel
+               OpBranch %75
+         %75 = OpLabel
+         %77 = OpPhi %uint %uint_0 %72 %78 %74
+               OpLoopMerge %76 %74 None
+               OpBranch %73
+         %73 = OpLabel
+         %94 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %95 None
+               OpBranchConditional %94 %96 %95
+         %96 = OpLabel
+               OpBranch %76
+         %95 = OpLabel
+         %97 = OpAccessChain %_ptr_Function_Inner %69 %77
+         %99 = OpAccessChain %_ptr_Function_Inner_std140 %67 %77
+        %101 = OpLoad %Inner_std140 %99 None
+        %102 = OpFunctionCall %Inner %tint_convert_Inner %101
+               OpStore %97 %102 None
+               OpBranch %74
+         %74 = OpLabel
+         %78 = OpIAdd %uint %77 %uint_1
+               OpBranch %75
+         %76 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %69 None
+         %80 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %80
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %float %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -192,7 +192,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %112 = OpLabel
         %114 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
         %113 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %114 %113
                OpBranch %116
@@ -203,25 +203,25 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_Inner %115 %121
-        %127 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
-        %128 = OpLoad %Inner_std140 %127 None
-        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
-               OpStore %126 %129 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_Inner %115 %121
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
+        %130 = OpLoad %Inner_std140 %129 None
+        %131 = OpFunctionCall %Inner %tint_convert_Inner %130
+               OpStore %128 %131 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %130 = OpLoad %_arr_Inner_uint_4 %115 None
-        %131 = OpCompositeConstruct %Outer %130
-               OpReturnValue %131
+        %123 = OpLoad %_arr_Inner_uint_4 %115 None
+        %124 = OpCompositeConstruct %Outer %123
+               OpReturnValue %124
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %133
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -237,23 +237,23 @@
                OpLoopMerge %143 %141 None
                OpBranch %140
         %140 = OpLabel
-        %146 = OpUGreaterThanEqual %bool %144 %uint_4
-               OpSelectionMerge %147 None
-               OpBranchConditional %146 %148 %147
-        %148 = OpLabel
+        %147 = OpUGreaterThanEqual %bool %144 %uint_4
+               OpSelectionMerge %148 None
+               OpBranchConditional %147 %149 %148
+        %149 = OpLabel
                OpBranch %143
-        %147 = OpLabel
-        %149 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
-        %150 = OpLoad %Inner_std140 %149 None
-        %151 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
-               OpStore %151 %150 None
+        %148 = OpLabel
+        %150 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
+        %151 = OpLoad %Inner_std140 %150 None
+        %152 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
+               OpStore %152 %151 None
                OpBranch %141
         %141 = OpLabel
         %145 = OpIAdd %uint %144 %uint_1
                OpBranch %142
         %143 = OpLabel
-        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
-               OpReturnValue %152
+        %146 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
+               OpReturnValue %146
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %154
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -277,22 +277,22 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
-        %178 = OpLoad %Outer_std140_tint_explicit_layout %176 None
-        %179 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %178
-        %180 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
-               OpStore %180 %179 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
+        %179 = OpLoad %Outer_std140_tint_explicit_layout %177 None
+        %180 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %179
+        %181 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
+               OpStore %181 %180 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %181 = OpLoad %_arr_Outer_std140_uint_4 %164 None
-               OpReturnValue %181
+        %173 = OpLoad %_arr_Outer_std140_uint_4 %164 None
+               OpReturnValue %173
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.spvasm
index 677ac94..664481c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.spvasm
@@ -69,13 +69,13 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+     %uint_1 = OpConstant %uint 1
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %94 = OpTypeFunction %S %S_std140
         %103 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -121,43 +121,43 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %86 %85
+         %86 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_S %47 %55
+         %89 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %91 = OpLoad %S_std140 %89 None
+         %92 = OpFunctionCall %S %tint_convert_S %91
+               OpStore %87 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v2float %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v2float %80 None
-         %82 = OpCompositeConstruct %mat2v2float %79 %81
-         %83 = OpFunctionCall %void %c %82
-         %84 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %85 = OpLoad %v2float %84 None
-         %86 = OpVectorShuffle %v2float %85 %85 1 0
-         %87 = OpFunctionCall %void %d %86
-         %88 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %89 = OpLoad %v2float %88 None
-         %90 = OpVectorShuffle %v2float %89 %89 1 0
-         %91 = OpCompositeExtract %float %90 0
-         %92 = OpFunctionCall %void %e %91
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v2float %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v2float %70 None
+         %72 = OpCompositeConstruct %mat2v2float %69 %71
+         %73 = OpFunctionCall %void %c %72
+         %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v2float %74 None
+         %76 = OpVectorShuffle %v2float %75 %75 1 0
+         %77 = OpFunctionCall %void %d %76
+         %78 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %79 = OpLoad %v2float %78 None
+         %80 = OpVectorShuffle %v2float %79 %79 1 0
+         %81 = OpCompositeExtract %float %80 0
+         %82 = OpFunctionCall %void %e %81
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %94
@@ -185,21 +185,21 @@
                OpLoopMerge %113 %111 None
                OpBranch %110
         %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
+        %117 = OpUGreaterThanEqual %bool %114 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %117 %119 %118
+        %119 = OpLabel
                OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_S_std140 %105 %114
-        %120 = OpLoad %S_std140 %119 None
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %114
-               OpStore %121 %120 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_S_std140 %105 %114
+        %121 = OpLoad %S_std140 %120 None
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %114
+               OpStore %122 %121 None
                OpBranch %111
         %111 = OpLabel
         %115 = OpIAdd %uint %114 %uint_1
                OpBranch %112
         %113 = OpLabel
-        %122 = OpLoad %_arr_S_std140_uint_4_0 %107 None
-               OpReturnValue %122
+        %116 = OpLoad %_arr_S_std140_uint_4_0 %107 None
+               OpReturnValue %116
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.spvasm
index 4bf8d64..5591a56 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.spvasm
@@ -57,17 +57,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat2v2float = OpTypePointer Private %mat2v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_Private_v2float = OpTypePointer Private %v2float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %74 = OpTypeFunction %S %S_std140
          %83 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -88,41 +88,41 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %63 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %65 None
+               OpBranchConditional %63 %66 %65
+         %66 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %65 = OpLabel
+         %67 = OpAccessChain %_ptr_Function_S %30 %37
+         %69 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %71 = OpLoad %S_std140 %69 None
+         %72 = OpFunctionCall %S %tint_convert_S %71
+               OpStore %67 %72 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat2v2float %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v2float %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v2float %65 None
-         %67 = OpCompositeConstruct %mat2v2float %64 %66
-               OpStore %59 %67 None
-         %68 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %71 = OpLoad %v2float %70 None
-         %72 = OpVectorShuffle %v2float %71 %71 1 0
-               OpStore %68 %72 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat2v2float %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v2float %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v2float %55 None
+         %57 = OpCompositeConstruct %mat2v2float %54 %56
+               OpStore %49 %57 None
+         %58 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %61 = OpLoad %v2float %60 None
+         %62 = OpVectorShuffle %v2float %61 %61 1 0
+               OpStore %58 %62 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %74
@@ -150,21 +150,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S_std140 %85 %94
-        %100 = OpLoad %S_std140 %99 None
-        %101 = OpAccessChain %_ptr_Function_S_std140 %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S_std140 %85 %94
+        %101 = OpLoad %S_std140 %100 None
+        %102 = OpAccessChain %_ptr_Function_S_std140 %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_std140_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_std140_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.spvasm
index 4f3c0b8..1afb00e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.spvasm
@@ -81,17 +81,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat2v2float = OpTypePointer StorageBuffer %mat2v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %81 = OpTypeFunction %void %_arr_S_uint_4
         %100 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -115,41 +115,41 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %70 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %73 %72
+         %73 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %72 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_S %30 %40
+         %76 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %78 = OpLoad %S_std140 %76 None
+         %79 = OpFunctionCall %S %tint_convert_S %78
+               OpStore %74 %79 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat2v2float %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v2float %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v2float %72 None
-         %74 = OpCompositeConstruct %mat2v2float %71 %73
-               OpStore %66 %74 None
-         %75 = OpAccessChain %_ptr_StorageBuffer_v2float %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %77 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %78 = OpLoad %v2float %77 None
-         %79 = OpVectorShuffle %v2float %78 %78 1 0
-               OpStore %75 %79 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat2v2float %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v2float %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v2float %62 None
+         %64 = OpCompositeConstruct %mat2v2float %61 %63
+               OpStore %56 %64 None
+         %65 = OpAccessChain %_ptr_StorageBuffer_v2float %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %68 = OpLoad %v2float %67 None
+         %69 = OpVectorShuffle %v2float %68 %68 1 0
+               OpStore %65 %69 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %81
@@ -223,21 +223,21 @@
                OpLoopMerge %130 %128 None
                OpBranch %127
         %127 = OpLabel
-        %133 = OpUGreaterThanEqual %bool %131 %uint_4
-               OpSelectionMerge %134 None
-               OpBranchConditional %133 %135 %134
-        %135 = OpLabel
+        %134 = OpUGreaterThanEqual %bool %131 %uint_4
+               OpSelectionMerge %135 None
+               OpBranchConditional %134 %136 %135
+        %136 = OpLabel
                OpBranch %130
-        %134 = OpLabel
-        %136 = OpAccessChain %_ptr_Function_S_std140 %122 %131
-        %137 = OpLoad %S_std140 %136 None
-        %138 = OpAccessChain %_ptr_Function_S_std140 %124 %131
-               OpStore %138 %137 None
+        %135 = OpLabel
+        %137 = OpAccessChain %_ptr_Function_S_std140 %122 %131
+        %138 = OpLoad %S_std140 %137 None
+        %139 = OpAccessChain %_ptr_Function_S_std140 %124 %131
+               OpStore %139 %138 None
                OpBranch %128
         %128 = OpLabel
         %132 = OpIAdd %uint %131 %uint_1
                OpBranch %129
         %130 = OpLabel
-        %139 = OpLoad %_arr_S_std140_uint_4_0 %124 None
-               OpReturnValue %139
+        %133 = OpLoad %_arr_S_std140_uint_4_0 %124 None
+               OpReturnValue %133
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
index b963157..0f72db9 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -57,10 +57,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -68,14 +64,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat2v2float = OpTypePointer Workgroup %mat2v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
+       %bool = OpTypeBool
+         %80 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %91 = OpTypeFunction %void
          %96 = OpTypeFunction %S %S_std140
         %105 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -84,8 +84,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -94,67 +94,67 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %75 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %78 %77
+         %78 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %77 = OpLabel
+         %79 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %79 %80 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat2v2float %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v2float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v2float %82 None
-         %84 = OpCompositeConstruct %mat2v2float %81 %83
-               OpStore %76 %84 None
-         %85 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_1 %uint_0
-         %87 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v2float %87 None
-         %89 = OpVectorShuffle %v2float %88 %88 1 0
-               OpStore %85 %89 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %81 %83 %82
+         %83 = OpLabel
+               OpBranch %49
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %42 %50
+         %86 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %88 = OpLoad %S_std140 %86 None
+         %89 = OpFunctionCall %S %tint_convert_S %88
+               OpStore %84 %89 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat2v2float %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v2float %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v2float %67 None
+         %69 = OpCompositeConstruct %mat2v2float %66 %68
+               OpStore %61 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_1 %uint_0
+         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %73 = OpLoad %v2float %72 None
+         %74 = OpVectorShuffle %v2float %73 %73 1 0
+               OpStore %70 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %91
@@ -188,21 +188,21 @@
                OpLoopMerge %115 %113 None
                OpBranch %112
         %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
+        %119 = OpUGreaterThanEqual %bool %116 %uint_4
+               OpSelectionMerge %120 None
+               OpBranchConditional %119 %121 %120
+        %121 = OpLabel
                OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %116
-        %122 = OpLoad %S_std140 %121 None
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %116
-               OpStore %123 %122 None
+        %120 = OpLabel
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %116
+        %123 = OpLoad %S_std140 %122 None
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %116
+               OpStore %124 %123 None
                OpBranch %113
         %113 = OpLabel
         %117 = OpIAdd %uint %116 %uint_1
                OpBranch %114
         %115 = OpLabel
-        %124 = OpLoad %_arr_S_std140_uint_4_0 %109 None
-               OpReturnValue %124
+        %118 = OpLoad %_arr_S_std140_uint_4_0 %109 None
+               OpReturnValue %118
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index d43be4e..c104b7a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -94,15 +94,15 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %74 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %95 = OpConstantNull %_arr_Inner_uint_4
+     %uint_2 = OpConstant %uint 2
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %105 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
-     %uint_2 = OpConstant %uint 2
         %132 = OpTypeFunction %Inner %Inner_std140
         %139 = OpTypeFunction %Outer %Outer_std140
         %161 = OpTypeFunction %_arr_Inner_std140_uint_4_0 %_arr_Inner_std140_uint_4
@@ -126,8 +126,8 @@
          %52 = OpVariable %_ptr_Function_mat2v3half Function
          %66 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %68 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %74
-        %101 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %103 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+         %91 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %93 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -160,60 +160,60 @@
                OpLoopMerge %79 %77 None
                OpBranch %76
          %76 = OpLabel
-         %82 = OpUGreaterThanEqual %bool %80 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %82 %85 %84
-         %85 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %80 %uint_4
+               OpSelectionMerge %114 None
+               OpBranchConditional %112 %115 %114
+        %115 = OpLabel
                OpBranch %79
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_Outer %68 %80
-         %88 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
-         %90 = OpLoad %Outer_std140 %88 None
-         %91 = OpFunctionCall %Outer %tint_convert_Outer %90
-               OpStore %86 %91 None
+        %114 = OpLabel
+        %116 = OpAccessChain %_ptr_Function_Outer %68 %80
+        %118 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
+        %120 = OpLoad %Outer_std140 %118 None
+        %121 = OpFunctionCall %Outer %tint_convert_Outer %120
+               OpStore %116 %121 None
                OpBranch %77
          %77 = OpLabel
          %81 = OpIAdd %uint %80 %uint_1
                OpBranch %78
          %79 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %68 None
-         %94 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %95 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %94
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %95
-         %98 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-         %99 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %98
-               OpStore %101 %99
-               OpBranch %106
-        %106 = OpLabel
-               OpBranch %109
-        %109 = OpLabel
-        %111 = OpPhi %uint %uint_0 %106 %112 %108
-               OpLoopMerge %110 %108 None
-               OpBranch %107
-        %107 = OpLabel
-        %113 = OpUGreaterThanEqual %bool %111 %uint_4
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %114
-        %115 = OpLabel
-               OpBranch %110
-        %114 = OpLabel
-        %116 = OpAccessChain %_ptr_Function_Inner %103 %111
-        %118 = OpAccessChain %_ptr_Function_Inner_std140 %101 %111
-        %120 = OpLoad %Inner_std140 %118 None
-        %121 = OpFunctionCall %Inner %tint_convert_Inner %120
-               OpStore %116 %121 None
-               OpBranch %108
-        %108 = OpLabel
-        %112 = OpIAdd %uint %111 %uint_1
-               OpBranch %109
-        %110 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %103 None
-        %124 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %124
-        %126 = OpFunctionCall %int %i
-        %127 = OpBitcast %uint %126
-        %128 = OpExtInst %uint %33 UMin %127 %uint_2
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %128
+         %83 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %84 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %83
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %84
+         %88 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %89 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %88
+               OpStore %91 %89
+               OpBranch %96
+         %96 = OpLabel
+               OpBranch %99
+         %99 = OpLabel
+        %101 = OpPhi %uint %uint_0 %96 %102 %98
+               OpLoopMerge %100 %98 None
+               OpBranch %97
+         %97 = OpLabel
+        %122 = OpUGreaterThanEqual %bool %101 %uint_4
+               OpSelectionMerge %123 None
+               OpBranchConditional %122 %124 %123
+        %124 = OpLabel
+               OpBranch %100
+        %123 = OpLabel
+        %125 = OpAccessChain %_ptr_Function_Inner %93 %101
+        %127 = OpAccessChain %_ptr_Function_Inner_std140 %91 %101
+        %129 = OpLoad %Inner_std140 %127 None
+        %130 = OpFunctionCall %Inner %tint_convert_Inner %129
+               OpStore %125 %130 None
+               OpBranch %98
+         %98 = OpLabel
+        %102 = OpIAdd %uint %101 %uint_1
+               OpBranch %99
+        %100 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %93 None
+        %104 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %104
+        %107 = OpFunctionCall %int %i
+        %108 = OpBitcast %uint %107
+        %109 = OpExtInst %uint %33 UMin %108 %uint_2
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %109
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %132
@@ -229,7 +229,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %140 = OpLabel
         %142 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %143 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+        %143 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
         %141 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %142 %141
                OpBranch %144
@@ -240,25 +240,25 @@
                OpLoopMerge %148 %146 None
                OpBranch %145
         %145 = OpLabel
-        %151 = OpUGreaterThanEqual %bool %149 %uint_4
-               OpSelectionMerge %152 None
-               OpBranchConditional %151 %153 %152
-        %153 = OpLabel
+        %153 = OpUGreaterThanEqual %bool %149 %uint_4
+               OpSelectionMerge %154 None
+               OpBranchConditional %153 %155 %154
+        %155 = OpLabel
                OpBranch %148
-        %152 = OpLabel
-        %154 = OpAccessChain %_ptr_Function_Inner %143 %149
-        %155 = OpAccessChain %_ptr_Function_Inner_std140 %142 %149
-        %156 = OpLoad %Inner_std140 %155 None
-        %157 = OpFunctionCall %Inner %tint_convert_Inner %156
-               OpStore %154 %157 None
+        %154 = OpLabel
+        %156 = OpAccessChain %_ptr_Function_Inner %143 %149
+        %157 = OpAccessChain %_ptr_Function_Inner_std140 %142 %149
+        %158 = OpLoad %Inner_std140 %157 None
+        %159 = OpFunctionCall %Inner %tint_convert_Inner %158
+               OpStore %156 %159 None
                OpBranch %146
         %146 = OpLabel
         %150 = OpIAdd %uint %149 %uint_1
                OpBranch %147
         %148 = OpLabel
-        %158 = OpLoad %_arr_Inner_uint_4 %143 None
-        %159 = OpCompositeConstruct %Outer %158
-               OpReturnValue %159
+        %151 = OpLoad %_arr_Inner_uint_4 %143 None
+        %152 = OpCompositeConstruct %Outer %151
+               OpReturnValue %152
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %161
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -274,23 +274,23 @@
                OpLoopMerge %171 %169 None
                OpBranch %168
         %168 = OpLabel
-        %174 = OpUGreaterThanEqual %bool %172 %uint_4
-               OpSelectionMerge %175 None
-               OpBranchConditional %174 %176 %175
-        %176 = OpLabel
+        %175 = OpUGreaterThanEqual %bool %172 %uint_4
+               OpSelectionMerge %176 None
+               OpBranchConditional %175 %177 %176
+        %177 = OpLabel
                OpBranch %171
-        %175 = OpLabel
-        %177 = OpAccessChain %_ptr_Function_Inner_std140 %163 %172
-        %178 = OpLoad %Inner_std140 %177 None
-        %179 = OpAccessChain %_ptr_Function_Inner_std140 %165 %172
-               OpStore %179 %178 None
+        %176 = OpLabel
+        %178 = OpAccessChain %_ptr_Function_Inner_std140 %163 %172
+        %179 = OpLoad %Inner_std140 %178 None
+        %180 = OpAccessChain %_ptr_Function_Inner_std140 %165 %172
+               OpStore %180 %179 None
                OpBranch %169
         %169 = OpLabel
         %173 = OpIAdd %uint %172 %uint_1
                OpBranch %170
         %171 = OpLabel
-        %180 = OpLoad %_arr_Inner_std140_uint_4_0 %165 None
-               OpReturnValue %180
+        %174 = OpLoad %_arr_Inner_std140_uint_4_0 %165 None
+               OpReturnValue %174
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %182
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -314,22 +314,22 @@
                OpLoopMerge %198 %196 None
                OpBranch %195
         %195 = OpLabel
-        %201 = OpUGreaterThanEqual %bool %199 %uint_4
-               OpSelectionMerge %202 None
-               OpBranchConditional %201 %203 %202
-        %203 = OpLabel
+        %202 = OpUGreaterThanEqual %bool %199 %uint_4
+               OpSelectionMerge %203 None
+               OpBranchConditional %202 %204 %203
+        %204 = OpLabel
                OpBranch %198
-        %202 = OpLabel
-        %204 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %190 %199
-        %206 = OpLoad %Outer_std140_tint_explicit_layout %204 None
-        %207 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %206
-        %208 = OpAccessChain %_ptr_Function_Outer_std140 %192 %199
-               OpStore %208 %207 None
+        %203 = OpLabel
+        %205 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %190 %199
+        %207 = OpLoad %Outer_std140_tint_explicit_layout %205 None
+        %208 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %207
+        %209 = OpAccessChain %_ptr_Function_Outer_std140 %192 %199
+               OpStore %209 %208 None
                OpBranch %196
         %196 = OpLabel
         %200 = OpIAdd %uint %199 %uint_1
                OpBranch %197
         %198 = OpLabel
-        %209 = OpLoad %_arr_Outer_std140_uint_4 %192 None
-               OpReturnValue %209
+        %201 = OpLoad %_arr_Outer_std140_uint_4 %192 None
+               OpReturnValue %201
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm
index 00108f5..e201fe6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -84,12 +84,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %50 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %71 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %81 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %104 = OpTypeFunction %Inner %Inner_std140
@@ -106,8 +106,8 @@
          %15 = OpLabel
          %42 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %44 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %50
-         %77 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %79 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+         %67 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %69 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -129,56 +129,56 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_Outer %44 %56
-         %64 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
-         %66 = OpLoad %Outer_std140 %64 None
-         %67 = OpFunctionCall %Outer %tint_convert_Outer %66
-               OpStore %62 %67 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_Outer %44 %56
+         %90 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
+         %92 = OpLoad %Outer_std140 %90 None
+         %93 = OpFunctionCall %Outer %tint_convert_Outer %92
+               OpStore %88 %93 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %44 None
-         %70 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %71 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %70
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %71
-         %74 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %75 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %74
-               OpStore %77 %75
-               OpBranch %82
-         %82 = OpLabel
-               OpBranch %85
-         %85 = OpLabel
-         %87 = OpPhi %uint %uint_0 %82 %88 %84
-               OpLoopMerge %86 %84 None
-               OpBranch %83
-         %83 = OpLabel
-         %89 = OpUGreaterThanEqual %bool %87 %uint_4
-               OpSelectionMerge %90 None
-               OpBranchConditional %89 %91 %90
-         %91 = OpLabel
-               OpBranch %86
-         %90 = OpLabel
-         %92 = OpAccessChain %_ptr_Function_Inner %79 %87
-         %94 = OpAccessChain %_ptr_Function_Inner_std140 %77 %87
-         %96 = OpLoad %Inner_std140 %94 None
-         %97 = OpFunctionCall %Inner %tint_convert_Inner %96
-               OpStore %92 %97 None
-               OpBranch %84
-         %84 = OpLabel
-         %88 = OpIAdd %uint %87 %uint_1
-               OpBranch %85
-         %86 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %79 None
-        %100 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %100
+         %59 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %60 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %59
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %60
+         %64 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %65 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %64
+               OpStore %67 %65
+               OpBranch %72
+         %72 = OpLabel
+               OpBranch %75
+         %75 = OpLabel
+         %77 = OpPhi %uint %uint_0 %72 %78 %74
+               OpLoopMerge %76 %74 None
+               OpBranch %73
+         %73 = OpLabel
+         %94 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %95 None
+               OpBranchConditional %94 %96 %95
+         %96 = OpLabel
+               OpBranch %76
+         %95 = OpLabel
+         %97 = OpAccessChain %_ptr_Function_Inner %69 %77
+         %99 = OpAccessChain %_ptr_Function_Inner_std140 %67 %77
+        %101 = OpLoad %Inner_std140 %99 None
+        %102 = OpFunctionCall %Inner %tint_convert_Inner %101
+               OpStore %97 %102 None
+               OpBranch %74
+         %74 = OpLabel
+         %78 = OpIAdd %uint %77 %uint_1
+               OpBranch %75
+         %76 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %69 None
+         %80 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %80
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -195,7 +195,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %112 = OpLabel
         %114 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
         %113 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %114 %113
                OpBranch %116
@@ -206,25 +206,25 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_Inner %115 %121
-        %127 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
-        %128 = OpLoad %Inner_std140 %127 None
-        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
-               OpStore %126 %129 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_Inner %115 %121
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
+        %130 = OpLoad %Inner_std140 %129 None
+        %131 = OpFunctionCall %Inner %tint_convert_Inner %130
+               OpStore %128 %131 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %130 = OpLoad %_arr_Inner_uint_4 %115 None
-        %131 = OpCompositeConstruct %Outer %130
-               OpReturnValue %131
+        %123 = OpLoad %_arr_Inner_uint_4 %115 None
+        %124 = OpCompositeConstruct %Outer %123
+               OpReturnValue %124
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %133
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -240,23 +240,23 @@
                OpLoopMerge %143 %141 None
                OpBranch %140
         %140 = OpLabel
-        %146 = OpUGreaterThanEqual %bool %144 %uint_4
-               OpSelectionMerge %147 None
-               OpBranchConditional %146 %148 %147
-        %148 = OpLabel
+        %147 = OpUGreaterThanEqual %bool %144 %uint_4
+               OpSelectionMerge %148 None
+               OpBranchConditional %147 %149 %148
+        %149 = OpLabel
                OpBranch %143
-        %147 = OpLabel
-        %149 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
-        %150 = OpLoad %Inner_std140 %149 None
-        %151 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
-               OpStore %151 %150 None
+        %148 = OpLabel
+        %150 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
+        %151 = OpLoad %Inner_std140 %150 None
+        %152 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
+               OpStore %152 %151 None
                OpBranch %141
         %141 = OpLabel
         %145 = OpIAdd %uint %144 %uint_1
                OpBranch %142
         %143 = OpLabel
-        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
-               OpReturnValue %152
+        %146 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
+               OpReturnValue %146
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %154
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -280,22 +280,22 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
-        %178 = OpLoad %Outer_std140_tint_explicit_layout %176 None
-        %179 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %178
-        %180 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
-               OpStore %180 %179 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
+        %179 = OpLoad %Outer_std140_tint_explicit_layout %177 None
+        %180 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %179
+        %181 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
+               OpStore %181 %180 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %181 = OpLoad %_arr_Outer_std140_uint_4 %164 None
-               OpReturnValue %181
+        %173 = OpLoad %_arr_Outer_std140_uint_4 %164 None
+               OpReturnValue %173
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.spvasm
index e1be700..3f6d839 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.spvasm
@@ -72,13 +72,13 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
+     %uint_1 = OpConstant %uint 1
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %94 = OpTypeFunction %S %S_std140
         %103 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -124,43 +124,43 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %86 %85
+         %86 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_S %47 %55
+         %89 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %91 = OpLoad %S_std140 %89 None
+         %92 = OpFunctionCall %S %tint_convert_S %91
+               OpStore %87 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v3half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v3half %80 None
-         %82 = OpCompositeConstruct %mat2v3half %79 %81
-         %83 = OpFunctionCall %void %c %82
-         %84 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %85 = OpLoad %v3half %84 None
-         %86 = OpVectorShuffle %v3half %85 %85 2 0 1
-         %87 = OpFunctionCall %void %d %86
-         %88 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %89 = OpLoad %v3half %88 None
-         %90 = OpVectorShuffle %v3half %89 %89 2 0 1
-         %91 = OpCompositeExtract %half %90 0
-         %92 = OpFunctionCall %void %e %91
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v3half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v3half %70 None
+         %72 = OpCompositeConstruct %mat2v3half %69 %71
+         %73 = OpFunctionCall %void %c %72
+         %74 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v3half %74 None
+         %76 = OpVectorShuffle %v3half %75 %75 2 0 1
+         %77 = OpFunctionCall %void %d %76
+         %78 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %79 = OpLoad %v3half %78 None
+         %80 = OpVectorShuffle %v3half %79 %79 2 0 1
+         %81 = OpCompositeExtract %half %80 0
+         %82 = OpFunctionCall %void %e %81
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %94
@@ -188,21 +188,21 @@
                OpLoopMerge %113 %111 None
                OpBranch %110
         %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
+        %117 = OpUGreaterThanEqual %bool %114 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %117 %119 %118
+        %119 = OpLabel
                OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_S_std140 %105 %114
-        %120 = OpLoad %S_std140 %119 None
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %114
-               OpStore %121 %120 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_S_std140 %105 %114
+        %121 = OpLoad %S_std140 %120 None
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %114
+               OpStore %122 %121 None
                OpBranch %111
         %111 = OpLabel
         %115 = OpIAdd %uint %114 %uint_1
                OpBranch %112
         %113 = OpLabel
-        %122 = OpLoad %_arr_S_std140_uint_4_0 %107 None
-               OpReturnValue %122
+        %116 = OpLoad %_arr_S_std140_uint_4_0 %107 None
+               OpReturnValue %116
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.spvasm
index e3fbac3..de0414b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.spvasm
@@ -60,17 +60,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat2v3half = OpTypePointer Private %mat2v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
 %_ptr_Private_v3half = OpTypePointer Private %v3half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %74 = OpTypeFunction %S %S_std140
          %83 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -91,41 +91,41 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %63 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %65 None
+               OpBranchConditional %63 %66 %65
+         %66 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %65 = OpLabel
+         %67 = OpAccessChain %_ptr_Function_S %30 %37
+         %69 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %71 = OpLoad %S_std140 %69 None
+         %72 = OpFunctionCall %S %tint_convert_S %71
+               OpStore %67 %72 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat2v3half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v3half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v3half %65 None
-         %67 = OpCompositeConstruct %mat2v3half %64 %66
-               OpStore %59 %67 None
-         %68 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %71 = OpLoad %v3half %70 None
-         %72 = OpVectorShuffle %v3half %71 %71 2 0 1
-               OpStore %68 %72 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat2v3half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v3half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v3half %55 None
+         %57 = OpCompositeConstruct %mat2v3half %54 %56
+               OpStore %49 %57 None
+         %58 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %61 = OpLoad %v3half %60 None
+         %62 = OpVectorShuffle %v3half %61 %61 2 0 1
+               OpStore %58 %62 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %74
@@ -153,21 +153,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S_std140 %85 %94
-        %100 = OpLoad %S_std140 %99 None
-        %101 = OpAccessChain %_ptr_Function_S_std140 %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S_std140 %85 %94
+        %101 = OpLoad %S_std140 %100 None
+        %102 = OpAccessChain %_ptr_Function_S_std140 %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_std140_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_std140_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.spvasm
index d28ff7f..2cb921b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.spvasm
@@ -87,16 +87,16 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %82 = OpTypeFunction %void %_arr_S_uint_4
         %101 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -121,41 +121,41 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %71 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %74 %73
+         %74 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %73 = OpLabel
+         %75 = OpAccessChain %_ptr_Function_S %30 %40
+         %77 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %79 = OpLoad %S_std140 %77 None
+         %80 = OpFunctionCall %S %tint_convert_S %79
+               OpStore %75 %80 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %68 = OpLoad %v3half %66 None
-         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %70 = OpLoad %v3half %69 None
-         %71 = OpCompositeConstruct %mat2v3half %68 %70
-         %72 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
-         %74 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %72 %71
-         %76 = OpAccessChain %_ptr_StorageBuffer_v3half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %78 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %79 = OpLoad %v3half %78 None
-         %80 = OpVectorShuffle %v3half %79 %79 2 0 1
-               OpStore %76 %80 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3half %56 None
+         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3half %59 None
+         %61 = OpCompositeConstruct %mat2v3half %58 %60
+         %62 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
+         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %62 %61
+         %66 = OpAccessChain %_ptr_StorageBuffer_v3half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %68 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %69 = OpLoad %v3half %68 None
+         %70 = OpVectorShuffle %v3half %69 %69 2 0 1
+               OpStore %66 %70 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %82
@@ -242,21 +242,21 @@
                OpLoopMerge %141 %139 None
                OpBranch %138
         %138 = OpLabel
-        %144 = OpUGreaterThanEqual %bool %142 %uint_4
-               OpSelectionMerge %145 None
-               OpBranchConditional %144 %146 %145
-        %146 = OpLabel
+        %145 = OpUGreaterThanEqual %bool %142 %uint_4
+               OpSelectionMerge %146 None
+               OpBranchConditional %145 %147 %146
+        %147 = OpLabel
                OpBranch %141
-        %145 = OpLabel
-        %147 = OpAccessChain %_ptr_Function_S_std140 %133 %142
-        %148 = OpLoad %S_std140 %147 None
-        %149 = OpAccessChain %_ptr_Function_S_std140 %135 %142
-               OpStore %149 %148 None
+        %146 = OpLabel
+        %148 = OpAccessChain %_ptr_Function_S_std140 %133 %142
+        %149 = OpLoad %S_std140 %148 None
+        %150 = OpAccessChain %_ptr_Function_S_std140 %135 %142
+               OpStore %150 %149 None
                OpBranch %139
         %139 = OpLabel
         %143 = OpIAdd %uint %142 %uint_1
                OpBranch %140
         %141 = OpLabel
-        %150 = OpLoad %_arr_S_std140_uint_4_0 %135 None
-               OpReturnValue %150
+        %144 = OpLoad %_arr_S_std140_uint_4_0 %135 None
+               OpReturnValue %144
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
index b1de3d1..e23d284 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -60,10 +60,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -71,14 +67,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat2v3half = OpTypePointer Workgroup %mat2v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
+       %bool = OpTypeBool
+         %80 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %91 = OpTypeFunction %void
          %96 = OpTypeFunction %S %S_std140
         %105 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -87,8 +87,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -97,67 +97,67 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %75 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %78 %77
+         %78 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %77 = OpLabel
+         %79 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %79 %80 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat2v3half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v3half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v3half %82 None
-         %84 = OpCompositeConstruct %mat2v3half %81 %83
-               OpStore %76 %84 None
-         %85 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_1 %uint_0
-         %87 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v3half %87 None
-         %89 = OpVectorShuffle %v3half %88 %88 2 0 1
-               OpStore %85 %89 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %81 %83 %82
+         %83 = OpLabel
+               OpBranch %49
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %42 %50
+         %86 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %88 = OpLoad %S_std140 %86 None
+         %89 = OpFunctionCall %S %tint_convert_S %88
+               OpStore %84 %89 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat2v3half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v3half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v3half %67 None
+         %69 = OpCompositeConstruct %mat2v3half %66 %68
+               OpStore %61 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_1 %uint_0
+         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %73 = OpLoad %v3half %72 None
+         %74 = OpVectorShuffle %v3half %73 %73 2 0 1
+               OpStore %70 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %91
@@ -191,21 +191,21 @@
                OpLoopMerge %115 %113 None
                OpBranch %112
         %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
+        %119 = OpUGreaterThanEqual %bool %116 %uint_4
+               OpSelectionMerge %120 None
+               OpBranchConditional %119 %121 %120
+        %121 = OpLabel
                OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %116
-        %122 = OpLoad %S_std140 %121 None
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %116
-               OpStore %123 %122 None
+        %120 = OpLabel
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %116
+        %123 = OpLoad %S_std140 %122 None
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %116
+               OpStore %124 %123 None
                OpBranch %113
         %113 = OpLabel
         %117 = OpIAdd %uint %116 %uint_1
                OpBranch %114
         %115 = OpLabel
-        %124 = OpLoad %_arr_S_std140_uint_4_0 %109 None
-               OpReturnValue %124
+        %118 = OpLoad %_arr_S_std140_uint_4_0 %109 None
+               OpReturnValue %118
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 13345a5..aa98529 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -91,15 +91,15 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %74 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %95 = OpConstantNull %_arr_Inner_uint_4
+     %uint_2 = OpConstant %uint 2
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %105 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
-     %uint_2 = OpConstant %uint 2
         %132 = OpTypeFunction %Inner %Inner_std140
         %139 = OpTypeFunction %Outer %Outer_std140
         %161 = OpTypeFunction %_arr_Inner_std140_uint_4_0 %_arr_Inner_std140_uint_4
@@ -123,8 +123,8 @@
          %52 = OpVariable %_ptr_Function_mat2v3float Function
          %66 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %68 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %74
-        %101 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %103 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+         %91 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %93 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -157,60 +157,60 @@
                OpLoopMerge %79 %77 None
                OpBranch %76
          %76 = OpLabel
-         %82 = OpUGreaterThanEqual %bool %80 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %82 %85 %84
-         %85 = OpLabel
+        %112 = OpUGreaterThanEqual %bool %80 %uint_4
+               OpSelectionMerge %114 None
+               OpBranchConditional %112 %115 %114
+        %115 = OpLabel
                OpBranch %79
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_Outer %68 %80
-         %88 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
-         %90 = OpLoad %Outer_std140 %88 None
-         %91 = OpFunctionCall %Outer %tint_convert_Outer %90
-               OpStore %86 %91 None
+        %114 = OpLabel
+        %116 = OpAccessChain %_ptr_Function_Outer %68 %80
+        %118 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
+        %120 = OpLoad %Outer_std140 %118 None
+        %121 = OpFunctionCall %Outer %tint_convert_Outer %120
+               OpStore %116 %121 None
                OpBranch %77
          %77 = OpLabel
          %81 = OpIAdd %uint %80 %uint_1
                OpBranch %78
          %79 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %68 None
-         %94 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %95 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %94
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %95
-         %98 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-         %99 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %98
-               OpStore %101 %99
-               OpBranch %106
-        %106 = OpLabel
-               OpBranch %109
-        %109 = OpLabel
-        %111 = OpPhi %uint %uint_0 %106 %112 %108
-               OpLoopMerge %110 %108 None
-               OpBranch %107
-        %107 = OpLabel
-        %113 = OpUGreaterThanEqual %bool %111 %uint_4
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %114
-        %115 = OpLabel
-               OpBranch %110
-        %114 = OpLabel
-        %116 = OpAccessChain %_ptr_Function_Inner %103 %111
-        %118 = OpAccessChain %_ptr_Function_Inner_std140 %101 %111
-        %120 = OpLoad %Inner_std140 %118 None
-        %121 = OpFunctionCall %Inner %tint_convert_Inner %120
-               OpStore %116 %121 None
-               OpBranch %108
-        %108 = OpLabel
-        %112 = OpIAdd %uint %111 %uint_1
-               OpBranch %109
-        %110 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %103 None
-        %124 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %124
-        %126 = OpFunctionCall %int %i
-        %127 = OpBitcast %uint %126
-        %128 = OpExtInst %uint %33 UMin %127 %uint_2
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %128
+         %83 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %84 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %83
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %84
+         %88 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %89 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %88
+               OpStore %91 %89
+               OpBranch %96
+         %96 = OpLabel
+               OpBranch %99
+         %99 = OpLabel
+        %101 = OpPhi %uint %uint_0 %96 %102 %98
+               OpLoopMerge %100 %98 None
+               OpBranch %97
+         %97 = OpLabel
+        %122 = OpUGreaterThanEqual %bool %101 %uint_4
+               OpSelectionMerge %123 None
+               OpBranchConditional %122 %124 %123
+        %124 = OpLabel
+               OpBranch %100
+        %123 = OpLabel
+        %125 = OpAccessChain %_ptr_Function_Inner %93 %101
+        %127 = OpAccessChain %_ptr_Function_Inner_std140 %91 %101
+        %129 = OpLoad %Inner_std140 %127 None
+        %130 = OpFunctionCall %Inner %tint_convert_Inner %129
+               OpStore %125 %130 None
+               OpBranch %98
+         %98 = OpLabel
+        %102 = OpIAdd %uint %101 %uint_1
+               OpBranch %99
+        %100 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %93 None
+        %104 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %104
+        %107 = OpFunctionCall %int %i
+        %108 = OpBitcast %uint %107
+        %109 = OpExtInst %uint %33 UMin %108 %uint_2
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %109
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %132
@@ -226,7 +226,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %140 = OpLabel
         %142 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %143 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+        %143 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
         %141 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %142 %141
                OpBranch %144
@@ -237,25 +237,25 @@
                OpLoopMerge %148 %146 None
                OpBranch %145
         %145 = OpLabel
-        %151 = OpUGreaterThanEqual %bool %149 %uint_4
-               OpSelectionMerge %152 None
-               OpBranchConditional %151 %153 %152
-        %153 = OpLabel
+        %153 = OpUGreaterThanEqual %bool %149 %uint_4
+               OpSelectionMerge %154 None
+               OpBranchConditional %153 %155 %154
+        %155 = OpLabel
                OpBranch %148
-        %152 = OpLabel
-        %154 = OpAccessChain %_ptr_Function_Inner %143 %149
-        %155 = OpAccessChain %_ptr_Function_Inner_std140 %142 %149
-        %156 = OpLoad %Inner_std140 %155 None
-        %157 = OpFunctionCall %Inner %tint_convert_Inner %156
-               OpStore %154 %157 None
+        %154 = OpLabel
+        %156 = OpAccessChain %_ptr_Function_Inner %143 %149
+        %157 = OpAccessChain %_ptr_Function_Inner_std140 %142 %149
+        %158 = OpLoad %Inner_std140 %157 None
+        %159 = OpFunctionCall %Inner %tint_convert_Inner %158
+               OpStore %156 %159 None
                OpBranch %146
         %146 = OpLabel
         %150 = OpIAdd %uint %149 %uint_1
                OpBranch %147
         %148 = OpLabel
-        %158 = OpLoad %_arr_Inner_uint_4 %143 None
-        %159 = OpCompositeConstruct %Outer %158
-               OpReturnValue %159
+        %151 = OpLoad %_arr_Inner_uint_4 %143 None
+        %152 = OpCompositeConstruct %Outer %151
+               OpReturnValue %152
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %161
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -271,23 +271,23 @@
                OpLoopMerge %171 %169 None
                OpBranch %168
         %168 = OpLabel
-        %174 = OpUGreaterThanEqual %bool %172 %uint_4
-               OpSelectionMerge %175 None
-               OpBranchConditional %174 %176 %175
-        %176 = OpLabel
+        %175 = OpUGreaterThanEqual %bool %172 %uint_4
+               OpSelectionMerge %176 None
+               OpBranchConditional %175 %177 %176
+        %177 = OpLabel
                OpBranch %171
-        %175 = OpLabel
-        %177 = OpAccessChain %_ptr_Function_Inner_std140 %163 %172
-        %178 = OpLoad %Inner_std140 %177 None
-        %179 = OpAccessChain %_ptr_Function_Inner_std140 %165 %172
-               OpStore %179 %178 None
+        %176 = OpLabel
+        %178 = OpAccessChain %_ptr_Function_Inner_std140 %163 %172
+        %179 = OpLoad %Inner_std140 %178 None
+        %180 = OpAccessChain %_ptr_Function_Inner_std140 %165 %172
+               OpStore %180 %179 None
                OpBranch %169
         %169 = OpLabel
         %173 = OpIAdd %uint %172 %uint_1
                OpBranch %170
         %171 = OpLabel
-        %180 = OpLoad %_arr_Inner_std140_uint_4_0 %165 None
-               OpReturnValue %180
+        %174 = OpLoad %_arr_Inner_std140_uint_4_0 %165 None
+               OpReturnValue %174
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %182
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -311,22 +311,22 @@
                OpLoopMerge %198 %196 None
                OpBranch %195
         %195 = OpLabel
-        %201 = OpUGreaterThanEqual %bool %199 %uint_4
-               OpSelectionMerge %202 None
-               OpBranchConditional %201 %203 %202
-        %203 = OpLabel
+        %202 = OpUGreaterThanEqual %bool %199 %uint_4
+               OpSelectionMerge %203 None
+               OpBranchConditional %202 %204 %203
+        %204 = OpLabel
                OpBranch %198
-        %202 = OpLabel
-        %204 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %190 %199
-        %206 = OpLoad %Outer_std140_tint_explicit_layout %204 None
-        %207 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %206
-        %208 = OpAccessChain %_ptr_Function_Outer_std140 %192 %199
-               OpStore %208 %207 None
+        %203 = OpLabel
+        %205 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %190 %199
+        %207 = OpLoad %Outer_std140_tint_explicit_layout %205 None
+        %208 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %207
+        %209 = OpAccessChain %_ptr_Function_Outer_std140 %192 %199
+               OpStore %209 %208 None
                OpBranch %196
         %196 = OpLabel
         %200 = OpIAdd %uint %199 %uint_1
                OpBranch %197
         %198 = OpLabel
-        %209 = OpLoad %_arr_Outer_std140_uint_4 %192 None
-               OpReturnValue %209
+        %201 = OpLoad %_arr_Outer_std140_uint_4 %192 None
+               OpReturnValue %201
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm
index bef5791..e6069ba 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -81,12 +81,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %50 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %71 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %81 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %104 = OpTypeFunction %Inner %Inner_std140
@@ -103,8 +103,8 @@
          %15 = OpLabel
          %42 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %44 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %50
-         %77 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %79 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+         %67 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %69 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -126,56 +126,56 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_Outer %44 %56
-         %64 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
-         %66 = OpLoad %Outer_std140 %64 None
-         %67 = OpFunctionCall %Outer %tint_convert_Outer %66
-               OpStore %62 %67 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_Outer %44 %56
+         %90 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
+         %92 = OpLoad %Outer_std140 %90 None
+         %93 = OpFunctionCall %Outer %tint_convert_Outer %92
+               OpStore %88 %93 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %44 None
-         %70 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %71 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %70
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %71
-         %74 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %75 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %74
-               OpStore %77 %75
-               OpBranch %82
-         %82 = OpLabel
-               OpBranch %85
-         %85 = OpLabel
-         %87 = OpPhi %uint %uint_0 %82 %88 %84
-               OpLoopMerge %86 %84 None
-               OpBranch %83
-         %83 = OpLabel
-         %89 = OpUGreaterThanEqual %bool %87 %uint_4
-               OpSelectionMerge %90 None
-               OpBranchConditional %89 %91 %90
-         %91 = OpLabel
-               OpBranch %86
-         %90 = OpLabel
-         %92 = OpAccessChain %_ptr_Function_Inner %79 %87
-         %94 = OpAccessChain %_ptr_Function_Inner_std140 %77 %87
-         %96 = OpLoad %Inner_std140 %94 None
-         %97 = OpFunctionCall %Inner %tint_convert_Inner %96
-               OpStore %92 %97 None
-               OpBranch %84
-         %84 = OpLabel
-         %88 = OpIAdd %uint %87 %uint_1
-               OpBranch %85
-         %86 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %79 None
-        %100 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %100
+         %59 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %60 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %59
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %60
+         %64 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %65 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %64
+               OpStore %67 %65
+               OpBranch %72
+         %72 = OpLabel
+               OpBranch %75
+         %75 = OpLabel
+         %77 = OpPhi %uint %uint_0 %72 %78 %74
+               OpLoopMerge %76 %74 None
+               OpBranch %73
+         %73 = OpLabel
+         %94 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %95 None
+               OpBranchConditional %94 %96 %95
+         %96 = OpLabel
+               OpBranch %76
+         %95 = OpLabel
+         %97 = OpAccessChain %_ptr_Function_Inner %69 %77
+         %99 = OpAccessChain %_ptr_Function_Inner_std140 %67 %77
+        %101 = OpLoad %Inner_std140 %99 None
+        %102 = OpFunctionCall %Inner %tint_convert_Inner %101
+               OpStore %97 %102 None
+               OpBranch %74
+         %74 = OpLabel
+         %78 = OpIAdd %uint %77 %uint_1
+               OpBranch %75
+         %76 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %69 None
+         %80 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %80
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %float %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -192,7 +192,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %112 = OpLabel
         %114 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
         %113 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %114 %113
                OpBranch %116
@@ -203,25 +203,25 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_Inner %115 %121
-        %127 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
-        %128 = OpLoad %Inner_std140 %127 None
-        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
-               OpStore %126 %129 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_Inner %115 %121
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
+        %130 = OpLoad %Inner_std140 %129 None
+        %131 = OpFunctionCall %Inner %tint_convert_Inner %130
+               OpStore %128 %131 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %130 = OpLoad %_arr_Inner_uint_4 %115 None
-        %131 = OpCompositeConstruct %Outer %130
-               OpReturnValue %131
+        %123 = OpLoad %_arr_Inner_uint_4 %115 None
+        %124 = OpCompositeConstruct %Outer %123
+               OpReturnValue %124
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %133
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -237,23 +237,23 @@
                OpLoopMerge %143 %141 None
                OpBranch %140
         %140 = OpLabel
-        %146 = OpUGreaterThanEqual %bool %144 %uint_4
-               OpSelectionMerge %147 None
-               OpBranchConditional %146 %148 %147
-        %148 = OpLabel
+        %147 = OpUGreaterThanEqual %bool %144 %uint_4
+               OpSelectionMerge %148 None
+               OpBranchConditional %147 %149 %148
+        %149 = OpLabel
                OpBranch %143
-        %147 = OpLabel
-        %149 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
-        %150 = OpLoad %Inner_std140 %149 None
-        %151 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
-               OpStore %151 %150 None
+        %148 = OpLabel
+        %150 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
+        %151 = OpLoad %Inner_std140 %150 None
+        %152 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
+               OpStore %152 %151 None
                OpBranch %141
         %141 = OpLabel
         %145 = OpIAdd %uint %144 %uint_1
                OpBranch %142
         %143 = OpLabel
-        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
-               OpReturnValue %152
+        %146 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
+               OpReturnValue %146
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %154
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -277,22 +277,22 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
-        %178 = OpLoad %Outer_std140_tint_explicit_layout %176 None
-        %179 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %178
-        %180 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
-               OpStore %180 %179 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
+        %179 = OpLoad %Outer_std140_tint_explicit_layout %177 None
+        %180 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %179
+        %181 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
+               OpStore %181 %180 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %181 = OpLoad %_arr_Outer_std140_uint_4 %164 None
-               OpReturnValue %181
+        %173 = OpLoad %_arr_Outer_std140_uint_4 %164 None
+               OpReturnValue %173
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.spvasm
index 4f5ffc2..dc43601 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.spvasm
@@ -69,13 +69,13 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+     %uint_1 = OpConstant %uint 1
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %94 = OpTypeFunction %S %S_std140
         %103 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -121,43 +121,43 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %86 %85
+         %86 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_S %47 %55
+         %89 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %91 = OpLoad %S_std140 %89 None
+         %92 = OpFunctionCall %S %tint_convert_S %91
+               OpStore %87 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v3float %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v3float %80 None
-         %82 = OpCompositeConstruct %mat2v3float %79 %81
-         %83 = OpFunctionCall %void %c %82
-         %84 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %85 = OpLoad %v3float %84 None
-         %86 = OpVectorShuffle %v3float %85 %85 2 0 1
-         %87 = OpFunctionCall %void %d %86
-         %88 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %89 = OpLoad %v3float %88 None
-         %90 = OpVectorShuffle %v3float %89 %89 2 0 1
-         %91 = OpCompositeExtract %float %90 0
-         %92 = OpFunctionCall %void %e %91
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v3float %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v3float %70 None
+         %72 = OpCompositeConstruct %mat2v3float %69 %71
+         %73 = OpFunctionCall %void %c %72
+         %74 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v3float %74 None
+         %76 = OpVectorShuffle %v3float %75 %75 2 0 1
+         %77 = OpFunctionCall %void %d %76
+         %78 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %79 = OpLoad %v3float %78 None
+         %80 = OpVectorShuffle %v3float %79 %79 2 0 1
+         %81 = OpCompositeExtract %float %80 0
+         %82 = OpFunctionCall %void %e %81
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %94
@@ -185,21 +185,21 @@
                OpLoopMerge %113 %111 None
                OpBranch %110
         %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
+        %117 = OpUGreaterThanEqual %bool %114 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %117 %119 %118
+        %119 = OpLabel
                OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_S_std140 %105 %114
-        %120 = OpLoad %S_std140 %119 None
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %114
-               OpStore %121 %120 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_S_std140 %105 %114
+        %121 = OpLoad %S_std140 %120 None
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %114
+               OpStore %122 %121 None
                OpBranch %111
         %111 = OpLabel
         %115 = OpIAdd %uint %114 %uint_1
                OpBranch %112
         %113 = OpLabel
-        %122 = OpLoad %_arr_S_std140_uint_4_0 %107 None
-               OpReturnValue %122
+        %116 = OpLoad %_arr_S_std140_uint_4_0 %107 None
+               OpReturnValue %116
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.spvasm
index 0ae9acd..8815318 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.spvasm
@@ -57,17 +57,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat2v3float = OpTypePointer Private %mat2v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Private_v3float = OpTypePointer Private %v3float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %74 = OpTypeFunction %S %S_std140
          %83 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -88,41 +88,41 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %63 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %65 None
+               OpBranchConditional %63 %66 %65
+         %66 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %65 = OpLabel
+         %67 = OpAccessChain %_ptr_Function_S %30 %37
+         %69 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %71 = OpLoad %S_std140 %69 None
+         %72 = OpFunctionCall %S %tint_convert_S %71
+               OpStore %67 %72 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat2v3float %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v3float %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v3float %65 None
-         %67 = OpCompositeConstruct %mat2v3float %64 %66
-               OpStore %59 %67 None
-         %68 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %71 = OpLoad %v3float %70 None
-         %72 = OpVectorShuffle %v3float %71 %71 2 0 1
-               OpStore %68 %72 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat2v3float %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v3float %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v3float %55 None
+         %57 = OpCompositeConstruct %mat2v3float %54 %56
+               OpStore %49 %57 None
+         %58 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %61 = OpLoad %v3float %60 None
+         %62 = OpVectorShuffle %v3float %61 %61 2 0 1
+               OpStore %58 %62 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %74
@@ -150,21 +150,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S_std140 %85 %94
-        %100 = OpLoad %S_std140 %99 None
-        %101 = OpAccessChain %_ptr_Function_S_std140 %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S_std140 %85 %94
+        %101 = OpLoad %S_std140 %100 None
+        %102 = OpAccessChain %_ptr_Function_S_std140 %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_std140_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_std140_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.spvasm
index 87f05f9..c78ee38 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.spvasm
@@ -84,16 +84,16 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %82 = OpTypeFunction %void %_arr_S_uint_4
         %101 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -118,41 +118,41 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %71 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %71 %74 %73
+         %74 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %73 = OpLabel
+         %75 = OpAccessChain %_ptr_Function_S %30 %40
+         %77 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %79 = OpLoad %S_std140 %77 None
+         %80 = OpFunctionCall %S %tint_convert_S %79
+               OpStore %75 %80 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %68 = OpLoad %v3float %66 None
-         %69 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %70 = OpLoad %v3float %69 None
-         %71 = OpCompositeConstruct %mat2v3float %68 %70
-         %72 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
-         %74 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %72 %71
-         %76 = OpAccessChain %_ptr_StorageBuffer_v3float %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %78 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %79 = OpLoad %v3float %78 None
-         %80 = OpVectorShuffle %v3float %79 %79 2 0 1
-               OpStore %76 %80 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3float %56 None
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3float %59 None
+         %61 = OpCompositeConstruct %mat2v3float %58 %60
+         %62 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
+         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %62 %61
+         %66 = OpAccessChain %_ptr_StorageBuffer_v3float %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %68 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %69 = OpLoad %v3float %68 None
+         %70 = OpVectorShuffle %v3float %69 %69 2 0 1
+               OpStore %66 %70 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %82
@@ -239,21 +239,21 @@
                OpLoopMerge %141 %139 None
                OpBranch %138
         %138 = OpLabel
-        %144 = OpUGreaterThanEqual %bool %142 %uint_4
-               OpSelectionMerge %145 None
-               OpBranchConditional %144 %146 %145
-        %146 = OpLabel
+        %145 = OpUGreaterThanEqual %bool %142 %uint_4
+               OpSelectionMerge %146 None
+               OpBranchConditional %145 %147 %146
+        %147 = OpLabel
                OpBranch %141
-        %145 = OpLabel
-        %147 = OpAccessChain %_ptr_Function_S_std140 %133 %142
-        %148 = OpLoad %S_std140 %147 None
-        %149 = OpAccessChain %_ptr_Function_S_std140 %135 %142
-               OpStore %149 %148 None
+        %146 = OpLabel
+        %148 = OpAccessChain %_ptr_Function_S_std140 %133 %142
+        %149 = OpLoad %S_std140 %148 None
+        %150 = OpAccessChain %_ptr_Function_S_std140 %135 %142
+               OpStore %150 %149 None
                OpBranch %139
         %139 = OpLabel
         %143 = OpIAdd %uint %142 %uint_1
                OpBranch %140
         %141 = OpLabel
-        %150 = OpLoad %_arr_S_std140_uint_4_0 %135 None
-               OpReturnValue %150
+        %144 = OpLoad %_arr_S_std140_uint_4_0 %135 None
+               OpReturnValue %144
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
index 760e26f..9815fa5 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -57,10 +57,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -68,14 +64,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat2v3float = OpTypePointer Workgroup %mat2v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
+       %bool = OpTypeBool
+         %80 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %91 = OpTypeFunction %void
          %96 = OpTypeFunction %S %S_std140
         %105 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -84,8 +84,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -94,67 +94,67 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %75 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %78 %77
+         %78 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %77 = OpLabel
+         %79 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %79 %80 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat2v3float %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v3float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v3float %82 None
-         %84 = OpCompositeConstruct %mat2v3float %81 %83
-               OpStore %76 %84 None
-         %85 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_1 %uint_0
-         %87 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v3float %87 None
-         %89 = OpVectorShuffle %v3float %88 %88 2 0 1
-               OpStore %85 %89 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %81 %83 %82
+         %83 = OpLabel
+               OpBranch %49
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %42 %50
+         %86 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %88 = OpLoad %S_std140 %86 None
+         %89 = OpFunctionCall %S %tint_convert_S %88
+               OpStore %84 %89 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat2v3float %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v3float %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v3float %67 None
+         %69 = OpCompositeConstruct %mat2v3float %66 %68
+               OpStore %61 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_1 %uint_0
+         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %73 = OpLoad %v3float %72 None
+         %74 = OpVectorShuffle %v3float %73 %73 2 0 1
+               OpStore %70 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %91
@@ -188,21 +188,21 @@
                OpLoopMerge %115 %113 None
                OpBranch %112
         %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
+        %119 = OpUGreaterThanEqual %bool %116 %uint_4
+               OpSelectionMerge %120 None
+               OpBranchConditional %119 %121 %120
+        %121 = OpLabel
                OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %116
-        %122 = OpLoad %S_std140 %121 None
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %116
-               OpStore %123 %122 None
+        %120 = OpLabel
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %116
+        %123 = OpLoad %S_std140 %122 None
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %116
+               OpStore %124 %123 None
                OpBranch %113
         %113 = OpLabel
         %117 = OpIAdd %uint %116 %uint_1
                OpBranch %114
         %115 = OpLabel
-        %124 = OpLoad %_arr_S_std140_uint_4_0 %109 None
-               OpReturnValue %124
+        %118 = OpLoad %_arr_S_std140_uint_4_0 %109 None
+               OpReturnValue %118
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 20d60dc..560ffa4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -94,12 +94,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %74 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %95 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %105 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %131 = OpTypeFunction %Inner %Inner_std140
@@ -125,8 +125,8 @@
          %52 = OpVariable %_ptr_Function_mat2v4half Function
          %66 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %68 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %74
-        %101 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %103 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+         %91 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %93 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -159,60 +159,60 @@
                OpLoopMerge %79 %77 None
                OpBranch %76
          %76 = OpLabel
-         %82 = OpUGreaterThanEqual %bool %80 %uint_4
-               OpSelectionMerge %84 None
-               OpBranchConditional %82 %85 %84
-         %85 = OpLabel
+        %111 = OpUGreaterThanEqual %bool %80 %uint_4
+               OpSelectionMerge %113 None
+               OpBranchConditional %111 %114 %113
+        %114 = OpLabel
                OpBranch %79
-         %84 = OpLabel
-         %86 = OpAccessChain %_ptr_Function_Outer %68 %80
-         %88 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
-         %90 = OpLoad %Outer_std140 %88 None
-         %91 = OpFunctionCall %Outer %tint_convert_Outer %90
-               OpStore %86 %91 None
+        %113 = OpLabel
+        %115 = OpAccessChain %_ptr_Function_Outer %68 %80
+        %117 = OpAccessChain %_ptr_Function_Outer_std140 %66 %80
+        %119 = OpLoad %Outer_std140 %117 None
+        %120 = OpFunctionCall %Outer %tint_convert_Outer %119
+               OpStore %115 %120 None
                OpBranch %77
          %77 = OpLabel
          %81 = OpIAdd %uint %80 %uint_1
                OpBranch %78
          %79 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %68 None
-         %94 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %95 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %94
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %95
-         %98 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-         %99 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %98
-               OpStore %101 %99
-               OpBranch %106
-        %106 = OpLabel
-               OpBranch %109
-        %109 = OpLabel
-        %111 = OpPhi %uint %uint_0 %106 %112 %108
-               OpLoopMerge %110 %108 None
-               OpBranch %107
-        %107 = OpLabel
-        %113 = OpUGreaterThanEqual %bool %111 %uint_4
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %114
-        %115 = OpLabel
-               OpBranch %110
-        %114 = OpLabel
-        %116 = OpAccessChain %_ptr_Function_Inner %103 %111
-        %118 = OpAccessChain %_ptr_Function_Inner_std140 %101 %111
-        %120 = OpLoad %Inner_std140 %118 None
-        %121 = OpFunctionCall %Inner %tint_convert_Inner %120
-               OpStore %116 %121 None
-               OpBranch %108
-        %108 = OpLabel
-        %112 = OpIAdd %uint %111 %uint_1
-               OpBranch %109
-        %110 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %103 None
-        %124 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %124
-        %126 = OpFunctionCall %int %i
-        %127 = OpBitcast %uint %126
-        %128 = OpExtInst %uint %33 UMin %127 %uint_3
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %128
+         %83 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %84 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %83
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %84
+         %88 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %89 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %88
+               OpStore %91 %89
+               OpBranch %96
+         %96 = OpLabel
+               OpBranch %99
+         %99 = OpLabel
+        %101 = OpPhi %uint %uint_0 %96 %102 %98
+               OpLoopMerge %100 %98 None
+               OpBranch %97
+         %97 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %101 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
+               OpBranch %100
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_Inner %93 %101
+        %126 = OpAccessChain %_ptr_Function_Inner_std140 %91 %101
+        %128 = OpLoad %Inner_std140 %126 None
+        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
+               OpStore %124 %129 None
+               OpBranch %98
+         %98 = OpLabel
+        %102 = OpIAdd %uint %101 %uint_1
+               OpBranch %99
+        %100 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %93 None
+        %104 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %104
+        %107 = OpFunctionCall %int %i
+        %108 = OpBitcast %uint %107
+        %109 = OpExtInst %uint %33 UMin %108 %uint_3
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %109
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %131
@@ -228,7 +228,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %139 = OpLabel
         %141 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %142 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %105
+        %142 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %95
         %140 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %141 %140
                OpBranch %143
@@ -239,25 +239,25 @@
                OpLoopMerge %147 %145 None
                OpBranch %144
         %144 = OpLabel
-        %150 = OpUGreaterThanEqual %bool %148 %uint_4
-               OpSelectionMerge %151 None
-               OpBranchConditional %150 %152 %151
-        %152 = OpLabel
+        %152 = OpUGreaterThanEqual %bool %148 %uint_4
+               OpSelectionMerge %153 None
+               OpBranchConditional %152 %154 %153
+        %154 = OpLabel
                OpBranch %147
-        %151 = OpLabel
-        %153 = OpAccessChain %_ptr_Function_Inner %142 %148
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %141 %148
-        %155 = OpLoad %Inner_std140 %154 None
-        %156 = OpFunctionCall %Inner %tint_convert_Inner %155
-               OpStore %153 %156 None
+        %153 = OpLabel
+        %155 = OpAccessChain %_ptr_Function_Inner %142 %148
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %148
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpFunctionCall %Inner %tint_convert_Inner %157
+               OpStore %155 %158 None
                OpBranch %145
         %145 = OpLabel
         %149 = OpIAdd %uint %148 %uint_1
                OpBranch %146
         %147 = OpLabel
-        %157 = OpLoad %_arr_Inner_uint_4 %142 None
-        %158 = OpCompositeConstruct %Outer %157
-               OpReturnValue %158
+        %150 = OpLoad %_arr_Inner_uint_4 %142 None
+        %151 = OpCompositeConstruct %Outer %150
+               OpReturnValue %151
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %160
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -273,23 +273,23 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Inner_std140 %162 %171
-        %177 = OpLoad %Inner_std140 %176 None
-        %178 = OpAccessChain %_ptr_Function_Inner_std140 %164 %171
-               OpStore %178 %177 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Inner_std140 %162 %171
+        %178 = OpLoad %Inner_std140 %177 None
+        %179 = OpAccessChain %_ptr_Function_Inner_std140 %164 %171
+               OpStore %179 %178 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %179 = OpLoad %_arr_Inner_std140_uint_4_0 %164 None
-               OpReturnValue %179
+        %173 = OpLoad %_arr_Inner_std140_uint_4_0 %164 None
+               OpReturnValue %173
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %181
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -313,22 +313,22 @@
                OpLoopMerge %197 %195 None
                OpBranch %194
         %194 = OpLabel
-        %200 = OpUGreaterThanEqual %bool %198 %uint_4
-               OpSelectionMerge %201 None
-               OpBranchConditional %200 %202 %201
-        %202 = OpLabel
+        %201 = OpUGreaterThanEqual %bool %198 %uint_4
+               OpSelectionMerge %202 None
+               OpBranchConditional %201 %203 %202
+        %203 = OpLabel
                OpBranch %197
-        %201 = OpLabel
-        %203 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %189 %198
-        %205 = OpLoad %Outer_std140_tint_explicit_layout %203 None
-        %206 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %205
-        %207 = OpAccessChain %_ptr_Function_Outer_std140 %191 %198
-               OpStore %207 %206 None
+        %202 = OpLabel
+        %204 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %189 %198
+        %206 = OpLoad %Outer_std140_tint_explicit_layout %204 None
+        %207 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %206
+        %208 = OpAccessChain %_ptr_Function_Outer_std140 %191 %198
+               OpStore %208 %207 None
                OpBranch %195
         %195 = OpLabel
         %199 = OpIAdd %uint %198 %uint_1
                OpBranch %196
         %197 = OpLabel
-        %208 = OpLoad %_arr_Outer_std140_uint_4 %191 None
-               OpReturnValue %208
+        %200 = OpLoad %_arr_Outer_std140_uint_4 %191 None
+               OpReturnValue %200
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm
index b71eea6..c1cadae 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -84,12 +84,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %50 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %71 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %81 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %104 = OpTypeFunction %Inner %Inner_std140
@@ -106,8 +106,8 @@
          %15 = OpLabel
          %42 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %44 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %50
-         %77 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %79 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+         %67 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %69 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -129,56 +129,56 @@
                OpLoopMerge %55 %53 None
                OpBranch %52
          %52 = OpLabel
-         %58 = OpUGreaterThanEqual %bool %56 %uint_4
-               OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %60
-         %61 = OpLabel
+         %84 = OpUGreaterThanEqual %bool %56 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
                OpBranch %55
-         %60 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_Outer %44 %56
-         %64 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
-         %66 = OpLoad %Outer_std140 %64 None
-         %67 = OpFunctionCall %Outer %tint_convert_Outer %66
-               OpStore %62 %67 None
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_Outer %44 %56
+         %90 = OpAccessChain %_ptr_Function_Outer_std140 %42 %56
+         %92 = OpLoad %Outer_std140 %90 None
+         %93 = OpFunctionCall %Outer %tint_convert_Outer %92
+               OpStore %88 %93 None
                OpBranch %53
          %53 = OpLabel
          %57 = OpIAdd %uint %56 %uint_1
                OpBranch %54
          %55 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %44 None
-         %70 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %71 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %70
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %71
-         %74 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %75 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %74
-               OpStore %77 %75
-               OpBranch %82
-         %82 = OpLabel
-               OpBranch %85
-         %85 = OpLabel
-         %87 = OpPhi %uint %uint_0 %82 %88 %84
-               OpLoopMerge %86 %84 None
-               OpBranch %83
-         %83 = OpLabel
-         %89 = OpUGreaterThanEqual %bool %87 %uint_4
-               OpSelectionMerge %90 None
-               OpBranchConditional %89 %91 %90
-         %91 = OpLabel
-               OpBranch %86
-         %90 = OpLabel
-         %92 = OpAccessChain %_ptr_Function_Inner %79 %87
-         %94 = OpAccessChain %_ptr_Function_Inner_std140 %77 %87
-         %96 = OpLoad %Inner_std140 %94 None
-         %97 = OpFunctionCall %Inner %tint_convert_Inner %96
-               OpStore %92 %97 None
-               OpBranch %84
-         %84 = OpLabel
-         %88 = OpIAdd %uint %87 %uint_1
-               OpBranch %85
-         %86 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %79 None
-        %100 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %100
+         %59 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %60 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %59
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %60
+         %64 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %65 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %64
+               OpStore %67 %65
+               OpBranch %72
+         %72 = OpLabel
+               OpBranch %75
+         %75 = OpLabel
+         %77 = OpPhi %uint %uint_0 %72 %78 %74
+               OpLoopMerge %76 %74 None
+               OpBranch %73
+         %73 = OpLabel
+         %94 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %95 None
+               OpBranchConditional %94 %96 %95
+         %96 = OpLabel
+               OpBranch %76
+         %95 = OpLabel
+         %97 = OpAccessChain %_ptr_Function_Inner %69 %77
+         %99 = OpAccessChain %_ptr_Function_Inner_std140 %67 %77
+        %101 = OpLoad %Inner_std140 %99 None
+        %102 = OpFunctionCall %Inner %tint_convert_Inner %101
+               OpStore %97 %102 None
+               OpBranch %74
+         %74 = OpLabel
+         %78 = OpIAdd %uint %77 %uint_1
+               OpBranch %75
+         %76 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %69 None
+         %80 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %80
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -195,7 +195,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %112 = OpLabel
         %114 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %81
+        %115 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %71
         %113 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %114 %113
                OpBranch %116
@@ -206,25 +206,25 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_Inner %115 %121
-        %127 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
-        %128 = OpLoad %Inner_std140 %127 None
-        %129 = OpFunctionCall %Inner %tint_convert_Inner %128
-               OpStore %126 %129 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_Inner %115 %121
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %114 %121
+        %130 = OpLoad %Inner_std140 %129 None
+        %131 = OpFunctionCall %Inner %tint_convert_Inner %130
+               OpStore %128 %131 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %130 = OpLoad %_arr_Inner_uint_4 %115 None
-        %131 = OpCompositeConstruct %Outer %130
-               OpReturnValue %131
+        %123 = OpLoad %_arr_Inner_uint_4 %115 None
+        %124 = OpCompositeConstruct %Outer %123
+               OpReturnValue %124
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %133
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -240,23 +240,23 @@
                OpLoopMerge %143 %141 None
                OpBranch %140
         %140 = OpLabel
-        %146 = OpUGreaterThanEqual %bool %144 %uint_4
-               OpSelectionMerge %147 None
-               OpBranchConditional %146 %148 %147
-        %148 = OpLabel
+        %147 = OpUGreaterThanEqual %bool %144 %uint_4
+               OpSelectionMerge %148 None
+               OpBranchConditional %147 %149 %148
+        %149 = OpLabel
                OpBranch %143
-        %147 = OpLabel
-        %149 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
-        %150 = OpLoad %Inner_std140 %149 None
-        %151 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
-               OpStore %151 %150 None
+        %148 = OpLabel
+        %150 = OpAccessChain %_ptr_Function_Inner_std140 %135 %144
+        %151 = OpLoad %Inner_std140 %150 None
+        %152 = OpAccessChain %_ptr_Function_Inner_std140 %137 %144
+               OpStore %152 %151 None
                OpBranch %141
         %141 = OpLabel
         %145 = OpIAdd %uint %144 %uint_1
                OpBranch %142
         %143 = OpLabel
-        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
-               OpReturnValue %152
+        %146 = OpLoad %_arr_Inner_std140_uint_4_0 %137 None
+               OpReturnValue %146
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %154
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -280,22 +280,22 @@
                OpLoopMerge %170 %168 None
                OpBranch %167
         %167 = OpLabel
-        %173 = OpUGreaterThanEqual %bool %171 %uint_4
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
+        %174 = OpUGreaterThanEqual %bool %171 %uint_4
+               OpSelectionMerge %175 None
+               OpBranchConditional %174 %176 %175
+        %176 = OpLabel
                OpBranch %170
-        %174 = OpLabel
-        %176 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
-        %178 = OpLoad %Outer_std140_tint_explicit_layout %176 None
-        %179 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %178
-        %180 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
-               OpStore %180 %179 None
+        %175 = OpLabel
+        %177 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %162 %171
+        %179 = OpLoad %Outer_std140_tint_explicit_layout %177 None
+        %180 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %179
+        %181 = OpAccessChain %_ptr_Function_Outer_std140 %164 %171
+               OpStore %181 %180 None
                OpBranch %168
         %168 = OpLabel
         %172 = OpIAdd %uint %171 %uint_1
                OpBranch %169
         %170 = OpLabel
-        %181 = OpLoad %_arr_Outer_std140_uint_4 %164 None
-               OpReturnValue %181
+        %173 = OpLoad %_arr_Outer_std140_uint_4 %164 None
+               OpReturnValue %173
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.spvasm
index fac1b42..58463a4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.spvasm
@@ -72,13 +72,13 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
+     %uint_1 = OpConstant %uint 1
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %94 = OpTypeFunction %S %S_std140
         %103 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -124,43 +124,43 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %85 None
+               OpBranchConditional %83 %86 %85
+         %86 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %85 = OpLabel
+         %87 = OpAccessChain %_ptr_Function_S %47 %55
+         %89 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %91 = OpLoad %S_std140 %89 None
+         %92 = OpFunctionCall %S %tint_convert_S %91
+               OpStore %87 %92 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v4half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v4half %80 None
-         %82 = OpCompositeConstruct %mat2v4half %79 %81
-         %83 = OpFunctionCall %void %c %82
-         %84 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %85 = OpLoad %v4half %84 None
-         %86 = OpVectorShuffle %v4half %85 %85 1 3 0 2
-         %87 = OpFunctionCall %void %d %86
-         %88 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %89 = OpLoad %v4half %88 None
-         %90 = OpVectorShuffle %v4half %89 %89 1 3 0 2
-         %91 = OpCompositeExtract %half %90 0
-         %92 = OpFunctionCall %void %e %91
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v4half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v4half %70 None
+         %72 = OpCompositeConstruct %mat2v4half %69 %71
+         %73 = OpFunctionCall %void %c %72
+         %74 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v4half %74 None
+         %76 = OpVectorShuffle %v4half %75 %75 1 3 0 2
+         %77 = OpFunctionCall %void %d %76
+         %78 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %79 = OpLoad %v4half %78 None
+         %80 = OpVectorShuffle %v4half %79 %79 1 3 0 2
+         %81 = OpCompositeExtract %half %80 0
+         %82 = OpFunctionCall %void %e %81
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %94
@@ -188,21 +188,21 @@
                OpLoopMerge %113 %111 None
                OpBranch %110
         %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
+        %117 = OpUGreaterThanEqual %bool %114 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %117 %119 %118
+        %119 = OpLabel
                OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_S_std140 %105 %114
-        %120 = OpLoad %S_std140 %119 None
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %114
-               OpStore %121 %120 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_S_std140 %105 %114
+        %121 = OpLoad %S_std140 %120 None
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %114
+               OpStore %122 %121 None
                OpBranch %111
         %111 = OpLabel
         %115 = OpIAdd %uint %114 %uint_1
                OpBranch %112
         %113 = OpLabel
-        %122 = OpLoad %_arr_S_std140_uint_4_0 %107 None
-               OpReturnValue %122
+        %116 = OpLoad %_arr_S_std140_uint_4_0 %107 None
+               OpReturnValue %116
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.spvasm
index a2526e0..a98e2f4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.spvasm
@@ -60,17 +60,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat2v4half = OpTypePointer Private %mat2v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_Private_v4half = OpTypePointer Private %v4half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %74 = OpTypeFunction %S %S_std140
          %83 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -91,41 +91,41 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %63 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %65 None
+               OpBranchConditional %63 %66 %65
+         %66 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %65 = OpLabel
+         %67 = OpAccessChain %_ptr_Function_S %30 %37
+         %69 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %71 = OpLoad %S_std140 %69 None
+         %72 = OpFunctionCall %S %tint_convert_S %71
+               OpStore %67 %72 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat2v4half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v4half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v4half %65 None
-         %67 = OpCompositeConstruct %mat2v4half %64 %66
-               OpStore %59 %67 None
-         %68 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %71 = OpLoad %v4half %70 None
-         %72 = OpVectorShuffle %v4half %71 %71 1 3 0 2
-               OpStore %68 %72 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat2v4half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v4half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v4half %55 None
+         %57 = OpCompositeConstruct %mat2v4half %54 %56
+               OpStore %49 %57 None
+         %58 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_1 %uint_0
+         %60 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %61 = OpLoad %v4half %60 None
+         %62 = OpVectorShuffle %v4half %61 %61 1 3 0 2
+               OpStore %58 %62 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %74
@@ -153,21 +153,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S_std140 %85 %94
-        %100 = OpLoad %S_std140 %99 None
-        %101 = OpAccessChain %_ptr_Function_S_std140 %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S_std140 %85 %94
+        %101 = OpLoad %S_std140 %100 None
+        %102 = OpAccessChain %_ptr_Function_S_std140 %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_std140_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_std140_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.spvasm
index e092ce9..839c5dc 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.spvasm
@@ -84,17 +84,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat2v4half = OpTypePointer StorageBuffer %mat2v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %81 = OpTypeFunction %void %_arr_S_uint_4
         %100 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -118,41 +118,41 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %70 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %73 %72
+         %73 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %72 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_S %30 %40
+         %76 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %78 = OpLoad %S_std140 %76 None
+         %79 = OpFunctionCall %S %tint_convert_S %78
+               OpStore %74 %79 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat2v4half %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v4half %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v4half %72 None
-         %74 = OpCompositeConstruct %mat2v4half %71 %73
-               OpStore %66 %74 None
-         %75 = OpAccessChain %_ptr_StorageBuffer_v4half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %77 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %78 = OpLoad %v4half %77 None
-         %79 = OpVectorShuffle %v4half %78 %78 1 3 0 2
-               OpStore %75 %79 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat2v4half %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v4half %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v4half %62 None
+         %64 = OpCompositeConstruct %mat2v4half %61 %63
+               OpStore %56 %64 None
+         %65 = OpAccessChain %_ptr_StorageBuffer_v4half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %68 = OpLoad %v4half %67 None
+         %69 = OpVectorShuffle %v4half %68 %68 1 3 0 2
+               OpStore %65 %69 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %81
@@ -226,21 +226,21 @@
                OpLoopMerge %130 %128 None
                OpBranch %127
         %127 = OpLabel
-        %133 = OpUGreaterThanEqual %bool %131 %uint_4
-               OpSelectionMerge %134 None
-               OpBranchConditional %133 %135 %134
-        %135 = OpLabel
+        %134 = OpUGreaterThanEqual %bool %131 %uint_4
+               OpSelectionMerge %135 None
+               OpBranchConditional %134 %136 %135
+        %136 = OpLabel
                OpBranch %130
-        %134 = OpLabel
-        %136 = OpAccessChain %_ptr_Function_S_std140 %122 %131
-        %137 = OpLoad %S_std140 %136 None
-        %138 = OpAccessChain %_ptr_Function_S_std140 %124 %131
-               OpStore %138 %137 None
+        %135 = OpLabel
+        %137 = OpAccessChain %_ptr_Function_S_std140 %122 %131
+        %138 = OpLoad %S_std140 %137 None
+        %139 = OpAccessChain %_ptr_Function_S_std140 %124 %131
+               OpStore %139 %138 None
                OpBranch %128
         %128 = OpLabel
         %132 = OpIAdd %uint %131 %uint_1
                OpBranch %129
         %130 = OpLabel
-        %139 = OpLoad %_arr_S_std140_uint_4_0 %124 None
-               OpReturnValue %139
+        %133 = OpLoad %_arr_S_std140_uint_4_0 %124 None
+               OpReturnValue %133
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
index abaca8a..b6f85ca 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -60,10 +60,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -71,14 +67,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat2v4half = OpTypePointer Workgroup %mat2v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
+       %bool = OpTypeBool
+         %80 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %91 = OpTypeFunction %void
          %96 = OpTypeFunction %S %S_std140
         %105 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -87,8 +87,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -97,67 +97,67 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %75 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %78 %77
+         %78 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %77 = OpLabel
+         %79 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %79 %80 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat2v4half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v4half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v4half %82 None
-         %84 = OpCompositeConstruct %mat2v4half %81 %83
-               OpStore %76 %84 None
-         %85 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_1 %uint_0
-         %87 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v4half %87 None
-         %89 = OpVectorShuffle %v4half %88 %88 1 3 0 2
-               OpStore %85 %89 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %81 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %81 %83 %82
+         %83 = OpLabel
+               OpBranch %49
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %42 %50
+         %86 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %88 = OpLoad %S_std140 %86 None
+         %89 = OpFunctionCall %S %tint_convert_S %88
+               OpStore %84 %89 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat2v4half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v4half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v4half %67 None
+         %69 = OpCompositeConstruct %mat2v4half %66 %68
+               OpStore %61 %69 None
+         %70 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_1 %uint_0
+         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %73 = OpLoad %v4half %72 None
+         %74 = OpVectorShuffle %v4half %73 %73 1 3 0 2
+               OpStore %70 %74 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %91
@@ -191,21 +191,21 @@
                OpLoopMerge %115 %113 None
                OpBranch %112
         %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
+        %119 = OpUGreaterThanEqual %bool %116 %uint_4
+               OpSelectionMerge %120 None
+               OpBranchConditional %119 %121 %120
+        %121 = OpLabel
                OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_S_std140 %107 %116
-        %122 = OpLoad %S_std140 %121 None
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %116
-               OpStore %123 %122 None
+        %120 = OpLabel
+        %122 = OpAccessChain %_ptr_Function_S_std140 %107 %116
+        %123 = OpLoad %S_std140 %122 None
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %116
+               OpStore %124 %123 None
                OpBranch %113
         %113 = OpLabel
         %117 = OpIAdd %uint %116 %uint_1
                OpBranch %114
         %115 = OpLabel
-        %124 = OpLoad %_arr_S_std140_uint_4_0 %109 None
-               OpReturnValue %124
+        %118 = OpLoad %_arr_S_std140_uint_4_0 %109 None
+               OpReturnValue %118
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index c0ea4c2..9c21d4f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -150,23 +150,23 @@
                OpLoopMerge %86 %84 None
                OpBranch %83
          %83 = OpLabel
-         %89 = OpUGreaterThanEqual %bool %87 %uint_4
-               OpSelectionMerge %91 None
-               OpBranchConditional %89 %92 %91
-         %92 = OpLabel
+         %90 = OpUGreaterThanEqual %bool %87 %uint_4
+               OpSelectionMerge %92 None
+               OpBranchConditional %90 %93 %92
+         %93 = OpLabel
                OpBranch %86
-         %91 = OpLabel
-         %93 = OpAccessChain %_ptr_Function_Inner %77 %87
-         %95 = OpLoad %Inner %93 None
-         %96 = OpAccessChain %_ptr_Function_Inner %79 %87
-               OpStore %96 %95 None
+         %92 = OpLabel
+         %94 = OpAccessChain %_ptr_Function_Inner %77 %87
+         %96 = OpLoad %Inner %94 None
+         %97 = OpAccessChain %_ptr_Function_Inner %79 %87
+               OpStore %97 %96 None
                OpBranch %84
          %84 = OpLabel
          %88 = OpIAdd %uint %87 %uint_1
                OpBranch %85
          %86 = OpLabel
-         %97 = OpLoad %_arr_Inner_uint_4_0 %79 None
-               OpReturnValue %97
+         %89 = OpLoad %_arr_Inner_uint_4_0 %79 None
+               OpReturnValue %89
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer None %99
 %tint_source_0 = OpFunctionParameter %Outer_tint_explicit_layout
@@ -190,22 +190,22 @@
                OpLoopMerge %116 %114 None
                OpBranch %113
         %113 = OpLabel
-        %119 = OpUGreaterThanEqual %bool %117 %uint_4
-               OpSelectionMerge %120 None
-               OpBranchConditional %119 %121 %120
-        %121 = OpLabel
+        %120 = OpUGreaterThanEqual %bool %117 %uint_4
+               OpSelectionMerge %121 None
+               OpBranchConditional %120 %122 %121
+        %122 = OpLabel
                OpBranch %116
-        %120 = OpLabel
-        %122 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %107 %117
-        %124 = OpLoad %Outer_tint_explicit_layout %122 None
-        %125 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %124
-        %126 = OpAccessChain %_ptr_Function_Outer %109 %117
-               OpStore %126 %125 None
+        %121 = OpLabel
+        %123 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %107 %117
+        %125 = OpLoad %Outer_tint_explicit_layout %123 None
+        %126 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %125
+        %127 = OpAccessChain %_ptr_Function_Outer %109 %117
+               OpStore %127 %126 None
                OpBranch %114
         %114 = OpLabel
         %118 = OpIAdd %uint %117 %uint_1
                OpBranch %115
         %116 = OpLabel
-        %128 = OpLoad %_arr_Outer_uint_4 %109 None
-               OpReturnValue %128
+        %119 = OpLoad %_arr_Outer_uint_4 %109 None
+               OpReturnValue %119
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm
index 7ea7a64..d2fc1ed 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -122,23 +122,23 @@
                OpLoopMerge %63 %61 None
                OpBranch %60
          %60 = OpLabel
-         %66 = OpUGreaterThanEqual %bool %64 %uint_4
-               OpSelectionMerge %68 None
-               OpBranchConditional %66 %69 %68
-         %69 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %64 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %63
-         %68 = OpLabel
-         %70 = OpAccessChain %_ptr_Function_Inner %54 %64
-         %72 = OpLoad %Inner %70 None
-         %73 = OpAccessChain %_ptr_Function_Inner %56 %64
-               OpStore %73 %72 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_Inner %54 %64
+         %73 = OpLoad %Inner %71 None
+         %74 = OpAccessChain %_ptr_Function_Inner %56 %64
+               OpStore %74 %73 None
                OpBranch %61
          %61 = OpLabel
          %65 = OpIAdd %uint %64 %uint_1
                OpBranch %62
          %63 = OpLabel
-         %74 = OpLoad %_arr_Inner_uint_4_0 %56 None
-               OpReturnValue %74
+         %66 = OpLoad %_arr_Inner_uint_4_0 %56 None
+               OpReturnValue %66
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer None %76
 %tint_source_0 = OpFunctionParameter %Outer_tint_explicit_layout
@@ -162,22 +162,22 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %84 %94
-        %101 = OpLoad %Outer_tint_explicit_layout %99 None
-        %102 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %101
-        %103 = OpAccessChain %_ptr_Function_Outer %86 %94
-               OpStore %103 %102 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %84 %94
+        %102 = OpLoad %Outer_tint_explicit_layout %100 None
+        %103 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %102
+        %104 = OpAccessChain %_ptr_Function_Outer %86 %94
+               OpStore %104 %103 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %105 = OpLoad %_arr_Outer_uint_4 %86 None
-               OpReturnValue %105
+         %96 = OpLoad %_arr_Outer_uint_4 %86 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.spvasm
index dcf1209..e6f0da6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.spvasm
@@ -131,21 +131,21 @@
                OpLoopMerge %76 %74 None
                OpBranch %73
          %73 = OpLabel
-         %79 = OpUGreaterThanEqual %bool %77 %uint_4
-               OpSelectionMerge %81 None
-               OpBranchConditional %79 %82 %81
-         %82 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %80 %83 %82
+         %83 = OpLabel
                OpBranch %76
-         %81 = OpLabel
-         %83 = OpAccessChain %_ptr_Function_S %67 %77
-         %85 = OpLoad %S %83 None
-         %86 = OpAccessChain %_ptr_Function_S %69 %77
-               OpStore %86 %85 None
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %67 %77
+         %86 = OpLoad %S %84 None
+         %87 = OpAccessChain %_ptr_Function_S %69 %77
+               OpStore %87 %86 None
                OpBranch %74
          %74 = OpLabel
          %78 = OpIAdd %uint %77 %uint_1
                OpBranch %75
          %76 = OpLabel
-         %87 = OpLoad %_arr_S_uint_4_0 %69 None
-               OpReturnValue %87
+         %79 = OpLoad %_arr_S_uint_4_0 %69 None
+               OpReturnValue %79
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.spvasm
index 29753c7..cb538a7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.spvasm
@@ -115,22 +115,22 @@
                OpLoopMerge %66 %64 None
                OpBranch %63
          %63 = OpLabel
-         %69 = OpUGreaterThanEqual %bool %67 %uint_4
-               OpSelectionMerge %71 None
-               OpBranchConditional %69 %72 %71
-         %72 = OpLabel
+         %70 = OpUGreaterThanEqual %bool %67 %uint_4
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %73 %72
+         %73 = OpLabel
                OpBranch %66
-         %71 = OpLabel
-         %73 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %58 %67
-         %75 = OpLoad %S_tint_explicit_layout %73 None
-         %76 = OpFunctionCall %S %tint_convert_explicit_layout %75
-         %77 = OpAccessChain %_ptr_Function_S %60 %67
-               OpStore %77 %76 None
+         %72 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %58 %67
+         %76 = OpLoad %S_tint_explicit_layout %74 None
+         %77 = OpFunctionCall %S %tint_convert_explicit_layout %76
+         %78 = OpAccessChain %_ptr_Function_S %60 %67
+               OpStore %78 %77 None
                OpBranch %64
          %64 = OpLabel
          %68 = OpIAdd %uint %67 %uint_1
                OpBranch %65
          %66 = OpLabel
-         %79 = OpLoad %_arr_S_uint_4 %60 None
-               OpReturnValue %79
+         %69 = OpLoad %_arr_S_uint_4 %60 None
+               OpReturnValue %69
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.spvasm
index f9b0530..01517ba 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.spvasm
@@ -157,21 +157,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S %85 %94
-        %100 = OpLoad %S %99 None
-        %101 = OpAccessChain %_ptr_Function_S %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S %85 %94
+        %101 = OpLoad %S %100 None
+        %102 = OpAccessChain %_ptr_Function_S %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
index 76f0837..7604ecb 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -57,20 +57,20 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 = OpTypePointer Uniform %_arr_S_tint_explicit_layout_uint_4
      %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_tint_explicit_layout = OpTypePointer Uniform %S_tint_explicit_layout
 %_ptr_Workgroup_mat2v4float = OpTypePointer Workgroup %mat2v4float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_mat2v4float = OpTypePointer Uniform %mat2v4float
 %_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+       %bool = OpTypeBool
+         %64 = OpConstantNull %S
          %66 = OpTypeFunction %void
          %71 = OpTypeFunction %S %S_tint_explicit_layout
          %78 = OpTypeFunction %_arr_S_uint_4 %_arr_S_tint_explicit_layout_uint_4
@@ -90,38 +90,38 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %59 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %61
+         %62 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %61 = OpLabel
+         %63 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %63 %64 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_tint_explicit_layout_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_uint_4 %tint_convert_explicit_layout_0 %44
-               OpStore %w %45 None
-         %47 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_S_tint_explicit_layout %1 %uint_0 %uint_2
-         %50 = OpLoad %S_tint_explicit_layout %48 None
-         %51 = OpFunctionCall %S %tint_convert_explicit_layout %50
-               OpStore %47 %51 None
-         %53 = OpAccessChain %_ptr_Workgroup_mat2v4float %w %uint_3 %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_mat2v4float %1 %uint_0 %uint_2 %uint_1
-         %58 = OpLoad %mat2v4float %56 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_tint_explicit_layout_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_uint_4 %tint_convert_explicit_layout_0 %36
+               OpStore %w %37 None
+         %39 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_S_tint_explicit_layout %1 %uint_0 %uint_2
+         %44 = OpLoad %S_tint_explicit_layout %42 None
+         %45 = OpFunctionCall %S %tint_convert_explicit_layout %44
+               OpStore %39 %45 None
+         %47 = OpAccessChain %_ptr_Workgroup_mat2v4float %w %uint_3 %uint_1
+         %50 = OpAccessChain %_ptr_Uniform_mat2v4float %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %mat2v4float %50 None
+               OpStore %47 %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_1 %uint_0
+         %55 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1 %uint_1
+         %57 = OpLoad %v4float %55 None
+         %58 = OpVectorShuffle %v4float %57 %57 1 3 0 2
                OpStore %53 %58 None
-         %59 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_1 %uint_0
-         %61 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1 %uint_1
-         %63 = OpLoad %v4float %61 None
-         %64 = OpVectorShuffle %v4float %63 %63 1 3 0 2
-               OpStore %59 %64 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %66
@@ -153,22 +153,22 @@
                OpLoopMerge %89 %87 None
                OpBranch %86
          %86 = OpLabel
-         %92 = OpUGreaterThanEqual %bool %90 %uint_4
-               OpSelectionMerge %93 None
-               OpBranchConditional %92 %94 %93
-         %94 = OpLabel
+         %93 = OpUGreaterThanEqual %bool %90 %uint_4
+               OpSelectionMerge %94 None
+               OpBranchConditional %93 %95 %94
+         %95 = OpLabel
                OpBranch %89
-         %93 = OpLabel
-         %95 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %80 %90
-         %97 = OpLoad %S_tint_explicit_layout %95 None
-         %98 = OpFunctionCall %S %tint_convert_explicit_layout %97
-         %99 = OpAccessChain %_ptr_Function_S %82 %90
-               OpStore %99 %98 None
+         %94 = OpLabel
+         %96 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %80 %90
+         %98 = OpLoad %S_tint_explicit_layout %96 None
+         %99 = OpFunctionCall %S %tint_convert_explicit_layout %98
+        %100 = OpAccessChain %_ptr_Function_S %82 %90
+               OpStore %100 %99 None
                OpBranch %87
          %87 = OpLabel
          %91 = OpIAdd %uint %90 %uint_1
                OpBranch %88
          %89 = OpLabel
-        %101 = OpLoad %_arr_S_uint_4 %82 None
-               OpReturnValue %101
+         %92 = OpLoad %_arr_S_uint_4 %82 None
+               OpReturnValue %92
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 327ab67..dad729a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -97,12 +97,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %77 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %98 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %108 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %134 = OpTypeFunction %Inner %Inner_std140
@@ -128,8 +128,8 @@
          %55 = OpVariable %_ptr_Function_mat3v2half Function
          %69 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %71 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %77
-        %104 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %106 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+         %94 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %96 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -164,60 +164,60 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %87 None
-               OpBranchConditional %85 %88 %87
-         %88 = OpLabel
+        %114 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %116 None
+               OpBranchConditional %114 %117 %116
+        %117 = OpLabel
                OpBranch %82
-         %87 = OpLabel
-         %89 = OpAccessChain %_ptr_Function_Outer %71 %83
-         %91 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
-         %93 = OpLoad %Outer_std140 %91 None
-         %94 = OpFunctionCall %Outer %tint_convert_Outer %93
-               OpStore %89 %94 None
+        %116 = OpLabel
+        %118 = OpAccessChain %_ptr_Function_Outer %71 %83
+        %120 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
+        %122 = OpLoad %Outer_std140 %120 None
+        %123 = OpFunctionCall %Outer %tint_convert_Outer %122
+               OpStore %118 %123 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %71 None
-         %97 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %98 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %97
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %98
-        %101 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %102 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %101
-               OpStore %104 %102
-               OpBranch %109
-        %109 = OpLabel
-               OpBranch %112
-        %112 = OpLabel
-        %114 = OpPhi %uint %uint_0 %109 %115 %111
-               OpLoopMerge %113 %111 None
-               OpBranch %110
-        %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
-               OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_Inner %106 %114
-        %121 = OpAccessChain %_ptr_Function_Inner_std140 %104 %114
-        %123 = OpLoad %Inner_std140 %121 None
-        %124 = OpFunctionCall %Inner %tint_convert_Inner %123
-               OpStore %119 %124 None
-               OpBranch %111
-        %111 = OpLabel
-        %115 = OpIAdd %uint %114 %uint_1
-               OpBranch %112
-        %113 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %106 None
-        %127 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %127
-        %129 = OpFunctionCall %int %i
-        %130 = OpBitcast %uint %129
-        %131 = OpExtInst %uint %33 UMin %130 %uint_1
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %131
+         %86 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %87 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %86
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %87
+         %91 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %92 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %91
+               OpStore %94 %92
+               OpBranch %99
+         %99 = OpLabel
+               OpBranch %102
+        %102 = OpLabel
+        %104 = OpPhi %uint %uint_0 %99 %105 %101
+               OpLoopMerge %103 %101 None
+               OpBranch %100
+        %100 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %104 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
+               OpBranch %103
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_Inner %96 %104
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %94 %104
+        %131 = OpLoad %Inner_std140 %129 None
+        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
+               OpStore %127 %132 None
+               OpBranch %101
+        %101 = OpLabel
+        %105 = OpIAdd %uint %104 %uint_1
+               OpBranch %102
+        %103 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %96 None
+        %107 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %107
+        %110 = OpFunctionCall %int %i
+        %111 = OpBitcast %uint %110
+        %112 = OpExtInst %uint %33 UMin %111 %uint_1
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %112
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %134
@@ -234,7 +234,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %143 = OpLabel
         %145 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
         %144 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %145 %144
                OpBranch %147
@@ -245,25 +245,25 @@
                OpLoopMerge %151 %149 None
                OpBranch %148
         %148 = OpLabel
-        %154 = OpUGreaterThanEqual %bool %152 %uint_4
-               OpSelectionMerge %155 None
-               OpBranchConditional %154 %156 %155
-        %156 = OpLabel
+        %156 = OpUGreaterThanEqual %bool %152 %uint_4
+               OpSelectionMerge %157 None
+               OpBranchConditional %156 %158 %157
+        %158 = OpLabel
                OpBranch %151
-        %155 = OpLabel
-        %157 = OpAccessChain %_ptr_Function_Inner %146 %152
-        %158 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
-        %159 = OpLoad %Inner_std140 %158 None
-        %160 = OpFunctionCall %Inner %tint_convert_Inner %159
-               OpStore %157 %160 None
+        %157 = OpLabel
+        %159 = OpAccessChain %_ptr_Function_Inner %146 %152
+        %160 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
+        %161 = OpLoad %Inner_std140 %160 None
+        %162 = OpFunctionCall %Inner %tint_convert_Inner %161
+               OpStore %159 %162 None
                OpBranch %149
         %149 = OpLabel
         %153 = OpIAdd %uint %152 %uint_1
                OpBranch %150
         %151 = OpLabel
-        %161 = OpLoad %_arr_Inner_uint_4 %146 None
-        %162 = OpCompositeConstruct %Outer %161
-               OpReturnValue %162
+        %154 = OpLoad %_arr_Inner_uint_4 %146 None
+        %155 = OpCompositeConstruct %Outer %154
+               OpReturnValue %155
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %164
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -279,23 +279,23 @@
                OpLoopMerge %174 %172 None
                OpBranch %171
         %171 = OpLabel
-        %177 = OpUGreaterThanEqual %bool %175 %uint_4
-               OpSelectionMerge %178 None
-               OpBranchConditional %177 %179 %178
-        %179 = OpLabel
+        %178 = OpUGreaterThanEqual %bool %175 %uint_4
+               OpSelectionMerge %179 None
+               OpBranchConditional %178 %180 %179
+        %180 = OpLabel
                OpBranch %174
-        %178 = OpLabel
-        %180 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
-        %181 = OpLoad %Inner_std140 %180 None
-        %182 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
-               OpStore %182 %181 None
+        %179 = OpLabel
+        %181 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
+        %182 = OpLoad %Inner_std140 %181 None
+        %183 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
+               OpStore %183 %182 None
                OpBranch %172
         %172 = OpLabel
         %176 = OpIAdd %uint %175 %uint_1
                OpBranch %173
         %174 = OpLabel
-        %183 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
-               OpReturnValue %183
+        %177 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
+               OpReturnValue %177
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %185
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -319,22 +319,22 @@
                OpLoopMerge %201 %199 None
                OpBranch %198
         %198 = OpLabel
-        %204 = OpUGreaterThanEqual %bool %202 %uint_4
-               OpSelectionMerge %205 None
-               OpBranchConditional %204 %206 %205
-        %206 = OpLabel
+        %205 = OpUGreaterThanEqual %bool %202 %uint_4
+               OpSelectionMerge %206 None
+               OpBranchConditional %205 %207 %206
+        %207 = OpLabel
                OpBranch %201
-        %205 = OpLabel
-        %207 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
-        %209 = OpLoad %Outer_std140_tint_explicit_layout %207 None
-        %210 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %209
-        %211 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
-               OpStore %211 %210 None
+        %206 = OpLabel
+        %208 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
+        %210 = OpLoad %Outer_std140_tint_explicit_layout %208 None
+        %211 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %210
+        %212 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
+               OpStore %212 %211 None
                OpBranch %199
         %199 = OpLabel
         %203 = OpIAdd %uint %202 %uint_1
                OpBranch %200
         %201 = OpLabel
-        %212 = OpLoad %_arr_Outer_std140_uint_4 %195 None
-               OpReturnValue %212
+        %204 = OpLoad %_arr_Outer_std140_uint_4 %195 None
+               OpReturnValue %204
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.spvasm
index 43931d0..406de26 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -86,12 +86,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %52 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %73 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %83 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %106 = OpTypeFunction %Inner %Inner_std140
@@ -108,8 +108,8 @@
          %15 = OpLabel
          %44 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %46 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %52
-         %79 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %81 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+         %69 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %71 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -133,56 +133,56 @@
                OpLoopMerge %57 %55 None
                OpBranch %54
          %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %62 None
-               OpBranchConditional %60 %63 %62
-         %63 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %58 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %57
-         %62 = OpLabel
-         %64 = OpAccessChain %_ptr_Function_Outer %46 %58
-         %66 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
-         %68 = OpLoad %Outer_std140 %66 None
-         %69 = OpFunctionCall %Outer %tint_convert_Outer %68
-               OpStore %64 %69 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_Outer %46 %58
+         %92 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
+         %94 = OpLoad %Outer_std140 %92 None
+         %95 = OpFunctionCall %Outer %tint_convert_Outer %94
+               OpStore %90 %95 None
                OpBranch %55
          %55 = OpLabel
          %59 = OpIAdd %uint %58 %uint_1
                OpBranch %56
          %57 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %46 None
-         %72 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %73 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %72
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %73
-         %76 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %77 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %76
-               OpStore %79 %77
-               OpBranch %84
-         %84 = OpLabel
-               OpBranch %87
-         %87 = OpLabel
-         %89 = OpPhi %uint %uint_0 %84 %90 %86
-               OpLoopMerge %88 %86 None
-               OpBranch %85
-         %85 = OpLabel
-         %91 = OpUGreaterThanEqual %bool %89 %uint_4
-               OpSelectionMerge %92 None
-               OpBranchConditional %91 %93 %92
-         %93 = OpLabel
-               OpBranch %88
-         %92 = OpLabel
-         %94 = OpAccessChain %_ptr_Function_Inner %81 %89
-         %96 = OpAccessChain %_ptr_Function_Inner_std140 %79 %89
-         %98 = OpLoad %Inner_std140 %96 None
-         %99 = OpFunctionCall %Inner %tint_convert_Inner %98
-               OpStore %94 %99 None
-               OpBranch %86
-         %86 = OpLabel
-         %90 = OpIAdd %uint %89 %uint_1
-               OpBranch %87
-         %88 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %81 None
-        %102 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %102
+         %61 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %62 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %61
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %62
+         %66 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %67 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %66
+               OpStore %69 %67
+               OpBranch %74
+         %74 = OpLabel
+               OpBranch %77
+         %77 = OpLabel
+         %79 = OpPhi %uint %uint_0 %74 %80 %76
+               OpLoopMerge %78 %76 None
+               OpBranch %75
+         %75 = OpLabel
+         %96 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %97 None
+               OpBranchConditional %96 %98 %97
+         %98 = OpLabel
+               OpBranch %78
+         %97 = OpLabel
+         %99 = OpAccessChain %_ptr_Function_Inner %71 %79
+        %101 = OpAccessChain %_ptr_Function_Inner_std140 %69 %79
+        %103 = OpLoad %Inner_std140 %101 None
+        %104 = OpFunctionCall %Inner %tint_convert_Inner %103
+               OpStore %99 %104 None
+               OpBranch %76
+         %76 = OpLabel
+         %80 = OpIAdd %uint %79 %uint_1
+               OpBranch %77
+         %78 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %71 None
+         %82 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %82
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -200,7 +200,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %115 = OpLabel
         %117 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
         %116 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %117 %116
                OpBranch %119
@@ -211,25 +211,25 @@
                OpLoopMerge %123 %121 None
                OpBranch %120
         %120 = OpLabel
-        %126 = OpUGreaterThanEqual %bool %124 %uint_4
-               OpSelectionMerge %127 None
-               OpBranchConditional %126 %128 %127
-        %128 = OpLabel
+        %128 = OpUGreaterThanEqual %bool %124 %uint_4
+               OpSelectionMerge %129 None
+               OpBranchConditional %128 %130 %129
+        %130 = OpLabel
                OpBranch %123
-        %127 = OpLabel
-        %129 = OpAccessChain %_ptr_Function_Inner %118 %124
-        %130 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
-        %131 = OpLoad %Inner_std140 %130 None
-        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
-               OpStore %129 %132 None
+        %129 = OpLabel
+        %131 = OpAccessChain %_ptr_Function_Inner %118 %124
+        %132 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
+        %133 = OpLoad %Inner_std140 %132 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %131 %134 None
                OpBranch %121
         %121 = OpLabel
         %125 = OpIAdd %uint %124 %uint_1
                OpBranch %122
         %123 = OpLabel
-        %133 = OpLoad %_arr_Inner_uint_4 %118 None
-        %134 = OpCompositeConstruct %Outer %133
-               OpReturnValue %134
+        %126 = OpLoad %_arr_Inner_uint_4 %118 None
+        %127 = OpCompositeConstruct %Outer %126
+               OpReturnValue %127
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %136
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -245,23 +245,23 @@
                OpLoopMerge %146 %144 None
                OpBranch %143
         %143 = OpLabel
-        %149 = OpUGreaterThanEqual %bool %147 %uint_4
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
+        %150 = OpUGreaterThanEqual %bool %147 %uint_4
+               OpSelectionMerge %151 None
+               OpBranchConditional %150 %152 %151
+        %152 = OpLabel
                OpBranch %146
-        %150 = OpLabel
-        %152 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
-        %153 = OpLoad %Inner_std140 %152 None
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
-               OpStore %154 %153 None
+        %151 = OpLabel
+        %153 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
+        %154 = OpLoad %Inner_std140 %153 None
+        %155 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
+               OpStore %155 %154 None
                OpBranch %144
         %144 = OpLabel
         %148 = OpIAdd %uint %147 %uint_1
                OpBranch %145
         %146 = OpLabel
-        %155 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
-               OpReturnValue %155
+        %149 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
+               OpReturnValue %149
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %157
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -285,22 +285,22 @@
                OpLoopMerge %173 %171 None
                OpBranch %170
         %170 = OpLabel
-        %176 = OpUGreaterThanEqual %bool %174 %uint_4
-               OpSelectionMerge %177 None
-               OpBranchConditional %176 %178 %177
-        %178 = OpLabel
+        %177 = OpUGreaterThanEqual %bool %174 %uint_4
+               OpSelectionMerge %178 None
+               OpBranchConditional %177 %179 %178
+        %179 = OpLabel
                OpBranch %173
-        %177 = OpLabel
-        %179 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
-        %181 = OpLoad %Outer_std140_tint_explicit_layout %179 None
-        %182 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %181
-        %183 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
-               OpStore %183 %182 None
+        %178 = OpLabel
+        %180 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
+        %182 = OpLoad %Outer_std140_tint_explicit_layout %180 None
+        %183 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %182
+        %184 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
+               OpStore %184 %183 None
                OpBranch %171
         %171 = OpLabel
         %175 = OpIAdd %uint %174 %uint_1
                OpBranch %172
         %173 = OpLabel
-        %184 = OpLoad %_arr_Outer_std140_uint_4 %167 None
-               OpReturnValue %184
+        %176 = OpLoad %_arr_Outer_std140_uint_4 %167 None
+               OpReturnValue %176
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.spvasm
index 08cfab3..734d5de 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.spvasm
@@ -74,14 +74,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %97 = OpTypeFunction %S %S_std140
         %107 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -127,45 +127,45 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_S %47 %55
+         %92 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %94 = OpLoad %S_std140 %92 None
+         %95 = OpFunctionCall %S %tint_convert_S %94
+               OpStore %90 %95 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v2half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v2half %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v2half %82 None
-         %85 = OpCompositeConstruct %mat3v2half %79 %81 %84
-         %86 = OpFunctionCall %void %c %85
-         %87 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v2half %87 None
-         %89 = OpVectorShuffle %v2half %88 %88 1 0
-         %90 = OpFunctionCall %void %d %89
-         %91 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v2half %91 None
-         %93 = OpVectorShuffle %v2half %92 %92 1 0
-         %94 = OpCompositeExtract %half %93 0
-         %95 = OpFunctionCall %void %e %94
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v2half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v2half %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v2half %72 None
+         %75 = OpCompositeConstruct %mat3v2half %69 %71 %74
+         %76 = OpFunctionCall %void %c %75
+         %77 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %78 = OpLoad %v2half %77 None
+         %79 = OpVectorShuffle %v2half %78 %78 1 0
+         %80 = OpFunctionCall %void %d %79
+         %81 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %82 = OpLoad %v2half %81 None
+         %83 = OpVectorShuffle %v2half %82 %82 1 0
+         %84 = OpCompositeExtract %half %83 0
+         %85 = OpFunctionCall %void %e %84
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %97
@@ -194,21 +194,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %118
-        %124 = OpLoad %S_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_S_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %118
+        %125 = OpLoad %S_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_S_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_S_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_S_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.spvasm
index c8c5eab..7dd5389 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.spvasm
@@ -62,17 +62,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat3v2half = OpTypePointer Private %mat3v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_Private_v2half = OpTypePointer Private %v2half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %76 = OpTypeFunction %S %S_std140
          %86 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -93,43 +93,43 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %65 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %67 None
+               OpBranchConditional %65 %68 %67
+         %68 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %67 = OpLabel
+         %69 = OpAccessChain %_ptr_Function_S %30 %37
+         %71 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %73 = OpLoad %S_std140 %71 None
+         %74 = OpFunctionCall %S %tint_convert_S %73
+               OpStore %69 %74 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat3v2half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v2half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v2half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v2half %67 None
-         %69 = OpCompositeConstruct %mat3v2half %64 %66 %68
-               OpStore %59 %69 None
-         %70 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %73 = OpLoad %v2half %72 None
-         %74 = OpVectorShuffle %v2half %73 %73 1 0
-               OpStore %70 %74 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat3v2half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v2half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v2half %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v2half %57 None
+         %59 = OpCompositeConstruct %mat3v2half %54 %56 %58
+               OpStore %49 %59 None
+         %60 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %63 = OpLoad %v2half %62 None
+         %64 = OpVectorShuffle %v2half %63 %63 1 0
+               OpStore %60 %64 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %76
@@ -158,21 +158,21 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_S_std140 %88 %97
-        %103 = OpLoad %S_std140 %102 None
-        %104 = OpAccessChain %_ptr_Function_S_std140 %90 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_S_std140 %88 %97
+        %104 = OpLoad %S_std140 %103 None
+        %105 = OpAccessChain %_ptr_Function_S_std140 %90 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_S_std140_uint_4_0 %90 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_S_std140_uint_4_0 %90 None
+               OpReturnValue %99
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.spvasm
index 9184edb..581de25 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.spvasm
@@ -86,17 +86,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat3v2half = OpTypePointer StorageBuffer %mat3v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %83 = OpTypeFunction %void %_arr_S_uint_4
         %102 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -120,43 +120,43 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %72 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %74 None
+               OpBranchConditional %72 %75 %74
+         %75 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %74 = OpLabel
+         %76 = OpAccessChain %_ptr_Function_S %30 %40
+         %78 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %80 = OpLoad %S_std140 %78 None
+         %81 = OpFunctionCall %S %tint_convert_S %80
+               OpStore %76 %81 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat3v2half %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v2half %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v2half %72 None
-         %74 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %75 = OpLoad %v2half %74 None
-         %76 = OpCompositeConstruct %mat3v2half %71 %73 %75
-               OpStore %66 %76 None
-         %77 = OpAccessChain %_ptr_StorageBuffer_v2half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %80 = OpLoad %v2half %79 None
-         %81 = OpVectorShuffle %v2half %80 %80 1 0
-               OpStore %77 %81 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat3v2half %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v2half %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v2half %62 None
+         %64 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %65 = OpLoad %v2half %64 None
+         %66 = OpCompositeConstruct %mat3v2half %61 %63 %65
+               OpStore %56 %66 None
+         %67 = OpAccessChain %_ptr_StorageBuffer_v2half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %70 = OpLoad %v2half %69 None
+         %71 = OpVectorShuffle %v2half %70 %70 1 0
+               OpStore %67 %71 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %83
@@ -231,21 +231,21 @@
                OpLoopMerge %133 %131 None
                OpBranch %130
         %130 = OpLabel
-        %136 = OpUGreaterThanEqual %bool %134 %uint_4
-               OpSelectionMerge %137 None
-               OpBranchConditional %136 %138 %137
-        %138 = OpLabel
+        %137 = OpUGreaterThanEqual %bool %134 %uint_4
+               OpSelectionMerge %138 None
+               OpBranchConditional %137 %139 %138
+        %139 = OpLabel
                OpBranch %133
-        %137 = OpLabel
-        %139 = OpAccessChain %_ptr_Function_S_std140 %125 %134
-        %140 = OpLoad %S_std140 %139 None
-        %141 = OpAccessChain %_ptr_Function_S_std140 %127 %134
-               OpStore %141 %140 None
+        %138 = OpLabel
+        %140 = OpAccessChain %_ptr_Function_S_std140 %125 %134
+        %141 = OpLoad %S_std140 %140 None
+        %142 = OpAccessChain %_ptr_Function_S_std140 %127 %134
+               OpStore %142 %141 None
                OpBranch %131
         %131 = OpLabel
         %135 = OpIAdd %uint %134 %uint_1
                OpBranch %132
         %133 = OpLabel
-        %142 = OpLoad %_arr_S_std140_uint_4_0 %127 None
-               OpReturnValue %142
+        %136 = OpLoad %_arr_S_std140_uint_4_0 %127 None
+               OpReturnValue %136
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.spvasm
index faad57c..1180138 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.spvasm
@@ -62,10 +62,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -73,14 +69,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat3v2half = OpTypePointer Workgroup %mat3v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half
+       %bool = OpTypeBool
+         %82 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %93 = OpTypeFunction %void
          %98 = OpTypeFunction %S %S_std140
         %108 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -89,8 +89,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -99,69 +99,69 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %81 %82 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat3v2half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v2half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v2half %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v2half %84 None
-         %86 = OpCompositeConstruct %mat3v2half %81 %83 %85
-               OpStore %76 %86 None
-         %87 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_1 %uint_0
-         %89 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v2half %89 None
-         %91 = OpVectorShuffle %v2half %90 %90 1 0
-               OpStore %87 %91 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %49
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_S %42 %50
+         %88 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %90 = OpLoad %S_std140 %88 None
+         %91 = OpFunctionCall %S %tint_convert_S %90
+               OpStore %86 %91 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat3v2half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v2half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v2half %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v2half %69 None
+         %71 = OpCompositeConstruct %mat3v2half %66 %68 %70
+               OpStore %61 %71 None
+         %72 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_1 %uint_0
+         %74 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v2half %74 None
+         %76 = OpVectorShuffle %v2half %75 %75 1 0
+               OpStore %72 %76 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %93
@@ -196,21 +196,21 @@
                OpLoopMerge %118 %116 None
                OpBranch %115
         %115 = OpLabel
-        %121 = OpUGreaterThanEqual %bool %119 %uint_4
-               OpSelectionMerge %122 None
-               OpBranchConditional %121 %123 %122
-        %123 = OpLabel
+        %122 = OpUGreaterThanEqual %bool %119 %uint_4
+               OpSelectionMerge %123 None
+               OpBranchConditional %122 %124 %123
+        %124 = OpLabel
                OpBranch %118
-        %122 = OpLabel
-        %124 = OpAccessChain %_ptr_Function_S_std140 %110 %119
-        %125 = OpLoad %S_std140 %124 None
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %119
-               OpStore %126 %125 None
+        %123 = OpLabel
+        %125 = OpAccessChain %_ptr_Function_S_std140 %110 %119
+        %126 = OpLoad %S_std140 %125 None
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %119
+               OpStore %127 %126 None
                OpBranch %116
         %116 = OpLabel
         %120 = OpIAdd %uint %119 %uint_1
                OpBranch %117
         %118 = OpLabel
-        %127 = OpLoad %_arr_S_std140_uint_4_0 %112 None
-               OpReturnValue %127
+        %121 = OpLoad %_arr_S_std140_uint_4_0 %112 None
+               OpReturnValue %121
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 9252f60..495be83 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -94,12 +94,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %77 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %98 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %108 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %134 = OpTypeFunction %Inner %Inner_std140
@@ -125,8 +125,8 @@
          %55 = OpVariable %_ptr_Function_mat3v2float Function
          %69 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %71 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %77
-        %104 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %106 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+         %94 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %96 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -161,60 +161,60 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %87 None
-               OpBranchConditional %85 %88 %87
-         %88 = OpLabel
+        %114 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %116 None
+               OpBranchConditional %114 %117 %116
+        %117 = OpLabel
                OpBranch %82
-         %87 = OpLabel
-         %89 = OpAccessChain %_ptr_Function_Outer %71 %83
-         %91 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
-         %93 = OpLoad %Outer_std140 %91 None
-         %94 = OpFunctionCall %Outer %tint_convert_Outer %93
-               OpStore %89 %94 None
+        %116 = OpLabel
+        %118 = OpAccessChain %_ptr_Function_Outer %71 %83
+        %120 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
+        %122 = OpLoad %Outer_std140 %120 None
+        %123 = OpFunctionCall %Outer %tint_convert_Outer %122
+               OpStore %118 %123 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %71 None
-         %97 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %98 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %97
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %98
-        %101 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %102 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %101
-               OpStore %104 %102
-               OpBranch %109
-        %109 = OpLabel
-               OpBranch %112
-        %112 = OpLabel
-        %114 = OpPhi %uint %uint_0 %109 %115 %111
-               OpLoopMerge %113 %111 None
-               OpBranch %110
-        %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
-               OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_Inner %106 %114
-        %121 = OpAccessChain %_ptr_Function_Inner_std140 %104 %114
-        %123 = OpLoad %Inner_std140 %121 None
-        %124 = OpFunctionCall %Inner %tint_convert_Inner %123
-               OpStore %119 %124 None
-               OpBranch %111
-        %111 = OpLabel
-        %115 = OpIAdd %uint %114 %uint_1
-               OpBranch %112
-        %113 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %106 None
-        %127 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %127
-        %129 = OpFunctionCall %int %i
-        %130 = OpBitcast %uint %129
-        %131 = OpExtInst %uint %33 UMin %130 %uint_1
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %131
+         %86 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %87 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %86
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %87
+         %91 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %92 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %91
+               OpStore %94 %92
+               OpBranch %99
+         %99 = OpLabel
+               OpBranch %102
+        %102 = OpLabel
+        %104 = OpPhi %uint %uint_0 %99 %105 %101
+               OpLoopMerge %103 %101 None
+               OpBranch %100
+        %100 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %104 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
+               OpBranch %103
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_Inner %96 %104
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %94 %104
+        %131 = OpLoad %Inner_std140 %129 None
+        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
+               OpStore %127 %132 None
+               OpBranch %101
+        %101 = OpLabel
+        %105 = OpIAdd %uint %104 %uint_1
+               OpBranch %102
+        %103 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %96 None
+        %107 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %107
+        %110 = OpFunctionCall %int %i
+        %111 = OpBitcast %uint %110
+        %112 = OpExtInst %uint %33 UMin %111 %uint_1
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %112
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %134
@@ -231,7 +231,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %143 = OpLabel
         %145 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
         %144 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %145 %144
                OpBranch %147
@@ -242,25 +242,25 @@
                OpLoopMerge %151 %149 None
                OpBranch %148
         %148 = OpLabel
-        %154 = OpUGreaterThanEqual %bool %152 %uint_4
-               OpSelectionMerge %155 None
-               OpBranchConditional %154 %156 %155
-        %156 = OpLabel
+        %156 = OpUGreaterThanEqual %bool %152 %uint_4
+               OpSelectionMerge %157 None
+               OpBranchConditional %156 %158 %157
+        %158 = OpLabel
                OpBranch %151
-        %155 = OpLabel
-        %157 = OpAccessChain %_ptr_Function_Inner %146 %152
-        %158 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
-        %159 = OpLoad %Inner_std140 %158 None
-        %160 = OpFunctionCall %Inner %tint_convert_Inner %159
-               OpStore %157 %160 None
+        %157 = OpLabel
+        %159 = OpAccessChain %_ptr_Function_Inner %146 %152
+        %160 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
+        %161 = OpLoad %Inner_std140 %160 None
+        %162 = OpFunctionCall %Inner %tint_convert_Inner %161
+               OpStore %159 %162 None
                OpBranch %149
         %149 = OpLabel
         %153 = OpIAdd %uint %152 %uint_1
                OpBranch %150
         %151 = OpLabel
-        %161 = OpLoad %_arr_Inner_uint_4 %146 None
-        %162 = OpCompositeConstruct %Outer %161
-               OpReturnValue %162
+        %154 = OpLoad %_arr_Inner_uint_4 %146 None
+        %155 = OpCompositeConstruct %Outer %154
+               OpReturnValue %155
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %164
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -276,23 +276,23 @@
                OpLoopMerge %174 %172 None
                OpBranch %171
         %171 = OpLabel
-        %177 = OpUGreaterThanEqual %bool %175 %uint_4
-               OpSelectionMerge %178 None
-               OpBranchConditional %177 %179 %178
-        %179 = OpLabel
+        %178 = OpUGreaterThanEqual %bool %175 %uint_4
+               OpSelectionMerge %179 None
+               OpBranchConditional %178 %180 %179
+        %180 = OpLabel
                OpBranch %174
-        %178 = OpLabel
-        %180 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
-        %181 = OpLoad %Inner_std140 %180 None
-        %182 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
-               OpStore %182 %181 None
+        %179 = OpLabel
+        %181 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
+        %182 = OpLoad %Inner_std140 %181 None
+        %183 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
+               OpStore %183 %182 None
                OpBranch %172
         %172 = OpLabel
         %176 = OpIAdd %uint %175 %uint_1
                OpBranch %173
         %174 = OpLabel
-        %183 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
-               OpReturnValue %183
+        %177 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
+               OpReturnValue %177
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %185
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -316,22 +316,22 @@
                OpLoopMerge %201 %199 None
                OpBranch %198
         %198 = OpLabel
-        %204 = OpUGreaterThanEqual %bool %202 %uint_4
-               OpSelectionMerge %205 None
-               OpBranchConditional %204 %206 %205
-        %206 = OpLabel
+        %205 = OpUGreaterThanEqual %bool %202 %uint_4
+               OpSelectionMerge %206 None
+               OpBranchConditional %205 %207 %206
+        %207 = OpLabel
                OpBranch %201
-        %205 = OpLabel
-        %207 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
-        %209 = OpLoad %Outer_std140_tint_explicit_layout %207 None
-        %210 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %209
-        %211 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
-               OpStore %211 %210 None
+        %206 = OpLabel
+        %208 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
+        %210 = OpLoad %Outer_std140_tint_explicit_layout %208 None
+        %211 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %210
+        %212 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
+               OpStore %212 %211 None
                OpBranch %199
         %199 = OpLabel
         %203 = OpIAdd %uint %202 %uint_1
                OpBranch %200
         %201 = OpLabel
-        %212 = OpLoad %_arr_Outer_std140_uint_4 %195 None
-               OpReturnValue %212
+        %204 = OpLoad %_arr_Outer_std140_uint_4 %195 None
+               OpReturnValue %204
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.spvasm
index 32b3988..cfd2c1c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -83,12 +83,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %52 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %73 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %83 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %106 = OpTypeFunction %Inner %Inner_std140
@@ -105,8 +105,8 @@
          %15 = OpLabel
          %44 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %46 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %52
-         %79 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %81 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+         %69 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %71 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -130,56 +130,56 @@
                OpLoopMerge %57 %55 None
                OpBranch %54
          %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %62 None
-               OpBranchConditional %60 %63 %62
-         %63 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %58 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %57
-         %62 = OpLabel
-         %64 = OpAccessChain %_ptr_Function_Outer %46 %58
-         %66 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
-         %68 = OpLoad %Outer_std140 %66 None
-         %69 = OpFunctionCall %Outer %tint_convert_Outer %68
-               OpStore %64 %69 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_Outer %46 %58
+         %92 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
+         %94 = OpLoad %Outer_std140 %92 None
+         %95 = OpFunctionCall %Outer %tint_convert_Outer %94
+               OpStore %90 %95 None
                OpBranch %55
          %55 = OpLabel
          %59 = OpIAdd %uint %58 %uint_1
                OpBranch %56
          %57 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %46 None
-         %72 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %73 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %72
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %73
-         %76 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %77 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %76
-               OpStore %79 %77
-               OpBranch %84
-         %84 = OpLabel
-               OpBranch %87
-         %87 = OpLabel
-         %89 = OpPhi %uint %uint_0 %84 %90 %86
-               OpLoopMerge %88 %86 None
-               OpBranch %85
-         %85 = OpLabel
-         %91 = OpUGreaterThanEqual %bool %89 %uint_4
-               OpSelectionMerge %92 None
-               OpBranchConditional %91 %93 %92
-         %93 = OpLabel
-               OpBranch %88
-         %92 = OpLabel
-         %94 = OpAccessChain %_ptr_Function_Inner %81 %89
-         %96 = OpAccessChain %_ptr_Function_Inner_std140 %79 %89
-         %98 = OpLoad %Inner_std140 %96 None
-         %99 = OpFunctionCall %Inner %tint_convert_Inner %98
-               OpStore %94 %99 None
-               OpBranch %86
-         %86 = OpLabel
-         %90 = OpIAdd %uint %89 %uint_1
-               OpBranch %87
-         %88 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %81 None
-        %102 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %102
+         %61 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %62 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %61
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %62
+         %66 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %67 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %66
+               OpStore %69 %67
+               OpBranch %74
+         %74 = OpLabel
+               OpBranch %77
+         %77 = OpLabel
+         %79 = OpPhi %uint %uint_0 %74 %80 %76
+               OpLoopMerge %78 %76 None
+               OpBranch %75
+         %75 = OpLabel
+         %96 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %97 None
+               OpBranchConditional %96 %98 %97
+         %98 = OpLabel
+               OpBranch %78
+         %97 = OpLabel
+         %99 = OpAccessChain %_ptr_Function_Inner %71 %79
+        %101 = OpAccessChain %_ptr_Function_Inner_std140 %69 %79
+        %103 = OpLoad %Inner_std140 %101 None
+        %104 = OpFunctionCall %Inner %tint_convert_Inner %103
+               OpStore %99 %104 None
+               OpBranch %76
+         %76 = OpLabel
+         %80 = OpIAdd %uint %79 %uint_1
+               OpBranch %77
+         %78 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %71 None
+         %82 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %82
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %float %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -197,7 +197,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %115 = OpLabel
         %117 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
         %116 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %117 %116
                OpBranch %119
@@ -208,25 +208,25 @@
                OpLoopMerge %123 %121 None
                OpBranch %120
         %120 = OpLabel
-        %126 = OpUGreaterThanEqual %bool %124 %uint_4
-               OpSelectionMerge %127 None
-               OpBranchConditional %126 %128 %127
-        %128 = OpLabel
+        %128 = OpUGreaterThanEqual %bool %124 %uint_4
+               OpSelectionMerge %129 None
+               OpBranchConditional %128 %130 %129
+        %130 = OpLabel
                OpBranch %123
-        %127 = OpLabel
-        %129 = OpAccessChain %_ptr_Function_Inner %118 %124
-        %130 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
-        %131 = OpLoad %Inner_std140 %130 None
-        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
-               OpStore %129 %132 None
+        %129 = OpLabel
+        %131 = OpAccessChain %_ptr_Function_Inner %118 %124
+        %132 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
+        %133 = OpLoad %Inner_std140 %132 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %131 %134 None
                OpBranch %121
         %121 = OpLabel
         %125 = OpIAdd %uint %124 %uint_1
                OpBranch %122
         %123 = OpLabel
-        %133 = OpLoad %_arr_Inner_uint_4 %118 None
-        %134 = OpCompositeConstruct %Outer %133
-               OpReturnValue %134
+        %126 = OpLoad %_arr_Inner_uint_4 %118 None
+        %127 = OpCompositeConstruct %Outer %126
+               OpReturnValue %127
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %136
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -242,23 +242,23 @@
                OpLoopMerge %146 %144 None
                OpBranch %143
         %143 = OpLabel
-        %149 = OpUGreaterThanEqual %bool %147 %uint_4
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
+        %150 = OpUGreaterThanEqual %bool %147 %uint_4
+               OpSelectionMerge %151 None
+               OpBranchConditional %150 %152 %151
+        %152 = OpLabel
                OpBranch %146
-        %150 = OpLabel
-        %152 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
-        %153 = OpLoad %Inner_std140 %152 None
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
-               OpStore %154 %153 None
+        %151 = OpLabel
+        %153 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
+        %154 = OpLoad %Inner_std140 %153 None
+        %155 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
+               OpStore %155 %154 None
                OpBranch %144
         %144 = OpLabel
         %148 = OpIAdd %uint %147 %uint_1
                OpBranch %145
         %146 = OpLabel
-        %155 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
-               OpReturnValue %155
+        %149 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
+               OpReturnValue %149
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %157
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -282,22 +282,22 @@
                OpLoopMerge %173 %171 None
                OpBranch %170
         %170 = OpLabel
-        %176 = OpUGreaterThanEqual %bool %174 %uint_4
-               OpSelectionMerge %177 None
-               OpBranchConditional %176 %178 %177
-        %178 = OpLabel
+        %177 = OpUGreaterThanEqual %bool %174 %uint_4
+               OpSelectionMerge %178 None
+               OpBranchConditional %177 %179 %178
+        %179 = OpLabel
                OpBranch %173
-        %177 = OpLabel
-        %179 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
-        %181 = OpLoad %Outer_std140_tint_explicit_layout %179 None
-        %182 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %181
-        %183 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
-               OpStore %183 %182 None
+        %178 = OpLabel
+        %180 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
+        %182 = OpLoad %Outer_std140_tint_explicit_layout %180 None
+        %183 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %182
+        %184 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
+               OpStore %184 %183 None
                OpBranch %171
         %171 = OpLabel
         %175 = OpIAdd %uint %174 %uint_1
                OpBranch %172
         %173 = OpLabel
-        %184 = OpLoad %_arr_Outer_std140_uint_4 %167 None
-               OpReturnValue %184
+        %176 = OpLoad %_arr_Outer_std140_uint_4 %167 None
+               OpReturnValue %176
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.spvasm
index 89720ae..7a376bc 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.spvasm
@@ -71,14 +71,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %97 = OpTypeFunction %S %S_std140
         %107 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -124,45 +124,45 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_S %47 %55
+         %92 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %94 = OpLoad %S_std140 %92 None
+         %95 = OpFunctionCall %S %tint_convert_S %94
+               OpStore %90 %95 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v2float %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v2float %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v2float %82 None
-         %85 = OpCompositeConstruct %mat3v2float %79 %81 %84
-         %86 = OpFunctionCall %void %c %85
-         %87 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v2float %87 None
-         %89 = OpVectorShuffle %v2float %88 %88 1 0
-         %90 = OpFunctionCall %void %d %89
-         %91 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v2float %91 None
-         %93 = OpVectorShuffle %v2float %92 %92 1 0
-         %94 = OpCompositeExtract %float %93 0
-         %95 = OpFunctionCall %void %e %94
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v2float %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v2float %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v2float %72 None
+         %75 = OpCompositeConstruct %mat3v2float %69 %71 %74
+         %76 = OpFunctionCall %void %c %75
+         %77 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %78 = OpLoad %v2float %77 None
+         %79 = OpVectorShuffle %v2float %78 %78 1 0
+         %80 = OpFunctionCall %void %d %79
+         %81 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %82 = OpLoad %v2float %81 None
+         %83 = OpVectorShuffle %v2float %82 %82 1 0
+         %84 = OpCompositeExtract %float %83 0
+         %85 = OpFunctionCall %void %e %84
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %97
@@ -191,21 +191,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %118
-        %124 = OpLoad %S_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_S_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %118
+        %125 = OpLoad %S_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_S_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_S_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_S_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.spvasm
index 46d1c26..dae604c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.spvasm
@@ -59,17 +59,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat3v2float = OpTypePointer Private %mat3v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_Private_v2float = OpTypePointer Private %v2float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %76 = OpTypeFunction %S %S_std140
          %86 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -90,43 +90,43 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %65 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %67 None
+               OpBranchConditional %65 %68 %67
+         %68 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %67 = OpLabel
+         %69 = OpAccessChain %_ptr_Function_S %30 %37
+         %71 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %73 = OpLoad %S_std140 %71 None
+         %74 = OpFunctionCall %S %tint_convert_S %73
+               OpStore %69 %74 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat3v2float %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v2float %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v2float %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v2float %67 None
-         %69 = OpCompositeConstruct %mat3v2float %64 %66 %68
-               OpStore %59 %69 None
-         %70 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %73 = OpLoad %v2float %72 None
-         %74 = OpVectorShuffle %v2float %73 %73 1 0
-               OpStore %70 %74 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat3v2float %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v2float %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v2float %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v2float %57 None
+         %59 = OpCompositeConstruct %mat3v2float %54 %56 %58
+               OpStore %49 %59 None
+         %60 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %63 = OpLoad %v2float %62 None
+         %64 = OpVectorShuffle %v2float %63 %63 1 0
+               OpStore %60 %64 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %76
@@ -155,21 +155,21 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_S_std140 %88 %97
-        %103 = OpLoad %S_std140 %102 None
-        %104 = OpAccessChain %_ptr_Function_S_std140 %90 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_S_std140 %88 %97
+        %104 = OpLoad %S_std140 %103 None
+        %105 = OpAccessChain %_ptr_Function_S_std140 %90 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_S_std140_uint_4_0 %90 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_S_std140_uint_4_0 %90 None
+               OpReturnValue %99
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.spvasm
index 3c1b5240..6878844 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.spvasm
@@ -83,17 +83,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat3v2float = OpTypePointer StorageBuffer %mat3v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %83 = OpTypeFunction %void %_arr_S_uint_4
         %102 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -117,43 +117,43 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %72 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %74 None
+               OpBranchConditional %72 %75 %74
+         %75 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %74 = OpLabel
+         %76 = OpAccessChain %_ptr_Function_S %30 %40
+         %78 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %80 = OpLoad %S_std140 %78 None
+         %81 = OpFunctionCall %S %tint_convert_S %80
+               OpStore %76 %81 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v2float %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v2float %72 None
-         %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %75 = OpLoad %v2float %74 None
-         %76 = OpCompositeConstruct %mat3v2float %71 %73 %75
-               OpStore %66 %76 None
-         %77 = OpAccessChain %_ptr_StorageBuffer_v2float %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %80 = OpLoad %v2float %79 None
-         %81 = OpVectorShuffle %v2float %80 %80 1 0
-               OpStore %77 %81 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat3v2float %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v2float %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v2float %62 None
+         %64 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %65 = OpLoad %v2float %64 None
+         %66 = OpCompositeConstruct %mat3v2float %61 %63 %65
+               OpStore %56 %66 None
+         %67 = OpAccessChain %_ptr_StorageBuffer_v2float %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %70 = OpLoad %v2float %69 None
+         %71 = OpVectorShuffle %v2float %70 %70 1 0
+               OpStore %67 %71 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %83
@@ -228,21 +228,21 @@
                OpLoopMerge %133 %131 None
                OpBranch %130
         %130 = OpLabel
-        %136 = OpUGreaterThanEqual %bool %134 %uint_4
-               OpSelectionMerge %137 None
-               OpBranchConditional %136 %138 %137
-        %138 = OpLabel
+        %137 = OpUGreaterThanEqual %bool %134 %uint_4
+               OpSelectionMerge %138 None
+               OpBranchConditional %137 %139 %138
+        %139 = OpLabel
                OpBranch %133
-        %137 = OpLabel
-        %139 = OpAccessChain %_ptr_Function_S_std140 %125 %134
-        %140 = OpLoad %S_std140 %139 None
-        %141 = OpAccessChain %_ptr_Function_S_std140 %127 %134
-               OpStore %141 %140 None
+        %138 = OpLabel
+        %140 = OpAccessChain %_ptr_Function_S_std140 %125 %134
+        %141 = OpLoad %S_std140 %140 None
+        %142 = OpAccessChain %_ptr_Function_S_std140 %127 %134
+               OpStore %142 %141 None
                OpBranch %131
         %131 = OpLabel
         %135 = OpIAdd %uint %134 %uint_1
                OpBranch %132
         %133 = OpLabel
-        %142 = OpLoad %_arr_S_std140_uint_4_0 %127 None
-               OpReturnValue %142
+        %136 = OpLoad %_arr_S_std140_uint_4_0 %127 None
+               OpReturnValue %136
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.spvasm
index 8de7aa3..8f60c42 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -59,10 +59,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -70,14 +66,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat3v2float = OpTypePointer Workgroup %mat3v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
+       %bool = OpTypeBool
+         %82 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %93 = OpTypeFunction %void
          %98 = OpTypeFunction %S %S_std140
         %108 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -86,8 +86,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -96,69 +96,69 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %81 %82 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat3v2float %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v2float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v2float %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v2float %84 None
-         %86 = OpCompositeConstruct %mat3v2float %81 %83 %85
-               OpStore %76 %86 None
-         %87 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_1 %uint_0
-         %89 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v2float %89 None
-         %91 = OpVectorShuffle %v2float %90 %90 1 0
-               OpStore %87 %91 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %49
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_S %42 %50
+         %88 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %90 = OpLoad %S_std140 %88 None
+         %91 = OpFunctionCall %S %tint_convert_S %90
+               OpStore %86 %91 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat3v2float %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v2float %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v2float %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v2float %69 None
+         %71 = OpCompositeConstruct %mat3v2float %66 %68 %70
+               OpStore %61 %71 None
+         %72 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_1 %uint_0
+         %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v2float %74 None
+         %76 = OpVectorShuffle %v2float %75 %75 1 0
+               OpStore %72 %76 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %93
@@ -193,21 +193,21 @@
                OpLoopMerge %118 %116 None
                OpBranch %115
         %115 = OpLabel
-        %121 = OpUGreaterThanEqual %bool %119 %uint_4
-               OpSelectionMerge %122 None
-               OpBranchConditional %121 %123 %122
-        %123 = OpLabel
+        %122 = OpUGreaterThanEqual %bool %119 %uint_4
+               OpSelectionMerge %123 None
+               OpBranchConditional %122 %124 %123
+        %124 = OpLabel
                OpBranch %118
-        %122 = OpLabel
-        %124 = OpAccessChain %_ptr_Function_S_std140 %110 %119
-        %125 = OpLoad %S_std140 %124 None
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %119
-               OpStore %126 %125 None
+        %123 = OpLabel
+        %125 = OpAccessChain %_ptr_Function_S_std140 %110 %119
+        %126 = OpLoad %S_std140 %125 None
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %119
+               OpStore %127 %126 None
                OpBranch %116
         %116 = OpLabel
         %120 = OpIAdd %uint %119 %uint_1
                OpBranch %117
         %118 = OpLabel
-        %127 = OpLoad %_arr_S_std140_uint_4_0 %112 None
-               OpReturnValue %127
+        %121 = OpLoad %_arr_S_std140_uint_4_0 %112 None
+               OpReturnValue %121
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 19b7a75..62b33b3 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -97,12 +97,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %77 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %98 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %108 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %134 = OpTypeFunction %Inner %Inner_std140
@@ -128,8 +128,8 @@
          %55 = OpVariable %_ptr_Function_mat3v3half Function
          %69 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %71 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %77
-        %104 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %106 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+         %94 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %96 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -164,60 +164,60 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %87 None
-               OpBranchConditional %85 %88 %87
-         %88 = OpLabel
+        %114 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %116 None
+               OpBranchConditional %114 %117 %116
+        %117 = OpLabel
                OpBranch %82
-         %87 = OpLabel
-         %89 = OpAccessChain %_ptr_Function_Outer %71 %83
-         %91 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
-         %93 = OpLoad %Outer_std140 %91 None
-         %94 = OpFunctionCall %Outer %tint_convert_Outer %93
-               OpStore %89 %94 None
+        %116 = OpLabel
+        %118 = OpAccessChain %_ptr_Function_Outer %71 %83
+        %120 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
+        %122 = OpLoad %Outer_std140 %120 None
+        %123 = OpFunctionCall %Outer %tint_convert_Outer %122
+               OpStore %118 %123 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %71 None
-         %97 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %98 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %97
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %98
-        %101 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %102 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %101
-               OpStore %104 %102
-               OpBranch %109
-        %109 = OpLabel
-               OpBranch %112
-        %112 = OpLabel
-        %114 = OpPhi %uint %uint_0 %109 %115 %111
-               OpLoopMerge %113 %111 None
-               OpBranch %110
-        %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
-               OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_Inner %106 %114
-        %121 = OpAccessChain %_ptr_Function_Inner_std140 %104 %114
-        %123 = OpLoad %Inner_std140 %121 None
-        %124 = OpFunctionCall %Inner %tint_convert_Inner %123
-               OpStore %119 %124 None
-               OpBranch %111
-        %111 = OpLabel
-        %115 = OpIAdd %uint %114 %uint_1
-               OpBranch %112
-        %113 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %106 None
-        %127 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %127
-        %129 = OpFunctionCall %int %i
-        %130 = OpBitcast %uint %129
-        %131 = OpExtInst %uint %33 UMin %130 %uint_2
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %131
+         %86 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %87 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %86
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %87
+         %91 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %92 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %91
+               OpStore %94 %92
+               OpBranch %99
+         %99 = OpLabel
+               OpBranch %102
+        %102 = OpLabel
+        %104 = OpPhi %uint %uint_0 %99 %105 %101
+               OpLoopMerge %103 %101 None
+               OpBranch %100
+        %100 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %104 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
+               OpBranch %103
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_Inner %96 %104
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %94 %104
+        %131 = OpLoad %Inner_std140 %129 None
+        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
+               OpStore %127 %132 None
+               OpBranch %101
+        %101 = OpLabel
+        %105 = OpIAdd %uint %104 %uint_1
+               OpBranch %102
+        %103 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %96 None
+        %107 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %107
+        %110 = OpFunctionCall %int %i
+        %111 = OpBitcast %uint %110
+        %112 = OpExtInst %uint %33 UMin %111 %uint_2
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %112
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %134
@@ -234,7 +234,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %143 = OpLabel
         %145 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
         %144 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %145 %144
                OpBranch %147
@@ -245,25 +245,25 @@
                OpLoopMerge %151 %149 None
                OpBranch %148
         %148 = OpLabel
-        %154 = OpUGreaterThanEqual %bool %152 %uint_4
-               OpSelectionMerge %155 None
-               OpBranchConditional %154 %156 %155
-        %156 = OpLabel
+        %156 = OpUGreaterThanEqual %bool %152 %uint_4
+               OpSelectionMerge %157 None
+               OpBranchConditional %156 %158 %157
+        %158 = OpLabel
                OpBranch %151
-        %155 = OpLabel
-        %157 = OpAccessChain %_ptr_Function_Inner %146 %152
-        %158 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
-        %159 = OpLoad %Inner_std140 %158 None
-        %160 = OpFunctionCall %Inner %tint_convert_Inner %159
-               OpStore %157 %160 None
+        %157 = OpLabel
+        %159 = OpAccessChain %_ptr_Function_Inner %146 %152
+        %160 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
+        %161 = OpLoad %Inner_std140 %160 None
+        %162 = OpFunctionCall %Inner %tint_convert_Inner %161
+               OpStore %159 %162 None
                OpBranch %149
         %149 = OpLabel
         %153 = OpIAdd %uint %152 %uint_1
                OpBranch %150
         %151 = OpLabel
-        %161 = OpLoad %_arr_Inner_uint_4 %146 None
-        %162 = OpCompositeConstruct %Outer %161
-               OpReturnValue %162
+        %154 = OpLoad %_arr_Inner_uint_4 %146 None
+        %155 = OpCompositeConstruct %Outer %154
+               OpReturnValue %155
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %164
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -279,23 +279,23 @@
                OpLoopMerge %174 %172 None
                OpBranch %171
         %171 = OpLabel
-        %177 = OpUGreaterThanEqual %bool %175 %uint_4
-               OpSelectionMerge %178 None
-               OpBranchConditional %177 %179 %178
-        %179 = OpLabel
+        %178 = OpUGreaterThanEqual %bool %175 %uint_4
+               OpSelectionMerge %179 None
+               OpBranchConditional %178 %180 %179
+        %180 = OpLabel
                OpBranch %174
-        %178 = OpLabel
-        %180 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
-        %181 = OpLoad %Inner_std140 %180 None
-        %182 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
-               OpStore %182 %181 None
+        %179 = OpLabel
+        %181 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
+        %182 = OpLoad %Inner_std140 %181 None
+        %183 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
+               OpStore %183 %182 None
                OpBranch %172
         %172 = OpLabel
         %176 = OpIAdd %uint %175 %uint_1
                OpBranch %173
         %174 = OpLabel
-        %183 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
-               OpReturnValue %183
+        %177 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
+               OpReturnValue %177
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %185
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -319,22 +319,22 @@
                OpLoopMerge %201 %199 None
                OpBranch %198
         %198 = OpLabel
-        %204 = OpUGreaterThanEqual %bool %202 %uint_4
-               OpSelectionMerge %205 None
-               OpBranchConditional %204 %206 %205
-        %206 = OpLabel
+        %205 = OpUGreaterThanEqual %bool %202 %uint_4
+               OpSelectionMerge %206 None
+               OpBranchConditional %205 %207 %206
+        %207 = OpLabel
                OpBranch %201
-        %205 = OpLabel
-        %207 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
-        %209 = OpLoad %Outer_std140_tint_explicit_layout %207 None
-        %210 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %209
-        %211 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
-               OpStore %211 %210 None
+        %206 = OpLabel
+        %208 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
+        %210 = OpLoad %Outer_std140_tint_explicit_layout %208 None
+        %211 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %210
+        %212 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
+               OpStore %212 %211 None
                OpBranch %199
         %199 = OpLabel
         %203 = OpIAdd %uint %202 %uint_1
                OpBranch %200
         %201 = OpLabel
-        %212 = OpLoad %_arr_Outer_std140_uint_4 %195 None
-               OpReturnValue %212
+        %204 = OpLoad %_arr_Outer_std140_uint_4 %195 None
+               OpReturnValue %204
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.spvasm
index 56ab5da..404eb6d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -86,12 +86,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %52 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %73 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %83 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %106 = OpTypeFunction %Inner %Inner_std140
@@ -108,8 +108,8 @@
          %15 = OpLabel
          %44 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %46 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %52
-         %79 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %81 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+         %69 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %71 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -133,56 +133,56 @@
                OpLoopMerge %57 %55 None
                OpBranch %54
          %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %62 None
-               OpBranchConditional %60 %63 %62
-         %63 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %58 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %57
-         %62 = OpLabel
-         %64 = OpAccessChain %_ptr_Function_Outer %46 %58
-         %66 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
-         %68 = OpLoad %Outer_std140 %66 None
-         %69 = OpFunctionCall %Outer %tint_convert_Outer %68
-               OpStore %64 %69 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_Outer %46 %58
+         %92 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
+         %94 = OpLoad %Outer_std140 %92 None
+         %95 = OpFunctionCall %Outer %tint_convert_Outer %94
+               OpStore %90 %95 None
                OpBranch %55
          %55 = OpLabel
          %59 = OpIAdd %uint %58 %uint_1
                OpBranch %56
          %57 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %46 None
-         %72 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %73 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %72
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %73
-         %76 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %77 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %76
-               OpStore %79 %77
-               OpBranch %84
-         %84 = OpLabel
-               OpBranch %87
-         %87 = OpLabel
-         %89 = OpPhi %uint %uint_0 %84 %90 %86
-               OpLoopMerge %88 %86 None
-               OpBranch %85
-         %85 = OpLabel
-         %91 = OpUGreaterThanEqual %bool %89 %uint_4
-               OpSelectionMerge %92 None
-               OpBranchConditional %91 %93 %92
-         %93 = OpLabel
-               OpBranch %88
-         %92 = OpLabel
-         %94 = OpAccessChain %_ptr_Function_Inner %81 %89
-         %96 = OpAccessChain %_ptr_Function_Inner_std140 %79 %89
-         %98 = OpLoad %Inner_std140 %96 None
-         %99 = OpFunctionCall %Inner %tint_convert_Inner %98
-               OpStore %94 %99 None
-               OpBranch %86
-         %86 = OpLabel
-         %90 = OpIAdd %uint %89 %uint_1
-               OpBranch %87
-         %88 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %81 None
-        %102 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %102
+         %61 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %62 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %61
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %62
+         %66 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %67 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %66
+               OpStore %69 %67
+               OpBranch %74
+         %74 = OpLabel
+               OpBranch %77
+         %77 = OpLabel
+         %79 = OpPhi %uint %uint_0 %74 %80 %76
+               OpLoopMerge %78 %76 None
+               OpBranch %75
+         %75 = OpLabel
+         %96 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %97 None
+               OpBranchConditional %96 %98 %97
+         %98 = OpLabel
+               OpBranch %78
+         %97 = OpLabel
+         %99 = OpAccessChain %_ptr_Function_Inner %71 %79
+        %101 = OpAccessChain %_ptr_Function_Inner_std140 %69 %79
+        %103 = OpLoad %Inner_std140 %101 None
+        %104 = OpFunctionCall %Inner %tint_convert_Inner %103
+               OpStore %99 %104 None
+               OpBranch %76
+         %76 = OpLabel
+         %80 = OpIAdd %uint %79 %uint_1
+               OpBranch %77
+         %78 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %71 None
+         %82 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %82
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -200,7 +200,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %115 = OpLabel
         %117 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
         %116 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %117 %116
                OpBranch %119
@@ -211,25 +211,25 @@
                OpLoopMerge %123 %121 None
                OpBranch %120
         %120 = OpLabel
-        %126 = OpUGreaterThanEqual %bool %124 %uint_4
-               OpSelectionMerge %127 None
-               OpBranchConditional %126 %128 %127
-        %128 = OpLabel
+        %128 = OpUGreaterThanEqual %bool %124 %uint_4
+               OpSelectionMerge %129 None
+               OpBranchConditional %128 %130 %129
+        %130 = OpLabel
                OpBranch %123
-        %127 = OpLabel
-        %129 = OpAccessChain %_ptr_Function_Inner %118 %124
-        %130 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
-        %131 = OpLoad %Inner_std140 %130 None
-        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
-               OpStore %129 %132 None
+        %129 = OpLabel
+        %131 = OpAccessChain %_ptr_Function_Inner %118 %124
+        %132 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
+        %133 = OpLoad %Inner_std140 %132 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %131 %134 None
                OpBranch %121
         %121 = OpLabel
         %125 = OpIAdd %uint %124 %uint_1
                OpBranch %122
         %123 = OpLabel
-        %133 = OpLoad %_arr_Inner_uint_4 %118 None
-        %134 = OpCompositeConstruct %Outer %133
-               OpReturnValue %134
+        %126 = OpLoad %_arr_Inner_uint_4 %118 None
+        %127 = OpCompositeConstruct %Outer %126
+               OpReturnValue %127
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %136
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -245,23 +245,23 @@
                OpLoopMerge %146 %144 None
                OpBranch %143
         %143 = OpLabel
-        %149 = OpUGreaterThanEqual %bool %147 %uint_4
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
+        %150 = OpUGreaterThanEqual %bool %147 %uint_4
+               OpSelectionMerge %151 None
+               OpBranchConditional %150 %152 %151
+        %152 = OpLabel
                OpBranch %146
-        %150 = OpLabel
-        %152 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
-        %153 = OpLoad %Inner_std140 %152 None
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
-               OpStore %154 %153 None
+        %151 = OpLabel
+        %153 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
+        %154 = OpLoad %Inner_std140 %153 None
+        %155 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
+               OpStore %155 %154 None
                OpBranch %144
         %144 = OpLabel
         %148 = OpIAdd %uint %147 %uint_1
                OpBranch %145
         %146 = OpLabel
-        %155 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
-               OpReturnValue %155
+        %149 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
+               OpReturnValue %149
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %157
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -285,22 +285,22 @@
                OpLoopMerge %173 %171 None
                OpBranch %170
         %170 = OpLabel
-        %176 = OpUGreaterThanEqual %bool %174 %uint_4
-               OpSelectionMerge %177 None
-               OpBranchConditional %176 %178 %177
-        %178 = OpLabel
+        %177 = OpUGreaterThanEqual %bool %174 %uint_4
+               OpSelectionMerge %178 None
+               OpBranchConditional %177 %179 %178
+        %179 = OpLabel
                OpBranch %173
-        %177 = OpLabel
-        %179 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
-        %181 = OpLoad %Outer_std140_tint_explicit_layout %179 None
-        %182 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %181
-        %183 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
-               OpStore %183 %182 None
+        %178 = OpLabel
+        %180 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
+        %182 = OpLoad %Outer_std140_tint_explicit_layout %180 None
+        %183 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %182
+        %184 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
+               OpStore %184 %183 None
                OpBranch %171
         %171 = OpLabel
         %175 = OpIAdd %uint %174 %uint_1
                OpBranch %172
         %173 = OpLabel
-        %184 = OpLoad %_arr_Outer_std140_uint_4 %167 None
-               OpReturnValue %184
+        %176 = OpLoad %_arr_Outer_std140_uint_4 %167 None
+               OpReturnValue %176
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.spvasm
index f25d324..adde922 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.spvasm
@@ -74,14 +74,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %97 = OpTypeFunction %S %S_std140
         %107 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -127,45 +127,45 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_S %47 %55
+         %92 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %94 = OpLoad %S_std140 %92 None
+         %95 = OpFunctionCall %S %tint_convert_S %94
+               OpStore %90 %95 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v3half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v3half %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v3half %82 None
-         %85 = OpCompositeConstruct %mat3v3half %79 %81 %84
-         %86 = OpFunctionCall %void %c %85
-         %87 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v3half %87 None
-         %89 = OpVectorShuffle %v3half %88 %88 2 0 1
-         %90 = OpFunctionCall %void %d %89
-         %91 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v3half %91 None
-         %93 = OpVectorShuffle %v3half %92 %92 2 0 1
-         %94 = OpCompositeExtract %half %93 0
-         %95 = OpFunctionCall %void %e %94
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v3half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v3half %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v3half %72 None
+         %75 = OpCompositeConstruct %mat3v3half %69 %71 %74
+         %76 = OpFunctionCall %void %c %75
+         %77 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %78 = OpLoad %v3half %77 None
+         %79 = OpVectorShuffle %v3half %78 %78 2 0 1
+         %80 = OpFunctionCall %void %d %79
+         %81 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %82 = OpLoad %v3half %81 None
+         %83 = OpVectorShuffle %v3half %82 %82 2 0 1
+         %84 = OpCompositeExtract %half %83 0
+         %85 = OpFunctionCall %void %e %84
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %97
@@ -194,21 +194,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %118
-        %124 = OpLoad %S_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_S_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %118
+        %125 = OpLoad %S_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_S_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_S_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_S_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.spvasm
index 48831ce..dfe170a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.spvasm
@@ -62,17 +62,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat3v3half = OpTypePointer Private %mat3v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
 %_ptr_Private_v3half = OpTypePointer Private %v3half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %76 = OpTypeFunction %S %S_std140
          %86 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -93,43 +93,43 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %65 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %67 None
+               OpBranchConditional %65 %68 %67
+         %68 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %67 = OpLabel
+         %69 = OpAccessChain %_ptr_Function_S %30 %37
+         %71 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %73 = OpLoad %S_std140 %71 None
+         %74 = OpFunctionCall %S %tint_convert_S %73
+               OpStore %69 %74 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat3v3half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v3half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v3half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v3half %67 None
-         %69 = OpCompositeConstruct %mat3v3half %64 %66 %68
-               OpStore %59 %69 None
-         %70 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %73 = OpLoad %v3half %72 None
-         %74 = OpVectorShuffle %v3half %73 %73 2 0 1
-               OpStore %70 %74 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat3v3half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v3half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v3half %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v3half %57 None
+         %59 = OpCompositeConstruct %mat3v3half %54 %56 %58
+               OpStore %49 %59 None
+         %60 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %63 = OpLoad %v3half %62 None
+         %64 = OpVectorShuffle %v3half %63 %63 2 0 1
+               OpStore %60 %64 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %76
@@ -158,21 +158,21 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_S_std140 %88 %97
-        %103 = OpLoad %S_std140 %102 None
-        %104 = OpAccessChain %_ptr_Function_S_std140 %90 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_S_std140 %88 %97
+        %104 = OpLoad %S_std140 %103 None
+        %105 = OpAccessChain %_ptr_Function_S_std140 %90 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_S_std140_uint_4_0 %90 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_S_std140_uint_4_0 %90 None
+               OpReturnValue %99
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.spvasm
index 099ee1f..543cd05 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.spvasm
@@ -89,16 +89,16 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %84 = OpTypeFunction %void %_arr_S_uint_4
         %103 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -123,43 +123,43 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %73 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %76 %75
+         %76 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %75 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_S %30 %40
+         %79 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %81 = OpLoad %S_std140 %79 None
+         %82 = OpFunctionCall %S %tint_convert_S %81
+               OpStore %77 %82 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %68 = OpLoad %v3half %66 None
-         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %70 = OpLoad %v3half %69 None
-         %71 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %73 = OpLoad %v3half %71 None
-         %74 = OpCompositeConstruct %mat3v3half %68 %70 %73
-         %75 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
-         %76 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %75 %74
-         %78 = OpAccessChain %_ptr_StorageBuffer_v3half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %80 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %81 = OpLoad %v3half %80 None
-         %82 = OpVectorShuffle %v3half %81 %81 2 0 1
-               OpStore %78 %82 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3half %56 None
+         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3half %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v3half %61 None
+         %64 = OpCompositeConstruct %mat3v3half %58 %60 %63
+         %65 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
+         %66 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %65 %64
+         %68 = OpAccessChain %_ptr_StorageBuffer_v3half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %70 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %71 = OpLoad %v3half %70 None
+         %72 = OpVectorShuffle %v3half %71 %71 2 0 1
+               OpStore %68 %72 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %84
@@ -250,21 +250,21 @@
                OpLoopMerge %146 %144 None
                OpBranch %143
         %143 = OpLabel
-        %149 = OpUGreaterThanEqual %bool %147 %uint_4
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
+        %150 = OpUGreaterThanEqual %bool %147 %uint_4
+               OpSelectionMerge %151 None
+               OpBranchConditional %150 %152 %151
+        %152 = OpLabel
                OpBranch %146
-        %150 = OpLabel
-        %152 = OpAccessChain %_ptr_Function_S_std140 %138 %147
-        %153 = OpLoad %S_std140 %152 None
-        %154 = OpAccessChain %_ptr_Function_S_std140 %140 %147
-               OpStore %154 %153 None
+        %151 = OpLabel
+        %153 = OpAccessChain %_ptr_Function_S_std140 %138 %147
+        %154 = OpLoad %S_std140 %153 None
+        %155 = OpAccessChain %_ptr_Function_S_std140 %140 %147
+               OpStore %155 %154 None
                OpBranch %144
         %144 = OpLabel
         %148 = OpIAdd %uint %147 %uint_1
                OpBranch %145
         %146 = OpLabel
-        %155 = OpLoad %_arr_S_std140_uint_4_0 %140 None
-               OpReturnValue %155
+        %149 = OpLoad %_arr_S_std140_uint_4_0 %140 None
+               OpReturnValue %149
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.spvasm
index 349b188..ca65bbf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -62,10 +62,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -73,14 +69,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat3v3half = OpTypePointer Workgroup %mat3v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
+       %bool = OpTypeBool
+         %82 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %93 = OpTypeFunction %void
          %98 = OpTypeFunction %S %S_std140
         %108 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -89,8 +89,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -99,69 +99,69 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %81 %82 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat3v3half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v3half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v3half %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v3half %84 None
-         %86 = OpCompositeConstruct %mat3v3half %81 %83 %85
-               OpStore %76 %86 None
-         %87 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_1 %uint_0
-         %89 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v3half %89 None
-         %91 = OpVectorShuffle %v3half %90 %90 2 0 1
-               OpStore %87 %91 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %49
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_S %42 %50
+         %88 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %90 = OpLoad %S_std140 %88 None
+         %91 = OpFunctionCall %S %tint_convert_S %90
+               OpStore %86 %91 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat3v3half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v3half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v3half %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v3half %69 None
+         %71 = OpCompositeConstruct %mat3v3half %66 %68 %70
+               OpStore %61 %71 None
+         %72 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_1 %uint_0
+         %74 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v3half %74 None
+         %76 = OpVectorShuffle %v3half %75 %75 2 0 1
+               OpStore %72 %76 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %93
@@ -196,21 +196,21 @@
                OpLoopMerge %118 %116 None
                OpBranch %115
         %115 = OpLabel
-        %121 = OpUGreaterThanEqual %bool %119 %uint_4
-               OpSelectionMerge %122 None
-               OpBranchConditional %121 %123 %122
-        %123 = OpLabel
+        %122 = OpUGreaterThanEqual %bool %119 %uint_4
+               OpSelectionMerge %123 None
+               OpBranchConditional %122 %124 %123
+        %124 = OpLabel
                OpBranch %118
-        %122 = OpLabel
-        %124 = OpAccessChain %_ptr_Function_S_std140 %110 %119
-        %125 = OpLoad %S_std140 %124 None
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %119
-               OpStore %126 %125 None
+        %123 = OpLabel
+        %125 = OpAccessChain %_ptr_Function_S_std140 %110 %119
+        %126 = OpLoad %S_std140 %125 None
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %119
+               OpStore %127 %126 None
                OpBranch %116
         %116 = OpLabel
         %120 = OpIAdd %uint %119 %uint_1
                OpBranch %117
         %118 = OpLabel
-        %127 = OpLoad %_arr_S_std140_uint_4_0 %112 None
-               OpReturnValue %127
+        %121 = OpLoad %_arr_S_std140_uint_4_0 %112 None
+               OpReturnValue %121
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 8b0c1fc..d0b6737 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -94,12 +94,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %77 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %98 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %108 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %134 = OpTypeFunction %Inner %Inner_std140
@@ -125,8 +125,8 @@
          %55 = OpVariable %_ptr_Function_mat3v3float Function
          %69 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %71 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %77
-        %104 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %106 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+         %94 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %96 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -161,60 +161,60 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %87 None
-               OpBranchConditional %85 %88 %87
-         %88 = OpLabel
+        %114 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %116 None
+               OpBranchConditional %114 %117 %116
+        %117 = OpLabel
                OpBranch %82
-         %87 = OpLabel
-         %89 = OpAccessChain %_ptr_Function_Outer %71 %83
-         %91 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
-         %93 = OpLoad %Outer_std140 %91 None
-         %94 = OpFunctionCall %Outer %tint_convert_Outer %93
-               OpStore %89 %94 None
+        %116 = OpLabel
+        %118 = OpAccessChain %_ptr_Function_Outer %71 %83
+        %120 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
+        %122 = OpLoad %Outer_std140 %120 None
+        %123 = OpFunctionCall %Outer %tint_convert_Outer %122
+               OpStore %118 %123 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %71 None
-         %97 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %98 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %97
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %98
-        %101 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %102 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %101
-               OpStore %104 %102
-               OpBranch %109
-        %109 = OpLabel
-               OpBranch %112
-        %112 = OpLabel
-        %114 = OpPhi %uint %uint_0 %109 %115 %111
-               OpLoopMerge %113 %111 None
-               OpBranch %110
-        %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
-               OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_Inner %106 %114
-        %121 = OpAccessChain %_ptr_Function_Inner_std140 %104 %114
-        %123 = OpLoad %Inner_std140 %121 None
-        %124 = OpFunctionCall %Inner %tint_convert_Inner %123
-               OpStore %119 %124 None
-               OpBranch %111
-        %111 = OpLabel
-        %115 = OpIAdd %uint %114 %uint_1
-               OpBranch %112
-        %113 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %106 None
-        %127 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %127
-        %129 = OpFunctionCall %int %i
-        %130 = OpBitcast %uint %129
-        %131 = OpExtInst %uint %33 UMin %130 %uint_2
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %131
+         %86 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %87 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %86
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %87
+         %91 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %92 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %91
+               OpStore %94 %92
+               OpBranch %99
+         %99 = OpLabel
+               OpBranch %102
+        %102 = OpLabel
+        %104 = OpPhi %uint %uint_0 %99 %105 %101
+               OpLoopMerge %103 %101 None
+               OpBranch %100
+        %100 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %104 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
+               OpBranch %103
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_Inner %96 %104
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %94 %104
+        %131 = OpLoad %Inner_std140 %129 None
+        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
+               OpStore %127 %132 None
+               OpBranch %101
+        %101 = OpLabel
+        %105 = OpIAdd %uint %104 %uint_1
+               OpBranch %102
+        %103 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %96 None
+        %107 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %107
+        %110 = OpFunctionCall %int %i
+        %111 = OpBitcast %uint %110
+        %112 = OpExtInst %uint %33 UMin %111 %uint_2
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %112
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %134
@@ -231,7 +231,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %143 = OpLabel
         %145 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
         %144 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %145 %144
                OpBranch %147
@@ -242,25 +242,25 @@
                OpLoopMerge %151 %149 None
                OpBranch %148
         %148 = OpLabel
-        %154 = OpUGreaterThanEqual %bool %152 %uint_4
-               OpSelectionMerge %155 None
-               OpBranchConditional %154 %156 %155
-        %156 = OpLabel
+        %156 = OpUGreaterThanEqual %bool %152 %uint_4
+               OpSelectionMerge %157 None
+               OpBranchConditional %156 %158 %157
+        %158 = OpLabel
                OpBranch %151
-        %155 = OpLabel
-        %157 = OpAccessChain %_ptr_Function_Inner %146 %152
-        %158 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
-        %159 = OpLoad %Inner_std140 %158 None
-        %160 = OpFunctionCall %Inner %tint_convert_Inner %159
-               OpStore %157 %160 None
+        %157 = OpLabel
+        %159 = OpAccessChain %_ptr_Function_Inner %146 %152
+        %160 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
+        %161 = OpLoad %Inner_std140 %160 None
+        %162 = OpFunctionCall %Inner %tint_convert_Inner %161
+               OpStore %159 %162 None
                OpBranch %149
         %149 = OpLabel
         %153 = OpIAdd %uint %152 %uint_1
                OpBranch %150
         %151 = OpLabel
-        %161 = OpLoad %_arr_Inner_uint_4 %146 None
-        %162 = OpCompositeConstruct %Outer %161
-               OpReturnValue %162
+        %154 = OpLoad %_arr_Inner_uint_4 %146 None
+        %155 = OpCompositeConstruct %Outer %154
+               OpReturnValue %155
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %164
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -276,23 +276,23 @@
                OpLoopMerge %174 %172 None
                OpBranch %171
         %171 = OpLabel
-        %177 = OpUGreaterThanEqual %bool %175 %uint_4
-               OpSelectionMerge %178 None
-               OpBranchConditional %177 %179 %178
-        %179 = OpLabel
+        %178 = OpUGreaterThanEqual %bool %175 %uint_4
+               OpSelectionMerge %179 None
+               OpBranchConditional %178 %180 %179
+        %180 = OpLabel
                OpBranch %174
-        %178 = OpLabel
-        %180 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
-        %181 = OpLoad %Inner_std140 %180 None
-        %182 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
-               OpStore %182 %181 None
+        %179 = OpLabel
+        %181 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
+        %182 = OpLoad %Inner_std140 %181 None
+        %183 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
+               OpStore %183 %182 None
                OpBranch %172
         %172 = OpLabel
         %176 = OpIAdd %uint %175 %uint_1
                OpBranch %173
         %174 = OpLabel
-        %183 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
-               OpReturnValue %183
+        %177 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
+               OpReturnValue %177
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %185
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -316,22 +316,22 @@
                OpLoopMerge %201 %199 None
                OpBranch %198
         %198 = OpLabel
-        %204 = OpUGreaterThanEqual %bool %202 %uint_4
-               OpSelectionMerge %205 None
-               OpBranchConditional %204 %206 %205
-        %206 = OpLabel
+        %205 = OpUGreaterThanEqual %bool %202 %uint_4
+               OpSelectionMerge %206 None
+               OpBranchConditional %205 %207 %206
+        %207 = OpLabel
                OpBranch %201
-        %205 = OpLabel
-        %207 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
-        %209 = OpLoad %Outer_std140_tint_explicit_layout %207 None
-        %210 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %209
-        %211 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
-               OpStore %211 %210 None
+        %206 = OpLabel
+        %208 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
+        %210 = OpLoad %Outer_std140_tint_explicit_layout %208 None
+        %211 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %210
+        %212 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
+               OpStore %212 %211 None
                OpBranch %199
         %199 = OpLabel
         %203 = OpIAdd %uint %202 %uint_1
                OpBranch %200
         %201 = OpLabel
-        %212 = OpLoad %_arr_Outer_std140_uint_4 %195 None
-               OpReturnValue %212
+        %204 = OpLoad %_arr_Outer_std140_uint_4 %195 None
+               OpReturnValue %204
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm
index 98d741f..593e419 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -83,12 +83,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %52 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %73 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %83 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %106 = OpTypeFunction %Inner %Inner_std140
@@ -105,8 +105,8 @@
          %15 = OpLabel
          %44 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %46 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %52
-         %79 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %81 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+         %69 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %71 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -130,56 +130,56 @@
                OpLoopMerge %57 %55 None
                OpBranch %54
          %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %62 None
-               OpBranchConditional %60 %63 %62
-         %63 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %58 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %57
-         %62 = OpLabel
-         %64 = OpAccessChain %_ptr_Function_Outer %46 %58
-         %66 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
-         %68 = OpLoad %Outer_std140 %66 None
-         %69 = OpFunctionCall %Outer %tint_convert_Outer %68
-               OpStore %64 %69 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_Outer %46 %58
+         %92 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
+         %94 = OpLoad %Outer_std140 %92 None
+         %95 = OpFunctionCall %Outer %tint_convert_Outer %94
+               OpStore %90 %95 None
                OpBranch %55
          %55 = OpLabel
          %59 = OpIAdd %uint %58 %uint_1
                OpBranch %56
          %57 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %46 None
-         %72 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %73 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %72
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %73
-         %76 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %77 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %76
-               OpStore %79 %77
-               OpBranch %84
-         %84 = OpLabel
-               OpBranch %87
-         %87 = OpLabel
-         %89 = OpPhi %uint %uint_0 %84 %90 %86
-               OpLoopMerge %88 %86 None
-               OpBranch %85
-         %85 = OpLabel
-         %91 = OpUGreaterThanEqual %bool %89 %uint_4
-               OpSelectionMerge %92 None
-               OpBranchConditional %91 %93 %92
-         %93 = OpLabel
-               OpBranch %88
-         %92 = OpLabel
-         %94 = OpAccessChain %_ptr_Function_Inner %81 %89
-         %96 = OpAccessChain %_ptr_Function_Inner_std140 %79 %89
-         %98 = OpLoad %Inner_std140 %96 None
-         %99 = OpFunctionCall %Inner %tint_convert_Inner %98
-               OpStore %94 %99 None
-               OpBranch %86
-         %86 = OpLabel
-         %90 = OpIAdd %uint %89 %uint_1
-               OpBranch %87
-         %88 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %81 None
-        %102 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %102
+         %61 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %62 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %61
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %62
+         %66 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %67 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %66
+               OpStore %69 %67
+               OpBranch %74
+         %74 = OpLabel
+               OpBranch %77
+         %77 = OpLabel
+         %79 = OpPhi %uint %uint_0 %74 %80 %76
+               OpLoopMerge %78 %76 None
+               OpBranch %75
+         %75 = OpLabel
+         %96 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %97 None
+               OpBranchConditional %96 %98 %97
+         %98 = OpLabel
+               OpBranch %78
+         %97 = OpLabel
+         %99 = OpAccessChain %_ptr_Function_Inner %71 %79
+        %101 = OpAccessChain %_ptr_Function_Inner_std140 %69 %79
+        %103 = OpLoad %Inner_std140 %101 None
+        %104 = OpFunctionCall %Inner %tint_convert_Inner %103
+               OpStore %99 %104 None
+               OpBranch %76
+         %76 = OpLabel
+         %80 = OpIAdd %uint %79 %uint_1
+               OpBranch %77
+         %78 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %71 None
+         %82 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %82
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %float %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -197,7 +197,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %115 = OpLabel
         %117 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
         %116 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %117 %116
                OpBranch %119
@@ -208,25 +208,25 @@
                OpLoopMerge %123 %121 None
                OpBranch %120
         %120 = OpLabel
-        %126 = OpUGreaterThanEqual %bool %124 %uint_4
-               OpSelectionMerge %127 None
-               OpBranchConditional %126 %128 %127
-        %128 = OpLabel
+        %128 = OpUGreaterThanEqual %bool %124 %uint_4
+               OpSelectionMerge %129 None
+               OpBranchConditional %128 %130 %129
+        %130 = OpLabel
                OpBranch %123
-        %127 = OpLabel
-        %129 = OpAccessChain %_ptr_Function_Inner %118 %124
-        %130 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
-        %131 = OpLoad %Inner_std140 %130 None
-        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
-               OpStore %129 %132 None
+        %129 = OpLabel
+        %131 = OpAccessChain %_ptr_Function_Inner %118 %124
+        %132 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
+        %133 = OpLoad %Inner_std140 %132 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %131 %134 None
                OpBranch %121
         %121 = OpLabel
         %125 = OpIAdd %uint %124 %uint_1
                OpBranch %122
         %123 = OpLabel
-        %133 = OpLoad %_arr_Inner_uint_4 %118 None
-        %134 = OpCompositeConstruct %Outer %133
-               OpReturnValue %134
+        %126 = OpLoad %_arr_Inner_uint_4 %118 None
+        %127 = OpCompositeConstruct %Outer %126
+               OpReturnValue %127
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %136
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -242,23 +242,23 @@
                OpLoopMerge %146 %144 None
                OpBranch %143
         %143 = OpLabel
-        %149 = OpUGreaterThanEqual %bool %147 %uint_4
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
+        %150 = OpUGreaterThanEqual %bool %147 %uint_4
+               OpSelectionMerge %151 None
+               OpBranchConditional %150 %152 %151
+        %152 = OpLabel
                OpBranch %146
-        %150 = OpLabel
-        %152 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
-        %153 = OpLoad %Inner_std140 %152 None
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
-               OpStore %154 %153 None
+        %151 = OpLabel
+        %153 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
+        %154 = OpLoad %Inner_std140 %153 None
+        %155 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
+               OpStore %155 %154 None
                OpBranch %144
         %144 = OpLabel
         %148 = OpIAdd %uint %147 %uint_1
                OpBranch %145
         %146 = OpLabel
-        %155 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
-               OpReturnValue %155
+        %149 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
+               OpReturnValue %149
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %157
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -282,22 +282,22 @@
                OpLoopMerge %173 %171 None
                OpBranch %170
         %170 = OpLabel
-        %176 = OpUGreaterThanEqual %bool %174 %uint_4
-               OpSelectionMerge %177 None
-               OpBranchConditional %176 %178 %177
-        %178 = OpLabel
+        %177 = OpUGreaterThanEqual %bool %174 %uint_4
+               OpSelectionMerge %178 None
+               OpBranchConditional %177 %179 %178
+        %179 = OpLabel
                OpBranch %173
-        %177 = OpLabel
-        %179 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
-        %181 = OpLoad %Outer_std140_tint_explicit_layout %179 None
-        %182 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %181
-        %183 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
-               OpStore %183 %182 None
+        %178 = OpLabel
+        %180 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
+        %182 = OpLoad %Outer_std140_tint_explicit_layout %180 None
+        %183 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %182
+        %184 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
+               OpStore %184 %183 None
                OpBranch %171
         %171 = OpLabel
         %175 = OpIAdd %uint %174 %uint_1
                OpBranch %172
         %173 = OpLabel
-        %184 = OpLoad %_arr_Outer_std140_uint_4 %167 None
-               OpReturnValue %184
+        %176 = OpLoad %_arr_Outer_std140_uint_4 %167 None
+               OpReturnValue %176
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.spvasm
index 8ffdb4d..6a5b05a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.spvasm
@@ -71,14 +71,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %97 = OpTypeFunction %S %S_std140
         %107 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -124,45 +124,45 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_S %47 %55
+         %92 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %94 = OpLoad %S_std140 %92 None
+         %95 = OpFunctionCall %S %tint_convert_S %94
+               OpStore %90 %95 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v3float %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v3float %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v3float %82 None
-         %85 = OpCompositeConstruct %mat3v3float %79 %81 %84
-         %86 = OpFunctionCall %void %c %85
-         %87 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v3float %87 None
-         %89 = OpVectorShuffle %v3float %88 %88 2 0 1
-         %90 = OpFunctionCall %void %d %89
-         %91 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v3float %91 None
-         %93 = OpVectorShuffle %v3float %92 %92 2 0 1
-         %94 = OpCompositeExtract %float %93 0
-         %95 = OpFunctionCall %void %e %94
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v3float %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v3float %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v3float %72 None
+         %75 = OpCompositeConstruct %mat3v3float %69 %71 %74
+         %76 = OpFunctionCall %void %c %75
+         %77 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %78 = OpLoad %v3float %77 None
+         %79 = OpVectorShuffle %v3float %78 %78 2 0 1
+         %80 = OpFunctionCall %void %d %79
+         %81 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %82 = OpLoad %v3float %81 None
+         %83 = OpVectorShuffle %v3float %82 %82 2 0 1
+         %84 = OpCompositeExtract %float %83 0
+         %85 = OpFunctionCall %void %e %84
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %97
@@ -191,21 +191,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %118
-        %124 = OpLoad %S_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_S_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %118
+        %125 = OpLoad %S_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_S_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_S_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_S_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.spvasm
index e1d35b9..f9bd5a4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.spvasm
@@ -59,17 +59,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat3v3float = OpTypePointer Private %mat3v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Private_v3float = OpTypePointer Private %v3float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %76 = OpTypeFunction %S %S_std140
          %86 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -90,43 +90,43 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %65 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %67 None
+               OpBranchConditional %65 %68 %67
+         %68 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %67 = OpLabel
+         %69 = OpAccessChain %_ptr_Function_S %30 %37
+         %71 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %73 = OpLoad %S_std140 %71 None
+         %74 = OpFunctionCall %S %tint_convert_S %73
+               OpStore %69 %74 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat3v3float %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v3float %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v3float %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v3float %67 None
-         %69 = OpCompositeConstruct %mat3v3float %64 %66 %68
-               OpStore %59 %69 None
-         %70 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %73 = OpLoad %v3float %72 None
-         %74 = OpVectorShuffle %v3float %73 %73 2 0 1
-               OpStore %70 %74 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat3v3float %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v3float %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v3float %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v3float %57 None
+         %59 = OpCompositeConstruct %mat3v3float %54 %56 %58
+               OpStore %49 %59 None
+         %60 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %63 = OpLoad %v3float %62 None
+         %64 = OpVectorShuffle %v3float %63 %63 2 0 1
+               OpStore %60 %64 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %76
@@ -155,21 +155,21 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_S_std140 %88 %97
-        %103 = OpLoad %S_std140 %102 None
-        %104 = OpAccessChain %_ptr_Function_S_std140 %90 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_S_std140 %88 %97
+        %104 = OpLoad %S_std140 %103 None
+        %105 = OpAccessChain %_ptr_Function_S_std140 %90 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_S_std140_uint_4_0 %90 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_S_std140_uint_4_0 %90 None
+               OpReturnValue %99
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.spvasm
index a85f44c..f8903eb 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.spvasm
@@ -86,16 +86,16 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %84 = OpTypeFunction %void %_arr_S_uint_4
         %103 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -120,43 +120,43 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %73 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %75 None
+               OpBranchConditional %73 %76 %75
+         %76 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %75 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_S %30 %40
+         %79 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %81 = OpLoad %S_std140 %79 None
+         %82 = OpFunctionCall %S %tint_convert_S %81
+               OpStore %77 %82 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %68 = OpLoad %v3float %66 None
-         %69 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %70 = OpLoad %v3float %69 None
-         %71 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %73 = OpLoad %v3float %71 None
-         %74 = OpCompositeConstruct %mat3v3float %68 %70 %73
-         %75 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
-         %76 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %75 %74
-         %78 = OpAccessChain %_ptr_StorageBuffer_v3float %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %80 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %81 = OpLoad %v3float %80 None
-         %82 = OpVectorShuffle %v3float %81 %81 2 0 1
-               OpStore %78 %82 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3float %56 None
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3float %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v3float %61 None
+         %64 = OpCompositeConstruct %mat3v3float %58 %60 %63
+         %65 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
+         %66 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %65 %64
+         %68 = OpAccessChain %_ptr_StorageBuffer_v3float %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %70 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %71 = OpLoad %v3float %70 None
+         %72 = OpVectorShuffle %v3float %71 %71 2 0 1
+               OpStore %68 %72 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %84
@@ -247,21 +247,21 @@
                OpLoopMerge %146 %144 None
                OpBranch %143
         %143 = OpLabel
-        %149 = OpUGreaterThanEqual %bool %147 %uint_4
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
+        %150 = OpUGreaterThanEqual %bool %147 %uint_4
+               OpSelectionMerge %151 None
+               OpBranchConditional %150 %152 %151
+        %152 = OpLabel
                OpBranch %146
-        %150 = OpLabel
-        %152 = OpAccessChain %_ptr_Function_S_std140 %138 %147
-        %153 = OpLoad %S_std140 %152 None
-        %154 = OpAccessChain %_ptr_Function_S_std140 %140 %147
-               OpStore %154 %153 None
+        %151 = OpLabel
+        %153 = OpAccessChain %_ptr_Function_S_std140 %138 %147
+        %154 = OpLoad %S_std140 %153 None
+        %155 = OpAccessChain %_ptr_Function_S_std140 %140 %147
+               OpStore %155 %154 None
                OpBranch %144
         %144 = OpLabel
         %148 = OpIAdd %uint %147 %uint_1
                OpBranch %145
         %146 = OpLabel
-        %155 = OpLoad %_arr_S_std140_uint_4_0 %140 None
-               OpReturnValue %155
+        %149 = OpLoad %_arr_S_std140_uint_4_0 %140 None
+               OpReturnValue %149
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
index be4cc1e..63b2d7c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -59,10 +59,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -70,14 +66,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat3v3float = OpTypePointer Workgroup %mat3v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
+       %bool = OpTypeBool
+         %82 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %93 = OpTypeFunction %void
          %98 = OpTypeFunction %S %S_std140
         %108 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -86,8 +86,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -96,69 +96,69 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %81 %82 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat3v3float %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v3float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v3float %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v3float %84 None
-         %86 = OpCompositeConstruct %mat3v3float %81 %83 %85
-               OpStore %76 %86 None
-         %87 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_1 %uint_0
-         %89 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v3float %89 None
-         %91 = OpVectorShuffle %v3float %90 %90 2 0 1
-               OpStore %87 %91 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %49
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_S %42 %50
+         %88 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %90 = OpLoad %S_std140 %88 None
+         %91 = OpFunctionCall %S %tint_convert_S %90
+               OpStore %86 %91 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat3v3float %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v3float %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v3float %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v3float %69 None
+         %71 = OpCompositeConstruct %mat3v3float %66 %68 %70
+               OpStore %61 %71 None
+         %72 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_1 %uint_0
+         %74 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v3float %74 None
+         %76 = OpVectorShuffle %v3float %75 %75 2 0 1
+               OpStore %72 %76 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %93
@@ -193,21 +193,21 @@
                OpLoopMerge %118 %116 None
                OpBranch %115
         %115 = OpLabel
-        %121 = OpUGreaterThanEqual %bool %119 %uint_4
-               OpSelectionMerge %122 None
-               OpBranchConditional %121 %123 %122
-        %123 = OpLabel
+        %122 = OpUGreaterThanEqual %bool %119 %uint_4
+               OpSelectionMerge %123 None
+               OpBranchConditional %122 %124 %123
+        %124 = OpLabel
                OpBranch %118
-        %122 = OpLabel
-        %124 = OpAccessChain %_ptr_Function_S_std140 %110 %119
-        %125 = OpLoad %S_std140 %124 None
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %119
-               OpStore %126 %125 None
+        %123 = OpLabel
+        %125 = OpAccessChain %_ptr_Function_S_std140 %110 %119
+        %126 = OpLoad %S_std140 %125 None
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %119
+               OpStore %127 %126 None
                OpBranch %116
         %116 = OpLabel
         %120 = OpIAdd %uint %119 %uint_1
                OpBranch %117
         %118 = OpLabel
-        %127 = OpLoad %_arr_S_std140_uint_4_0 %112 None
-               OpReturnValue %127
+        %121 = OpLoad %_arr_S_std140_uint_4_0 %112 None
+               OpReturnValue %121
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index e734a94..7692d21 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -97,12 +97,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %77 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %98 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %108 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %134 = OpTypeFunction %Inner %Inner_std140
@@ -128,8 +128,8 @@
          %55 = OpVariable %_ptr_Function_mat3v4half Function
          %69 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %71 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %77
-        %104 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %106 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+         %94 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %96 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -164,60 +164,60 @@
                OpLoopMerge %82 %80 None
                OpBranch %79
          %79 = OpLabel
-         %85 = OpUGreaterThanEqual %bool %83 %uint_4
-               OpSelectionMerge %87 None
-               OpBranchConditional %85 %88 %87
-         %88 = OpLabel
+        %114 = OpUGreaterThanEqual %bool %83 %uint_4
+               OpSelectionMerge %116 None
+               OpBranchConditional %114 %117 %116
+        %117 = OpLabel
                OpBranch %82
-         %87 = OpLabel
-         %89 = OpAccessChain %_ptr_Function_Outer %71 %83
-         %91 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
-         %93 = OpLoad %Outer_std140 %91 None
-         %94 = OpFunctionCall %Outer %tint_convert_Outer %93
-               OpStore %89 %94 None
+        %116 = OpLabel
+        %118 = OpAccessChain %_ptr_Function_Outer %71 %83
+        %120 = OpAccessChain %_ptr_Function_Outer_std140 %69 %83
+        %122 = OpLoad %Outer_std140 %120 None
+        %123 = OpFunctionCall %Outer %tint_convert_Outer %122
+               OpStore %118 %123 None
                OpBranch %80
          %80 = OpLabel
          %84 = OpIAdd %uint %83 %uint_1
                OpBranch %81
          %82 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %71 None
-         %97 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-         %98 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %97
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %98
-        %101 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %102 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %101
-               OpStore %104 %102
-               OpBranch %109
-        %109 = OpLabel
-               OpBranch %112
-        %112 = OpLabel
-        %114 = OpPhi %uint %uint_0 %109 %115 %111
-               OpLoopMerge %113 %111 None
-               OpBranch %110
-        %110 = OpLabel
-        %116 = OpUGreaterThanEqual %bool %114 %uint_4
-               OpSelectionMerge %117 None
-               OpBranchConditional %116 %118 %117
-        %118 = OpLabel
-               OpBranch %113
-        %117 = OpLabel
-        %119 = OpAccessChain %_ptr_Function_Inner %106 %114
-        %121 = OpAccessChain %_ptr_Function_Inner_std140 %104 %114
-        %123 = OpLoad %Inner_std140 %121 None
-        %124 = OpFunctionCall %Inner %tint_convert_Inner %123
-               OpStore %119 %124 None
-               OpBranch %111
-        %111 = OpLabel
-        %115 = OpIAdd %uint %114 %uint_1
-               OpBranch %112
-        %113 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %106 None
-        %127 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %127
-        %129 = OpFunctionCall %int %i
-        %130 = OpBitcast %uint %129
-        %131 = OpExtInst %uint %33 UMin %130 %uint_3
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %131
+         %86 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %87 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %86
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %87
+         %91 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %92 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %91
+               OpStore %94 %92
+               OpBranch %99
+         %99 = OpLabel
+               OpBranch %102
+        %102 = OpLabel
+        %104 = OpPhi %uint %uint_0 %99 %105 %101
+               OpLoopMerge %103 %101 None
+               OpBranch %100
+        %100 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %104 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
+               OpBranch %103
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_Inner %96 %104
+        %129 = OpAccessChain %_ptr_Function_Inner_std140 %94 %104
+        %131 = OpLoad %Inner_std140 %129 None
+        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
+               OpStore %127 %132 None
+               OpBranch %101
+        %101 = OpLabel
+        %105 = OpIAdd %uint %104 %uint_1
+               OpBranch %102
+        %103 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %96 None
+        %107 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %107
+        %110 = OpFunctionCall %int %i
+        %111 = OpBitcast %uint %110
+        %112 = OpExtInst %uint %33 UMin %111 %uint_3
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %112
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %134
@@ -234,7 +234,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %143 = OpLabel
         %145 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %108
+        %146 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %98
         %144 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %145 %144
                OpBranch %147
@@ -245,25 +245,25 @@
                OpLoopMerge %151 %149 None
                OpBranch %148
         %148 = OpLabel
-        %154 = OpUGreaterThanEqual %bool %152 %uint_4
-               OpSelectionMerge %155 None
-               OpBranchConditional %154 %156 %155
-        %156 = OpLabel
+        %156 = OpUGreaterThanEqual %bool %152 %uint_4
+               OpSelectionMerge %157 None
+               OpBranchConditional %156 %158 %157
+        %158 = OpLabel
                OpBranch %151
-        %155 = OpLabel
-        %157 = OpAccessChain %_ptr_Function_Inner %146 %152
-        %158 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
-        %159 = OpLoad %Inner_std140 %158 None
-        %160 = OpFunctionCall %Inner %tint_convert_Inner %159
-               OpStore %157 %160 None
+        %157 = OpLabel
+        %159 = OpAccessChain %_ptr_Function_Inner %146 %152
+        %160 = OpAccessChain %_ptr_Function_Inner_std140 %145 %152
+        %161 = OpLoad %Inner_std140 %160 None
+        %162 = OpFunctionCall %Inner %tint_convert_Inner %161
+               OpStore %159 %162 None
                OpBranch %149
         %149 = OpLabel
         %153 = OpIAdd %uint %152 %uint_1
                OpBranch %150
         %151 = OpLabel
-        %161 = OpLoad %_arr_Inner_uint_4 %146 None
-        %162 = OpCompositeConstruct %Outer %161
-               OpReturnValue %162
+        %154 = OpLoad %_arr_Inner_uint_4 %146 None
+        %155 = OpCompositeConstruct %Outer %154
+               OpReturnValue %155
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %164
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -279,23 +279,23 @@
                OpLoopMerge %174 %172 None
                OpBranch %171
         %171 = OpLabel
-        %177 = OpUGreaterThanEqual %bool %175 %uint_4
-               OpSelectionMerge %178 None
-               OpBranchConditional %177 %179 %178
-        %179 = OpLabel
+        %178 = OpUGreaterThanEqual %bool %175 %uint_4
+               OpSelectionMerge %179 None
+               OpBranchConditional %178 %180 %179
+        %180 = OpLabel
                OpBranch %174
-        %178 = OpLabel
-        %180 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
-        %181 = OpLoad %Inner_std140 %180 None
-        %182 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
-               OpStore %182 %181 None
+        %179 = OpLabel
+        %181 = OpAccessChain %_ptr_Function_Inner_std140 %166 %175
+        %182 = OpLoad %Inner_std140 %181 None
+        %183 = OpAccessChain %_ptr_Function_Inner_std140 %168 %175
+               OpStore %183 %182 None
                OpBranch %172
         %172 = OpLabel
         %176 = OpIAdd %uint %175 %uint_1
                OpBranch %173
         %174 = OpLabel
-        %183 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
-               OpReturnValue %183
+        %177 = OpLoad %_arr_Inner_std140_uint_4_0 %168 None
+               OpReturnValue %177
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %185
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -319,22 +319,22 @@
                OpLoopMerge %201 %199 None
                OpBranch %198
         %198 = OpLabel
-        %204 = OpUGreaterThanEqual %bool %202 %uint_4
-               OpSelectionMerge %205 None
-               OpBranchConditional %204 %206 %205
-        %206 = OpLabel
+        %205 = OpUGreaterThanEqual %bool %202 %uint_4
+               OpSelectionMerge %206 None
+               OpBranchConditional %205 %207 %206
+        %207 = OpLabel
                OpBranch %201
-        %205 = OpLabel
-        %207 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
-        %209 = OpLoad %Outer_std140_tint_explicit_layout %207 None
-        %210 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %209
-        %211 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
-               OpStore %211 %210 None
+        %206 = OpLabel
+        %208 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %193 %202
+        %210 = OpLoad %Outer_std140_tint_explicit_layout %208 None
+        %211 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %210
+        %212 = OpAccessChain %_ptr_Function_Outer_std140 %195 %202
+               OpStore %212 %211 None
                OpBranch %199
         %199 = OpLabel
         %203 = OpIAdd %uint %202 %uint_1
                OpBranch %200
         %201 = OpLabel
-        %212 = OpLoad %_arr_Outer_std140_uint_4 %195 None
-               OpReturnValue %212
+        %204 = OpLoad %_arr_Outer_std140_uint_4 %195 None
+               OpReturnValue %204
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.spvasm
index c605f3c..c08513a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -86,12 +86,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %52 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %73 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %83 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %106 = OpTypeFunction %Inner %Inner_std140
@@ -108,8 +108,8 @@
          %15 = OpLabel
          %44 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %46 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %52
-         %79 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %81 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+         %69 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %71 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -133,56 +133,56 @@
                OpLoopMerge %57 %55 None
                OpBranch %54
          %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %62 None
-               OpBranchConditional %60 %63 %62
-         %63 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %58 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %57
-         %62 = OpLabel
-         %64 = OpAccessChain %_ptr_Function_Outer %46 %58
-         %66 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
-         %68 = OpLoad %Outer_std140 %66 None
-         %69 = OpFunctionCall %Outer %tint_convert_Outer %68
-               OpStore %64 %69 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_Outer %46 %58
+         %92 = OpAccessChain %_ptr_Function_Outer_std140 %44 %58
+         %94 = OpLoad %Outer_std140 %92 None
+         %95 = OpFunctionCall %Outer %tint_convert_Outer %94
+               OpStore %90 %95 None
                OpBranch %55
          %55 = OpLabel
          %59 = OpIAdd %uint %58 %uint_1
                OpBranch %56
          %57 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %46 None
-         %72 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %73 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %72
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %73
-         %76 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %77 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %76
-               OpStore %79 %77
-               OpBranch %84
-         %84 = OpLabel
-               OpBranch %87
-         %87 = OpLabel
-         %89 = OpPhi %uint %uint_0 %84 %90 %86
-               OpLoopMerge %88 %86 None
-               OpBranch %85
-         %85 = OpLabel
-         %91 = OpUGreaterThanEqual %bool %89 %uint_4
-               OpSelectionMerge %92 None
-               OpBranchConditional %91 %93 %92
-         %93 = OpLabel
-               OpBranch %88
-         %92 = OpLabel
-         %94 = OpAccessChain %_ptr_Function_Inner %81 %89
-         %96 = OpAccessChain %_ptr_Function_Inner_std140 %79 %89
-         %98 = OpLoad %Inner_std140 %96 None
-         %99 = OpFunctionCall %Inner %tint_convert_Inner %98
-               OpStore %94 %99 None
-               OpBranch %86
-         %86 = OpLabel
-         %90 = OpIAdd %uint %89 %uint_1
-               OpBranch %87
-         %88 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %81 None
-        %102 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %102
+         %61 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %62 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %61
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %62
+         %66 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %67 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %66
+               OpStore %69 %67
+               OpBranch %74
+         %74 = OpLabel
+               OpBranch %77
+         %77 = OpLabel
+         %79 = OpPhi %uint %uint_0 %74 %80 %76
+               OpLoopMerge %78 %76 None
+               OpBranch %75
+         %75 = OpLabel
+         %96 = OpUGreaterThanEqual %bool %79 %uint_4
+               OpSelectionMerge %97 None
+               OpBranchConditional %96 %98 %97
+         %98 = OpLabel
+               OpBranch %78
+         %97 = OpLabel
+         %99 = OpAccessChain %_ptr_Function_Inner %71 %79
+        %101 = OpAccessChain %_ptr_Function_Inner_std140 %69 %79
+        %103 = OpLoad %Inner_std140 %101 None
+        %104 = OpFunctionCall %Inner %tint_convert_Inner %103
+               OpStore %99 %104 None
+               OpBranch %76
+         %76 = OpLabel
+         %80 = OpIAdd %uint %79 %uint_1
+               OpBranch %77
+         %78 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %71 None
+         %82 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %82
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -200,7 +200,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %115 = OpLabel
         %117 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %83
+        %118 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %73
         %116 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %117 %116
                OpBranch %119
@@ -211,25 +211,25 @@
                OpLoopMerge %123 %121 None
                OpBranch %120
         %120 = OpLabel
-        %126 = OpUGreaterThanEqual %bool %124 %uint_4
-               OpSelectionMerge %127 None
-               OpBranchConditional %126 %128 %127
-        %128 = OpLabel
+        %128 = OpUGreaterThanEqual %bool %124 %uint_4
+               OpSelectionMerge %129 None
+               OpBranchConditional %128 %130 %129
+        %130 = OpLabel
                OpBranch %123
-        %127 = OpLabel
-        %129 = OpAccessChain %_ptr_Function_Inner %118 %124
-        %130 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
-        %131 = OpLoad %Inner_std140 %130 None
-        %132 = OpFunctionCall %Inner %tint_convert_Inner %131
-               OpStore %129 %132 None
+        %129 = OpLabel
+        %131 = OpAccessChain %_ptr_Function_Inner %118 %124
+        %132 = OpAccessChain %_ptr_Function_Inner_std140 %117 %124
+        %133 = OpLoad %Inner_std140 %132 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %131 %134 None
                OpBranch %121
         %121 = OpLabel
         %125 = OpIAdd %uint %124 %uint_1
                OpBranch %122
         %123 = OpLabel
-        %133 = OpLoad %_arr_Inner_uint_4 %118 None
-        %134 = OpCompositeConstruct %Outer %133
-               OpReturnValue %134
+        %126 = OpLoad %_arr_Inner_uint_4 %118 None
+        %127 = OpCompositeConstruct %Outer %126
+               OpReturnValue %127
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %136
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -245,23 +245,23 @@
                OpLoopMerge %146 %144 None
                OpBranch %143
         %143 = OpLabel
-        %149 = OpUGreaterThanEqual %bool %147 %uint_4
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
+        %150 = OpUGreaterThanEqual %bool %147 %uint_4
+               OpSelectionMerge %151 None
+               OpBranchConditional %150 %152 %151
+        %152 = OpLabel
                OpBranch %146
-        %150 = OpLabel
-        %152 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
-        %153 = OpLoad %Inner_std140 %152 None
-        %154 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
-               OpStore %154 %153 None
+        %151 = OpLabel
+        %153 = OpAccessChain %_ptr_Function_Inner_std140 %138 %147
+        %154 = OpLoad %Inner_std140 %153 None
+        %155 = OpAccessChain %_ptr_Function_Inner_std140 %140 %147
+               OpStore %155 %154 None
                OpBranch %144
         %144 = OpLabel
         %148 = OpIAdd %uint %147 %uint_1
                OpBranch %145
         %146 = OpLabel
-        %155 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
-               OpReturnValue %155
+        %149 = OpLoad %_arr_Inner_std140_uint_4_0 %140 None
+               OpReturnValue %149
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %157
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -285,22 +285,22 @@
                OpLoopMerge %173 %171 None
                OpBranch %170
         %170 = OpLabel
-        %176 = OpUGreaterThanEqual %bool %174 %uint_4
-               OpSelectionMerge %177 None
-               OpBranchConditional %176 %178 %177
-        %178 = OpLabel
+        %177 = OpUGreaterThanEqual %bool %174 %uint_4
+               OpSelectionMerge %178 None
+               OpBranchConditional %177 %179 %178
+        %179 = OpLabel
                OpBranch %173
-        %177 = OpLabel
-        %179 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
-        %181 = OpLoad %Outer_std140_tint_explicit_layout %179 None
-        %182 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %181
-        %183 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
-               OpStore %183 %182 None
+        %178 = OpLabel
+        %180 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %165 %174
+        %182 = OpLoad %Outer_std140_tint_explicit_layout %180 None
+        %183 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %182
+        %184 = OpAccessChain %_ptr_Function_Outer_std140 %167 %174
+               OpStore %184 %183 None
                OpBranch %171
         %171 = OpLabel
         %175 = OpIAdd %uint %174 %uint_1
                OpBranch %172
         %173 = OpLabel
-        %184 = OpLoad %_arr_Outer_std140_uint_4 %167 None
-               OpReturnValue %184
+        %176 = OpLoad %_arr_Outer_std140_uint_4 %167 None
+               OpReturnValue %176
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.spvasm
index a2e2b45..d39a4e0 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.spvasm
@@ -74,14 +74,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %97 = OpTypeFunction %S %S_std140
         %107 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -127,45 +127,45 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %86 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %88 None
+               OpBranchConditional %86 %89 %88
+         %89 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %88 = OpLabel
+         %90 = OpAccessChain %_ptr_Function_S %47 %55
+         %92 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %94 = OpLoad %S_std140 %92 None
+         %95 = OpFunctionCall %S %tint_convert_S %94
+               OpStore %90 %95 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v4half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v4half %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v4half %82 None
-         %85 = OpCompositeConstruct %mat3v4half %79 %81 %84
-         %86 = OpFunctionCall %void %c %85
-         %87 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %88 = OpLoad %v4half %87 None
-         %89 = OpVectorShuffle %v4half %88 %88 1 3 0 2
-         %90 = OpFunctionCall %void %d %89
-         %91 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v4half %91 None
-         %93 = OpVectorShuffle %v4half %92 %92 1 3 0 2
-         %94 = OpCompositeExtract %half %93 0
-         %95 = OpFunctionCall %void %e %94
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v4half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v4half %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v4half %72 None
+         %75 = OpCompositeConstruct %mat3v4half %69 %71 %74
+         %76 = OpFunctionCall %void %c %75
+         %77 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %78 = OpLoad %v4half %77 None
+         %79 = OpVectorShuffle %v4half %78 %78 1 3 0 2
+         %80 = OpFunctionCall %void %d %79
+         %81 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %82 = OpLoad %v4half %81 None
+         %83 = OpVectorShuffle %v4half %82 %82 1 3 0 2
+         %84 = OpCompositeExtract %half %83 0
+         %85 = OpFunctionCall %void %e %84
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %97
@@ -194,21 +194,21 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_S_std140 %109 %118
-        %124 = OpLoad %S_std140 %123 None
-        %125 = OpAccessChain %_ptr_Function_S_std140 %111 %118
-               OpStore %125 %124 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_S_std140 %109 %118
+        %125 = OpLoad %S_std140 %124 None
+        %126 = OpAccessChain %_ptr_Function_S_std140 %111 %118
+               OpStore %126 %125 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %126 = OpLoad %_arr_S_std140_uint_4_0 %111 None
-               OpReturnValue %126
+        %120 = OpLoad %_arr_S_std140_uint_4_0 %111 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.spvasm
index 2445a77..64cf638 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.spvasm
@@ -62,17 +62,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat3v4half = OpTypePointer Private %mat3v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_Private_v4half = OpTypePointer Private %v4half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %76 = OpTypeFunction %S %S_std140
          %86 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -93,43 +93,43 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %65 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %67 None
+               OpBranchConditional %65 %68 %67
+         %68 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %67 = OpLabel
+         %69 = OpAccessChain %_ptr_Function_S %30 %37
+         %71 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %73 = OpLoad %S_std140 %71 None
+         %74 = OpFunctionCall %S %tint_convert_S %73
+               OpStore %69 %74 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat3v4half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v4half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v4half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v4half %67 None
-         %69 = OpCompositeConstruct %mat3v4half %64 %66 %68
-               OpStore %59 %69 None
-         %70 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %73 = OpLoad %v4half %72 None
-         %74 = OpVectorShuffle %v4half %73 %73 1 3 0 2
-               OpStore %70 %74 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat3v4half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v4half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v4half %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v4half %57 None
+         %59 = OpCompositeConstruct %mat3v4half %54 %56 %58
+               OpStore %49 %59 None
+         %60 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_1 %uint_0
+         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %63 = OpLoad %v4half %62 None
+         %64 = OpVectorShuffle %v4half %63 %63 1 3 0 2
+               OpStore %60 %64 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %76
@@ -158,21 +158,21 @@
                OpLoopMerge %96 %94 None
                OpBranch %93
          %93 = OpLabel
-         %99 = OpUGreaterThanEqual %bool %97 %uint_4
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %100 = OpUGreaterThanEqual %bool %97 %uint_4
+               OpSelectionMerge %101 None
+               OpBranchConditional %100 %102 %101
+        %102 = OpLabel
                OpBranch %96
-        %100 = OpLabel
-        %102 = OpAccessChain %_ptr_Function_S_std140 %88 %97
-        %103 = OpLoad %S_std140 %102 None
-        %104 = OpAccessChain %_ptr_Function_S_std140 %90 %97
-               OpStore %104 %103 None
+        %101 = OpLabel
+        %103 = OpAccessChain %_ptr_Function_S_std140 %88 %97
+        %104 = OpLoad %S_std140 %103 None
+        %105 = OpAccessChain %_ptr_Function_S_std140 %90 %97
+               OpStore %105 %104 None
                OpBranch %94
          %94 = OpLabel
          %98 = OpIAdd %uint %97 %uint_1
                OpBranch %95
          %96 = OpLabel
-        %105 = OpLoad %_arr_S_std140_uint_4_0 %90 None
-               OpReturnValue %105
+         %99 = OpLoad %_arr_S_std140_uint_4_0 %90 None
+               OpReturnValue %99
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.spvasm
index c1e9aaf..6dd3628 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.spvasm
@@ -86,17 +86,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat3v4half = OpTypePointer StorageBuffer %mat3v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %83 = OpTypeFunction %void %_arr_S_uint_4
         %102 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -120,43 +120,43 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %72 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %74 None
+               OpBranchConditional %72 %75 %74
+         %75 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %74 = OpLabel
+         %76 = OpAccessChain %_ptr_Function_S %30 %40
+         %78 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %80 = OpLoad %S_std140 %78 None
+         %81 = OpFunctionCall %S %tint_convert_S %80
+               OpStore %76 %81 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat3v4half %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v4half %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v4half %72 None
-         %74 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %75 = OpLoad %v4half %74 None
-         %76 = OpCompositeConstruct %mat3v4half %71 %73 %75
-               OpStore %66 %76 None
-         %77 = OpAccessChain %_ptr_StorageBuffer_v4half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %80 = OpLoad %v4half %79 None
-         %81 = OpVectorShuffle %v4half %80 %80 1 3 0 2
-               OpStore %77 %81 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat3v4half %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v4half %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v4half %62 None
+         %64 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %65 = OpLoad %v4half %64 None
+         %66 = OpCompositeConstruct %mat3v4half %61 %63 %65
+               OpStore %56 %66 None
+         %67 = OpAccessChain %_ptr_StorageBuffer_v4half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %70 = OpLoad %v4half %69 None
+         %71 = OpVectorShuffle %v4half %70 %70 1 3 0 2
+               OpStore %67 %71 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %83
@@ -231,21 +231,21 @@
                OpLoopMerge %133 %131 None
                OpBranch %130
         %130 = OpLabel
-        %136 = OpUGreaterThanEqual %bool %134 %uint_4
-               OpSelectionMerge %137 None
-               OpBranchConditional %136 %138 %137
-        %138 = OpLabel
+        %137 = OpUGreaterThanEqual %bool %134 %uint_4
+               OpSelectionMerge %138 None
+               OpBranchConditional %137 %139 %138
+        %139 = OpLabel
                OpBranch %133
-        %137 = OpLabel
-        %139 = OpAccessChain %_ptr_Function_S_std140 %125 %134
-        %140 = OpLoad %S_std140 %139 None
-        %141 = OpAccessChain %_ptr_Function_S_std140 %127 %134
-               OpStore %141 %140 None
+        %138 = OpLabel
+        %140 = OpAccessChain %_ptr_Function_S_std140 %125 %134
+        %141 = OpLoad %S_std140 %140 None
+        %142 = OpAccessChain %_ptr_Function_S_std140 %127 %134
+               OpStore %142 %141 None
                OpBranch %131
         %131 = OpLabel
         %135 = OpIAdd %uint %134 %uint_1
                OpBranch %132
         %133 = OpLabel
-        %142 = OpLoad %_arr_S_std140_uint_4_0 %127 None
-               OpReturnValue %142
+        %136 = OpLoad %_arr_S_std140_uint_4_0 %127 None
+               OpReturnValue %136
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.spvasm
index d36cd56..c56d616 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -62,10 +62,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -73,14 +69,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat3v4half = OpTypePointer Workgroup %mat3v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
+       %bool = OpTypeBool
+         %82 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %93 = OpTypeFunction %void
          %98 = OpTypeFunction %S %S_std140
         %108 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -89,8 +89,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -99,69 +99,69 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %77 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %79 None
+               OpBranchConditional %77 %80 %79
+         %80 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %79 = OpLabel
+         %81 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %81 %82 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat3v4half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v4half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v4half %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v4half %84 None
-         %86 = OpCompositeConstruct %mat3v4half %81 %83 %85
-               OpStore %76 %86 None
-         %87 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_1 %uint_0
-         %89 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v4half %89 None
-         %91 = OpVectorShuffle %v4half %90 %90 1 3 0 2
-               OpStore %87 %91 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %83 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %49
+         %84 = OpLabel
+         %86 = OpAccessChain %_ptr_Function_S %42 %50
+         %88 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %90 = OpLoad %S_std140 %88 None
+         %91 = OpFunctionCall %S %tint_convert_S %90
+               OpStore %86 %91 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat3v4half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v4half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v4half %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v4half %69 None
+         %71 = OpCompositeConstruct %mat3v4half %66 %68 %70
+               OpStore %61 %71 None
+         %72 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_1 %uint_0
+         %74 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %75 = OpLoad %v4half %74 None
+         %76 = OpVectorShuffle %v4half %75 %75 1 3 0 2
+               OpStore %72 %76 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %93
@@ -196,21 +196,21 @@
                OpLoopMerge %118 %116 None
                OpBranch %115
         %115 = OpLabel
-        %121 = OpUGreaterThanEqual %bool %119 %uint_4
-               OpSelectionMerge %122 None
-               OpBranchConditional %121 %123 %122
-        %123 = OpLabel
+        %122 = OpUGreaterThanEqual %bool %119 %uint_4
+               OpSelectionMerge %123 None
+               OpBranchConditional %122 %124 %123
+        %124 = OpLabel
                OpBranch %118
-        %122 = OpLabel
-        %124 = OpAccessChain %_ptr_Function_S_std140 %110 %119
-        %125 = OpLoad %S_std140 %124 None
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %119
-               OpStore %126 %125 None
+        %123 = OpLabel
+        %125 = OpAccessChain %_ptr_Function_S_std140 %110 %119
+        %126 = OpLoad %S_std140 %125 None
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %119
+               OpStore %127 %126 None
                OpBranch %116
         %116 = OpLabel
         %120 = OpIAdd %uint %119 %uint_1
                OpBranch %117
         %118 = OpLabel
-        %127 = OpLoad %_arr_S_std140_uint_4_0 %112 None
-               OpReturnValue %127
+        %121 = OpLoad %_arr_S_std140_uint_4_0 %112 None
+               OpReturnValue %121
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index da51a53..3c8b056 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -151,23 +151,23 @@
                OpLoopMerge %86 %84 None
                OpBranch %83
          %83 = OpLabel
-         %89 = OpUGreaterThanEqual %bool %87 %uint_4
-               OpSelectionMerge %91 None
-               OpBranchConditional %89 %92 %91
-         %92 = OpLabel
+         %90 = OpUGreaterThanEqual %bool %87 %uint_4
+               OpSelectionMerge %92 None
+               OpBranchConditional %90 %93 %92
+         %93 = OpLabel
                OpBranch %86
-         %91 = OpLabel
-         %93 = OpAccessChain %_ptr_Function_Inner %77 %87
-         %95 = OpLoad %Inner %93 None
-         %96 = OpAccessChain %_ptr_Function_Inner %79 %87
-               OpStore %96 %95 None
+         %92 = OpLabel
+         %94 = OpAccessChain %_ptr_Function_Inner %77 %87
+         %96 = OpLoad %Inner %94 None
+         %97 = OpAccessChain %_ptr_Function_Inner %79 %87
+               OpStore %97 %96 None
                OpBranch %84
          %84 = OpLabel
          %88 = OpIAdd %uint %87 %uint_1
                OpBranch %85
          %86 = OpLabel
-         %98 = OpLoad %_arr_Inner_uint_4_0 %79 None
-               OpReturnValue %98
+         %89 = OpLoad %_arr_Inner_uint_4_0 %79 None
+               OpReturnValue %89
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer None %100
 %tint_source_0 = OpFunctionParameter %Outer_tint_explicit_layout
@@ -191,22 +191,22 @@
                OpLoopMerge %117 %115 None
                OpBranch %114
         %114 = OpLabel
-        %120 = OpUGreaterThanEqual %bool %118 %uint_4
-               OpSelectionMerge %121 None
-               OpBranchConditional %120 %122 %121
-        %122 = OpLabel
+        %121 = OpUGreaterThanEqual %bool %118 %uint_4
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
                OpBranch %117
-        %121 = OpLabel
-        %123 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %108 %118
-        %125 = OpLoad %Outer_tint_explicit_layout %123 None
-        %126 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %125
-        %127 = OpAccessChain %_ptr_Function_Outer %110 %118
-               OpStore %127 %126 None
+        %122 = OpLabel
+        %124 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %108 %118
+        %126 = OpLoad %Outer_tint_explicit_layout %124 None
+        %127 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %126
+        %128 = OpAccessChain %_ptr_Function_Outer %110 %118
+               OpStore %128 %127 None
                OpBranch %115
         %115 = OpLabel
         %119 = OpIAdd %uint %118 %uint_1
                OpBranch %116
         %117 = OpLabel
-        %129 = OpLoad %_arr_Outer_uint_4 %110 None
-               OpReturnValue %129
+        %120 = OpLoad %_arr_Outer_uint_4 %110 None
+               OpReturnValue %120
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm
index 8f4fccc..abd998d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -122,23 +122,23 @@
                OpLoopMerge %63 %61 None
                OpBranch %60
          %60 = OpLabel
-         %66 = OpUGreaterThanEqual %bool %64 %uint_4
-               OpSelectionMerge %68 None
-               OpBranchConditional %66 %69 %68
-         %69 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %64 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %63
-         %68 = OpLabel
-         %70 = OpAccessChain %_ptr_Function_Inner %54 %64
-         %72 = OpLoad %Inner %70 None
-         %73 = OpAccessChain %_ptr_Function_Inner %56 %64
-               OpStore %73 %72 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_Inner %54 %64
+         %73 = OpLoad %Inner %71 None
+         %74 = OpAccessChain %_ptr_Function_Inner %56 %64
+               OpStore %74 %73 None
                OpBranch %61
          %61 = OpLabel
          %65 = OpIAdd %uint %64 %uint_1
                OpBranch %62
          %63 = OpLabel
-         %74 = OpLoad %_arr_Inner_uint_4_0 %56 None
-               OpReturnValue %74
+         %66 = OpLoad %_arr_Inner_uint_4_0 %56 None
+               OpReturnValue %66
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer None %76
 %tint_source_0 = OpFunctionParameter %Outer_tint_explicit_layout
@@ -162,22 +162,22 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %84 %94
-        %101 = OpLoad %Outer_tint_explicit_layout %99 None
-        %102 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %101
-        %103 = OpAccessChain %_ptr_Function_Outer %86 %94
-               OpStore %103 %102 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %84 %94
+        %102 = OpLoad %Outer_tint_explicit_layout %100 None
+        %103 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %102
+        %104 = OpAccessChain %_ptr_Function_Outer %86 %94
+               OpStore %104 %103 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %105 = OpLoad %_arr_Outer_uint_4 %86 None
-               OpReturnValue %105
+         %96 = OpLoad %_arr_Outer_uint_4 %86 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.spvasm
index 7cd5e81..5ac83ab 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.spvasm
@@ -131,21 +131,21 @@
                OpLoopMerge %76 %74 None
                OpBranch %73
          %73 = OpLabel
-         %79 = OpUGreaterThanEqual %bool %77 %uint_4
-               OpSelectionMerge %81 None
-               OpBranchConditional %79 %82 %81
-         %82 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %80 %83 %82
+         %83 = OpLabel
                OpBranch %76
-         %81 = OpLabel
-         %83 = OpAccessChain %_ptr_Function_S %67 %77
-         %85 = OpLoad %S %83 None
-         %86 = OpAccessChain %_ptr_Function_S %69 %77
-               OpStore %86 %85 None
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %67 %77
+         %86 = OpLoad %S %84 None
+         %87 = OpAccessChain %_ptr_Function_S %69 %77
+               OpStore %87 %86 None
                OpBranch %74
          %74 = OpLabel
          %78 = OpIAdd %uint %77 %uint_1
                OpBranch %75
          %76 = OpLabel
-         %87 = OpLoad %_arr_S_uint_4_0 %69 None
-               OpReturnValue %87
+         %79 = OpLoad %_arr_S_uint_4_0 %69 None
+               OpReturnValue %79
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.spvasm
index f5c87de..a5bccb4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.spvasm
@@ -115,22 +115,22 @@
                OpLoopMerge %66 %64 None
                OpBranch %63
          %63 = OpLabel
-         %69 = OpUGreaterThanEqual %bool %67 %uint_4
-               OpSelectionMerge %71 None
-               OpBranchConditional %69 %72 %71
-         %72 = OpLabel
+         %70 = OpUGreaterThanEqual %bool %67 %uint_4
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %73 %72
+         %73 = OpLabel
                OpBranch %66
-         %71 = OpLabel
-         %73 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %58 %67
-         %75 = OpLoad %S_tint_explicit_layout %73 None
-         %76 = OpFunctionCall %S %tint_convert_explicit_layout %75
-         %77 = OpAccessChain %_ptr_Function_S %60 %67
-               OpStore %77 %76 None
+         %72 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %58 %67
+         %76 = OpLoad %S_tint_explicit_layout %74 None
+         %77 = OpFunctionCall %S %tint_convert_explicit_layout %76
+         %78 = OpAccessChain %_ptr_Function_S %60 %67
+               OpStore %78 %77 None
                OpBranch %64
          %64 = OpLabel
          %68 = OpIAdd %uint %67 %uint_1
                OpBranch %65
          %66 = OpLabel
-         %79 = OpLoad %_arr_S_uint_4 %60 None
-               OpReturnValue %79
+         %69 = OpLoad %_arr_S_uint_4 %60 None
+               OpReturnValue %69
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.spvasm
index 0899898..a658144 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.spvasm
@@ -157,21 +157,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S %85 %94
-        %100 = OpLoad %S %99 None
-        %101 = OpAccessChain %_ptr_Function_S %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S %85 %94
+        %101 = OpLoad %S %100 None
+        %102 = OpAccessChain %_ptr_Function_S %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
index d01aab6..e28aaa1 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -57,20 +57,20 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 = OpTypePointer Uniform %_arr_S_tint_explicit_layout_uint_4
      %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_tint_explicit_layout = OpTypePointer Uniform %S_tint_explicit_layout
 %_ptr_Workgroup_mat3v4float = OpTypePointer Workgroup %mat3v4float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_mat3v4float = OpTypePointer Uniform %mat3v4float
 %_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+       %bool = OpTypeBool
+         %64 = OpConstantNull %S
          %66 = OpTypeFunction %void
          %71 = OpTypeFunction %S %S_tint_explicit_layout
          %78 = OpTypeFunction %_arr_S_uint_4 %_arr_S_tint_explicit_layout_uint_4
@@ -90,38 +90,38 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %59 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %61
+         %62 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %61 = OpLabel
+         %63 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %63 %64 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_tint_explicit_layout_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_uint_4 %tint_convert_explicit_layout_0 %44
-               OpStore %w %45 None
-         %47 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_S_tint_explicit_layout %1 %uint_0 %uint_2
-         %50 = OpLoad %S_tint_explicit_layout %48 None
-         %51 = OpFunctionCall %S %tint_convert_explicit_layout %50
-               OpStore %47 %51 None
-         %53 = OpAccessChain %_ptr_Workgroup_mat3v4float %w %uint_3 %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_mat3v4float %1 %uint_0 %uint_2 %uint_1
-         %58 = OpLoad %mat3v4float %56 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_tint_explicit_layout_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_uint_4 %tint_convert_explicit_layout_0 %36
+               OpStore %w %37 None
+         %39 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_S_tint_explicit_layout %1 %uint_0 %uint_2
+         %44 = OpLoad %S_tint_explicit_layout %42 None
+         %45 = OpFunctionCall %S %tint_convert_explicit_layout %44
+               OpStore %39 %45 None
+         %47 = OpAccessChain %_ptr_Workgroup_mat3v4float %w %uint_3 %uint_1
+         %50 = OpAccessChain %_ptr_Uniform_mat3v4float %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %mat3v4float %50 None
+               OpStore %47 %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_1 %uint_0
+         %55 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1 %uint_1
+         %57 = OpLoad %v4float %55 None
+         %58 = OpVectorShuffle %v4float %57 %57 1 3 0 2
                OpStore %53 %58 None
-         %59 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_1 %uint_0
-         %61 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1 %uint_1
-         %63 = OpLoad %v4float %61 None
-         %64 = OpVectorShuffle %v4float %63 %63 1 3 0 2
-               OpStore %59 %64 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %66
@@ -153,22 +153,22 @@
                OpLoopMerge %89 %87 None
                OpBranch %86
          %86 = OpLabel
-         %92 = OpUGreaterThanEqual %bool %90 %uint_4
-               OpSelectionMerge %93 None
-               OpBranchConditional %92 %94 %93
-         %94 = OpLabel
+         %93 = OpUGreaterThanEqual %bool %90 %uint_4
+               OpSelectionMerge %94 None
+               OpBranchConditional %93 %95 %94
+         %95 = OpLabel
                OpBranch %89
-         %93 = OpLabel
-         %95 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %80 %90
-         %97 = OpLoad %S_tint_explicit_layout %95 None
-         %98 = OpFunctionCall %S %tint_convert_explicit_layout %97
-         %99 = OpAccessChain %_ptr_Function_S %82 %90
-               OpStore %99 %98 None
+         %94 = OpLabel
+         %96 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %80 %90
+         %98 = OpLoad %S_tint_explicit_layout %96 None
+         %99 = OpFunctionCall %S %tint_convert_explicit_layout %98
+        %100 = OpAccessChain %_ptr_Function_S %82 %90
+               OpStore %100 %99 None
                OpBranch %87
          %87 = OpLabel
          %91 = OpIAdd %uint %90 %uint_1
                OpBranch %88
          %89 = OpLabel
-        %101 = OpLoad %_arr_S_uint_4 %82 None
-               OpReturnValue %101
+         %92 = OpLoad %_arr_S_uint_4 %82 None
+               OpReturnValue %92
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 00b95db..ccc4c2d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -99,12 +99,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %79 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+        %100 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %110 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %136 = OpTypeFunction %Inner %Inner_std140
@@ -130,8 +130,8 @@
          %57 = OpVariable %_ptr_Function_mat4v2half Function
          %71 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %73 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %79
-        %106 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %108 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+         %96 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %98 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -168,60 +168,60 @@
                OpLoopMerge %84 %82 None
                OpBranch %81
          %81 = OpLabel
-         %87 = OpUGreaterThanEqual %bool %85 %uint_4
-               OpSelectionMerge %89 None
-               OpBranchConditional %87 %90 %89
-         %90 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %85 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %116 %119 %118
+        %119 = OpLabel
                OpBranch %84
-         %89 = OpLabel
-         %91 = OpAccessChain %_ptr_Function_Outer %73 %85
-         %93 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
-         %95 = OpLoad %Outer_std140 %93 None
-         %96 = OpFunctionCall %Outer %tint_convert_Outer %95
-               OpStore %91 %96 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_Outer %73 %85
+        %122 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
+        %124 = OpLoad %Outer_std140 %122 None
+        %125 = OpFunctionCall %Outer %tint_convert_Outer %124
+               OpStore %120 %125 None
                OpBranch %82
          %82 = OpLabel
          %86 = OpIAdd %uint %85 %uint_1
                OpBranch %83
          %84 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %73 None
-         %99 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-        %100 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %99
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %100
-        %103 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %104 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %103
-               OpStore %106 %104
-               OpBranch %111
-        %111 = OpLabel
-               OpBranch %114
-        %114 = OpLabel
-        %116 = OpPhi %uint %uint_0 %111 %117 %113
-               OpLoopMerge %115 %113 None
-               OpBranch %112
-        %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
-               OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_Inner %108 %116
-        %123 = OpAccessChain %_ptr_Function_Inner_std140 %106 %116
-        %125 = OpLoad %Inner_std140 %123 None
-        %126 = OpFunctionCall %Inner %tint_convert_Inner %125
-               OpStore %121 %126 None
-               OpBranch %113
-        %113 = OpLabel
-        %117 = OpIAdd %uint %116 %uint_1
-               OpBranch %114
-        %115 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %108 None
-        %129 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %129
-        %131 = OpFunctionCall %int %i
-        %132 = OpBitcast %uint %131
-        %133 = OpExtInst %uint %33 UMin %132 %uint_1
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %133
+         %88 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %89 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %88
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %89
+         %93 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %94 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %93
+               OpStore %96 %94
+               OpBranch %101
+        %101 = OpLabel
+               OpBranch %104
+        %104 = OpLabel
+        %106 = OpPhi %uint %uint_0 %101 %107 %103
+               OpLoopMerge %105 %103 None
+               OpBranch %102
+        %102 = OpLabel
+        %126 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %127 None
+               OpBranchConditional %126 %128 %127
+        %128 = OpLabel
+               OpBranch %105
+        %127 = OpLabel
+        %129 = OpAccessChain %_ptr_Function_Inner %98 %106
+        %131 = OpAccessChain %_ptr_Function_Inner_std140 %96 %106
+        %133 = OpLoad %Inner_std140 %131 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %129 %134 None
+               OpBranch %103
+        %103 = OpLabel
+        %107 = OpIAdd %uint %106 %uint_1
+               OpBranch %104
+        %105 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %98 None
+        %109 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %109
+        %112 = OpFunctionCall %int %i
+        %113 = OpBitcast %uint %112
+        %114 = OpExtInst %uint %33 UMin %113 %uint_1
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %114
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %136
@@ -239,7 +239,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %146 = OpLabel
         %148 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
         %147 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %148 %147
                OpBranch %150
@@ -250,25 +250,25 @@
                OpLoopMerge %154 %152 None
                OpBranch %151
         %151 = OpLabel
-        %157 = OpUGreaterThanEqual %bool %155 %uint_4
-               OpSelectionMerge %158 None
-               OpBranchConditional %157 %159 %158
-        %159 = OpLabel
+        %159 = OpUGreaterThanEqual %bool %155 %uint_4
+               OpSelectionMerge %160 None
+               OpBranchConditional %159 %161 %160
+        %161 = OpLabel
                OpBranch %154
-        %158 = OpLabel
-        %160 = OpAccessChain %_ptr_Function_Inner %149 %155
-        %161 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
-        %162 = OpLoad %Inner_std140 %161 None
-        %163 = OpFunctionCall %Inner %tint_convert_Inner %162
-               OpStore %160 %163 None
+        %160 = OpLabel
+        %162 = OpAccessChain %_ptr_Function_Inner %149 %155
+        %163 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
+        %164 = OpLoad %Inner_std140 %163 None
+        %165 = OpFunctionCall %Inner %tint_convert_Inner %164
+               OpStore %162 %165 None
                OpBranch %152
         %152 = OpLabel
         %156 = OpIAdd %uint %155 %uint_1
                OpBranch %153
         %154 = OpLabel
-        %164 = OpLoad %_arr_Inner_uint_4 %149 None
-        %165 = OpCompositeConstruct %Outer %164
-               OpReturnValue %165
+        %157 = OpLoad %_arr_Inner_uint_4 %149 None
+        %158 = OpCompositeConstruct %Outer %157
+               OpReturnValue %158
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %167
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -284,23 +284,23 @@
                OpLoopMerge %177 %175 None
                OpBranch %174
         %174 = OpLabel
-        %180 = OpUGreaterThanEqual %bool %178 %uint_4
-               OpSelectionMerge %181 None
-               OpBranchConditional %180 %182 %181
-        %182 = OpLabel
+        %181 = OpUGreaterThanEqual %bool %178 %uint_4
+               OpSelectionMerge %182 None
+               OpBranchConditional %181 %183 %182
+        %183 = OpLabel
                OpBranch %177
-        %181 = OpLabel
-        %183 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
-        %184 = OpLoad %Inner_std140 %183 None
-        %185 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
-               OpStore %185 %184 None
+        %182 = OpLabel
+        %184 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
+        %185 = OpLoad %Inner_std140 %184 None
+        %186 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
+               OpStore %186 %185 None
                OpBranch %175
         %175 = OpLabel
         %179 = OpIAdd %uint %178 %uint_1
                OpBranch %176
         %177 = OpLabel
-        %186 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
-               OpReturnValue %186
+        %180 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
+               OpReturnValue %180
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %188
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -324,22 +324,22 @@
                OpLoopMerge %204 %202 None
                OpBranch %201
         %201 = OpLabel
-        %207 = OpUGreaterThanEqual %bool %205 %uint_4
-               OpSelectionMerge %208 None
-               OpBranchConditional %207 %209 %208
-        %209 = OpLabel
+        %208 = OpUGreaterThanEqual %bool %205 %uint_4
+               OpSelectionMerge %209 None
+               OpBranchConditional %208 %210 %209
+        %210 = OpLabel
                OpBranch %204
-        %208 = OpLabel
-        %210 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
-        %212 = OpLoad %Outer_std140_tint_explicit_layout %210 None
-        %213 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %212
-        %214 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
-               OpStore %214 %213 None
+        %209 = OpLabel
+        %211 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
+        %213 = OpLoad %Outer_std140_tint_explicit_layout %211 None
+        %214 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %213
+        %215 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
+               OpStore %215 %214 None
                OpBranch %202
         %202 = OpLabel
         %206 = OpIAdd %uint %205 %uint_1
                OpBranch %203
         %204 = OpLabel
-        %215 = OpLoad %_arr_Outer_std140_uint_4 %198 None
-               OpReturnValue %215
+        %207 = OpLoad %_arr_Outer_std140_uint_4 %198 None
+               OpReturnValue %207
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm
index a008118..ee5e82c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -88,12 +88,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %54 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %75 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %85 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %108 = OpTypeFunction %Inner %Inner_std140
@@ -110,8 +110,8 @@
          %15 = OpLabel
          %46 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %48 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %54
-         %81 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %83 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+         %71 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %73 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -137,56 +137,56 @@
                OpLoopMerge %59 %57 None
                OpBranch %56
          %56 = OpLabel
-         %62 = OpUGreaterThanEqual %bool %60 %uint_4
-               OpSelectionMerge %64 None
-               OpBranchConditional %62 %65 %64
-         %65 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %60 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %59
-         %64 = OpLabel
-         %66 = OpAccessChain %_ptr_Function_Outer %48 %60
-         %68 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
-         %70 = OpLoad %Outer_std140 %68 None
-         %71 = OpFunctionCall %Outer %tint_convert_Outer %70
-               OpStore %66 %71 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_Outer %48 %60
+         %94 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
+         %96 = OpLoad %Outer_std140 %94 None
+         %97 = OpFunctionCall %Outer %tint_convert_Outer %96
+               OpStore %92 %97 None
                OpBranch %57
          %57 = OpLabel
          %61 = OpIAdd %uint %60 %uint_1
                OpBranch %58
          %59 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %48 None
-         %74 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %75 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %74
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %75
-         %78 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %79 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %78
-               OpStore %81 %79
-               OpBranch %86
-         %86 = OpLabel
-               OpBranch %89
-         %89 = OpLabel
-         %91 = OpPhi %uint %uint_0 %86 %92 %88
-               OpLoopMerge %90 %88 None
-               OpBranch %87
-         %87 = OpLabel
-         %93 = OpUGreaterThanEqual %bool %91 %uint_4
-               OpSelectionMerge %94 None
-               OpBranchConditional %93 %95 %94
-         %95 = OpLabel
-               OpBranch %90
-         %94 = OpLabel
-         %96 = OpAccessChain %_ptr_Function_Inner %83 %91
-         %98 = OpAccessChain %_ptr_Function_Inner_std140 %81 %91
-        %100 = OpLoad %Inner_std140 %98 None
-        %101 = OpFunctionCall %Inner %tint_convert_Inner %100
-               OpStore %96 %101 None
-               OpBranch %88
-         %88 = OpLabel
-         %92 = OpIAdd %uint %91 %uint_1
-               OpBranch %89
-         %90 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %83 None
-        %104 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %104
+         %63 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %64 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %63
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %64
+         %68 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %69 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %68
+               OpStore %71 %69
+               OpBranch %76
+         %76 = OpLabel
+               OpBranch %79
+         %79 = OpLabel
+         %81 = OpPhi %uint %uint_0 %76 %82 %78
+               OpLoopMerge %80 %78 None
+               OpBranch %77
+         %77 = OpLabel
+         %98 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %99 None
+               OpBranchConditional %98 %100 %99
+        %100 = OpLabel
+               OpBranch %80
+         %99 = OpLabel
+        %101 = OpAccessChain %_ptr_Function_Inner %73 %81
+        %103 = OpAccessChain %_ptr_Function_Inner_std140 %71 %81
+        %105 = OpLoad %Inner_std140 %103 None
+        %106 = OpFunctionCall %Inner %tint_convert_Inner %105
+               OpStore %101 %106 None
+               OpBranch %78
+         %78 = OpLabel
+         %82 = OpIAdd %uint %81 %uint_1
+               OpBranch %79
+         %80 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %73 None
+         %84 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %84
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -205,7 +205,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %118 = OpLabel
         %120 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
         %119 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %120 %119
                OpBranch %122
@@ -216,25 +216,25 @@
                OpLoopMerge %126 %124 None
                OpBranch %123
         %123 = OpLabel
-        %129 = OpUGreaterThanEqual %bool %127 %uint_4
-               OpSelectionMerge %130 None
-               OpBranchConditional %129 %131 %130
-        %131 = OpLabel
+        %131 = OpUGreaterThanEqual %bool %127 %uint_4
+               OpSelectionMerge %132 None
+               OpBranchConditional %131 %133 %132
+        %133 = OpLabel
                OpBranch %126
-        %130 = OpLabel
-        %132 = OpAccessChain %_ptr_Function_Inner %121 %127
-        %133 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
-        %134 = OpLoad %Inner_std140 %133 None
-        %135 = OpFunctionCall %Inner %tint_convert_Inner %134
-               OpStore %132 %135 None
+        %132 = OpLabel
+        %134 = OpAccessChain %_ptr_Function_Inner %121 %127
+        %135 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
+        %136 = OpLoad %Inner_std140 %135 None
+        %137 = OpFunctionCall %Inner %tint_convert_Inner %136
+               OpStore %134 %137 None
                OpBranch %124
         %124 = OpLabel
         %128 = OpIAdd %uint %127 %uint_1
                OpBranch %125
         %126 = OpLabel
-        %136 = OpLoad %_arr_Inner_uint_4 %121 None
-        %137 = OpCompositeConstruct %Outer %136
-               OpReturnValue %137
+        %129 = OpLoad %_arr_Inner_uint_4 %121 None
+        %130 = OpCompositeConstruct %Outer %129
+               OpReturnValue %130
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %139
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -250,23 +250,23 @@
                OpLoopMerge %149 %147 None
                OpBranch %146
         %146 = OpLabel
-        %152 = OpUGreaterThanEqual %bool %150 %uint_4
-               OpSelectionMerge %153 None
-               OpBranchConditional %152 %154 %153
-        %154 = OpLabel
+        %153 = OpUGreaterThanEqual %bool %150 %uint_4
+               OpSelectionMerge %154 None
+               OpBranchConditional %153 %155 %154
+        %155 = OpLabel
                OpBranch %149
-        %153 = OpLabel
-        %155 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
-        %156 = OpLoad %Inner_std140 %155 None
-        %157 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
-               OpStore %157 %156 None
+        %154 = OpLabel
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
+               OpStore %158 %157 None
                OpBranch %147
         %147 = OpLabel
         %151 = OpIAdd %uint %150 %uint_1
                OpBranch %148
         %149 = OpLabel
-        %158 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
-               OpReturnValue %158
+        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
+               OpReturnValue %152
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %160
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -290,22 +290,22 @@
                OpLoopMerge %176 %174 None
                OpBranch %173
         %173 = OpLabel
-        %179 = OpUGreaterThanEqual %bool %177 %uint_4
-               OpSelectionMerge %180 None
-               OpBranchConditional %179 %181 %180
-        %181 = OpLabel
+        %180 = OpUGreaterThanEqual %bool %177 %uint_4
+               OpSelectionMerge %181 None
+               OpBranchConditional %180 %182 %181
+        %182 = OpLabel
                OpBranch %176
-        %180 = OpLabel
-        %182 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
-        %184 = OpLoad %Outer_std140_tint_explicit_layout %182 None
-        %185 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %184
-        %186 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
-               OpStore %186 %185 None
+        %181 = OpLabel
+        %183 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
+        %185 = OpLoad %Outer_std140_tint_explicit_layout %183 None
+        %186 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %185
+        %187 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
+               OpStore %187 %186 None
                OpBranch %174
         %174 = OpLabel
         %178 = OpIAdd %uint %177 %uint_1
                OpBranch %175
         %176 = OpLabel
-        %187 = OpLoad %_arr_Outer_std140_uint_4 %170 None
-               OpReturnValue %187
+        %179 = OpLoad %_arr_Outer_std140_uint_4 %170 None
+               OpReturnValue %179
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.spvasm
index b81ff28..e25a6b4 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.spvasm
@@ -76,14 +76,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %99 = OpTypeFunction %S %S_std140
         %110 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -129,47 +129,47 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_S %47 %55
+         %94 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %96 = OpLoad %S_std140 %94 None
+         %97 = OpFunctionCall %S %tint_convert_S %96
+               OpStore %92 %97 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v2half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v2half %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v2half %82 None
-         %85 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
-         %86 = OpLoad %v2half %85 None
-         %87 = OpCompositeConstruct %mat4v2half %79 %81 %84 %86
-         %88 = OpFunctionCall %void %c %87
-         %89 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v2half %89 None
-         %91 = OpVectorShuffle %v2half %90 %90 1 0
-         %92 = OpFunctionCall %void %d %91
-         %93 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %94 = OpLoad %v2half %93 None
-         %95 = OpVectorShuffle %v2half %94 %94 1 0
-         %96 = OpCompositeExtract %half %95 0
-         %97 = OpFunctionCall %void %e %96
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v2half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v2half %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v2half %72 None
+         %75 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
+         %76 = OpLoad %v2half %75 None
+         %77 = OpCompositeConstruct %mat4v2half %69 %71 %74 %76
+         %78 = OpFunctionCall %void %c %77
+         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %80 = OpLoad %v2half %79 None
+         %81 = OpVectorShuffle %v2half %80 %80 1 0
+         %82 = OpFunctionCall %void %d %81
+         %83 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %84 = OpLoad %v2half %83 None
+         %85 = OpVectorShuffle %v2half %84 %84 1 0
+         %86 = OpCompositeExtract %half %85 0
+         %87 = OpFunctionCall %void %e %86
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %99
@@ -199,21 +199,21 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %121
-        %127 = OpLoad %S_std140 %126 None
-        %128 = OpAccessChain %_ptr_Function_S_std140 %114 %121
-               OpStore %128 %127 None
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %121
+        %128 = OpLoad %S_std140 %127 None
+        %129 = OpAccessChain %_ptr_Function_S_std140 %114 %121
+               OpStore %129 %128 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %129 = OpLoad %_arr_S_std140_uint_4_0 %114 None
-               OpReturnValue %129
+        %123 = OpLoad %_arr_S_std140_uint_4_0 %114 None
+               OpReturnValue %123
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.spvasm
index 98ef180..9b39444 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.spvasm
@@ -64,17 +64,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat4v2half = OpTypePointer Private %mat4v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_Private_v2half = OpTypePointer Private %v2half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %78 = OpTypeFunction %S %S_std140
          %89 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -95,45 +95,45 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_S %30 %37
+         %73 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %75 = OpLoad %S_std140 %73 None
+         %76 = OpFunctionCall %S %tint_convert_S %75
+               OpStore %71 %76 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat4v2half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v2half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v2half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v2half %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
-         %70 = OpLoad %v2half %69 None
-         %71 = OpCompositeConstruct %mat4v2half %64 %66 %68 %70
-               OpStore %59 %71 None
-         %72 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %75 = OpLoad %v2half %74 None
-         %76 = OpVectorShuffle %v2half %75 %75 1 0
-               OpStore %72 %76 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat4v2half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v2half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v2half %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v2half %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
+         %60 = OpLoad %v2half %59 None
+         %61 = OpCompositeConstruct %mat4v2half %54 %56 %58 %60
+               OpStore %49 %61 None
+         %62 = OpAccessChain %_ptr_Private_v2half %p %uint_1 %uint_1 %uint_0
+         %64 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %65 = OpLoad %v2half %64 None
+         %66 = OpVectorShuffle %v2half %65 %65 1 0
+               OpStore %62 %66 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %78
@@ -163,21 +163,21 @@
                OpLoopMerge %99 %97 None
                OpBranch %96
          %96 = OpLabel
-        %102 = OpUGreaterThanEqual %bool %100 %uint_4
-               OpSelectionMerge %103 None
-               OpBranchConditional %102 %104 %103
-        %104 = OpLabel
+        %103 = OpUGreaterThanEqual %bool %100 %uint_4
+               OpSelectionMerge %104 None
+               OpBranchConditional %103 %105 %104
+        %105 = OpLabel
                OpBranch %99
-        %103 = OpLabel
-        %105 = OpAccessChain %_ptr_Function_S_std140 %91 %100
-        %106 = OpLoad %S_std140 %105 None
-        %107 = OpAccessChain %_ptr_Function_S_std140 %93 %100
-               OpStore %107 %106 None
+        %104 = OpLabel
+        %106 = OpAccessChain %_ptr_Function_S_std140 %91 %100
+        %107 = OpLoad %S_std140 %106 None
+        %108 = OpAccessChain %_ptr_Function_S_std140 %93 %100
+               OpStore %108 %107 None
                OpBranch %97
          %97 = OpLabel
         %101 = OpIAdd %uint %100 %uint_1
                OpBranch %98
          %99 = OpLabel
-        %108 = OpLoad %_arr_S_std140_uint_4_0 %93 None
-               OpReturnValue %108
+        %102 = OpLoad %_arr_S_std140_uint_4_0 %93 None
+               OpReturnValue %102
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.spvasm
index c9b56d4..57ce09e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.spvasm
@@ -88,17 +88,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat4v2half = OpTypePointer StorageBuffer %mat4v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_StorageBuffer_v2half = OpTypePointer StorageBuffer %v2half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %85 = OpTypeFunction %void %_arr_S_uint_4
         %104 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -122,45 +122,45 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %74 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %76 None
+               OpBranchConditional %74 %77 %76
+         %77 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %76 = OpLabel
+         %78 = OpAccessChain %_ptr_Function_S %30 %40
+         %80 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %82 = OpLoad %S_std140 %80 None
+         %83 = OpFunctionCall %S %tint_convert_S %82
+               OpStore %78 %83 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat4v2half %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v2half %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v2half %72 None
-         %74 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %75 = OpLoad %v2half %74 None
-         %76 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
-         %77 = OpLoad %v2half %76 None
-         %78 = OpCompositeConstruct %mat4v2half %71 %73 %75 %77
-               OpStore %66 %78 None
-         %79 = OpAccessChain %_ptr_StorageBuffer_v2half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %81 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %82 = OpLoad %v2half %81 None
-         %83 = OpVectorShuffle %v2half %82 %82 1 0
-               OpStore %79 %83 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat4v2half %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v2half %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v2half %62 None
+         %64 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %65 = OpLoad %v2half %64 None
+         %66 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
+         %67 = OpLoad %v2half %66 None
+         %68 = OpCompositeConstruct %mat4v2half %61 %63 %65 %67
+               OpStore %56 %68 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_v2half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %72 = OpLoad %v2half %71 None
+         %73 = OpVectorShuffle %v2half %72 %72 1 0
+               OpStore %69 %73 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %85
@@ -236,21 +236,21 @@
                OpLoopMerge %136 %134 None
                OpBranch %133
         %133 = OpLabel
-        %139 = OpUGreaterThanEqual %bool %137 %uint_4
-               OpSelectionMerge %140 None
-               OpBranchConditional %139 %141 %140
-        %141 = OpLabel
+        %140 = OpUGreaterThanEqual %bool %137 %uint_4
+               OpSelectionMerge %141 None
+               OpBranchConditional %140 %142 %141
+        %142 = OpLabel
                OpBranch %136
-        %140 = OpLabel
-        %142 = OpAccessChain %_ptr_Function_S_std140 %128 %137
-        %143 = OpLoad %S_std140 %142 None
-        %144 = OpAccessChain %_ptr_Function_S_std140 %130 %137
-               OpStore %144 %143 None
+        %141 = OpLabel
+        %143 = OpAccessChain %_ptr_Function_S_std140 %128 %137
+        %144 = OpLoad %S_std140 %143 None
+        %145 = OpAccessChain %_ptr_Function_S_std140 %130 %137
+               OpStore %145 %144 None
                OpBranch %134
         %134 = OpLabel
         %138 = OpIAdd %uint %137 %uint_1
                OpBranch %135
         %136 = OpLabel
-        %145 = OpLoad %_arr_S_std140_uint_4_0 %130 None
-               OpReturnValue %145
+        %139 = OpLoad %_arr_S_std140_uint_4_0 %130 None
+               OpReturnValue %139
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
index eb1e9a3..74fcbb6 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
@@ -64,10 +64,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -75,14 +71,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat4v2half = OpTypePointer Workgroup %mat4v2half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
 %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half
+       %bool = OpTypeBool
+         %84 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %95 = OpTypeFunction %void
         %100 = OpTypeFunction %S %S_std140
         %111 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -91,8 +91,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -101,71 +101,71 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %83 %84 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat4v2half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v2half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v2half %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v2half %84 None
-         %86 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
-         %87 = OpLoad %v2half %86 None
-         %88 = OpCompositeConstruct %mat4v2half %81 %83 %85 %87
-               OpStore %76 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_1 %uint_0
-         %91 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v2half %91 None
-         %93 = OpVectorShuffle %v2half %92 %92 1 0
-               OpStore %89 %93 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %85 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %86
+         %87 = OpLabel
+               OpBranch %49
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_S %42 %50
+         %90 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %92 = OpLoad %S_std140 %90 None
+         %93 = OpFunctionCall %S %tint_convert_S %92
+               OpStore %88 %93 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat4v2half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v2half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v2half %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v2half %69 None
+         %71 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_2 %uint_4
+         %72 = OpLoad %v2half %71 None
+         %73 = OpCompositeConstruct %mat4v2half %66 %68 %70 %72
+               OpStore %61 %73 None
+         %74 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1 %uint_1 %uint_0
+         %76 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0 %uint_0 %uint_2
+         %77 = OpLoad %v2half %76 None
+         %78 = OpVectorShuffle %v2half %77 %77 1 0
+               OpStore %74 %78 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %95
@@ -201,21 +201,21 @@
                OpLoopMerge %121 %119 None
                OpBranch %118
         %118 = OpLabel
-        %124 = OpUGreaterThanEqual %bool %122 %uint_4
-               OpSelectionMerge %125 None
-               OpBranchConditional %124 %126 %125
-        %126 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %122 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %121
-        %125 = OpLabel
-        %127 = OpAccessChain %_ptr_Function_S_std140 %113 %122
-        %128 = OpLoad %S_std140 %127 None
-        %129 = OpAccessChain %_ptr_Function_S_std140 %115 %122
-               OpStore %129 %128 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_S_std140 %113 %122
+        %129 = OpLoad %S_std140 %128 None
+        %130 = OpAccessChain %_ptr_Function_S_std140 %115 %122
+               OpStore %130 %129 None
                OpBranch %119
         %119 = OpLabel
         %123 = OpIAdd %uint %122 %uint_1
                OpBranch %120
         %121 = OpLabel
-        %130 = OpLoad %_arr_S_std140_uint_4_0 %115 None
-               OpReturnValue %130
+        %124 = OpLoad %_arr_S_std140_uint_4_0 %115 None
+               OpReturnValue %124
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 758cc19..f7b2786 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -96,12 +96,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %79 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+        %100 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %110 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %136 = OpTypeFunction %Inner %Inner_std140
@@ -127,8 +127,8 @@
          %57 = OpVariable %_ptr_Function_mat4v2float Function
          %71 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %73 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %79
-        %106 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %108 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+         %96 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %98 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -165,60 +165,60 @@
                OpLoopMerge %84 %82 None
                OpBranch %81
          %81 = OpLabel
-         %87 = OpUGreaterThanEqual %bool %85 %uint_4
-               OpSelectionMerge %89 None
-               OpBranchConditional %87 %90 %89
-         %90 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %85 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %116 %119 %118
+        %119 = OpLabel
                OpBranch %84
-         %89 = OpLabel
-         %91 = OpAccessChain %_ptr_Function_Outer %73 %85
-         %93 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
-         %95 = OpLoad %Outer_std140 %93 None
-         %96 = OpFunctionCall %Outer %tint_convert_Outer %95
-               OpStore %91 %96 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_Outer %73 %85
+        %122 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
+        %124 = OpLoad %Outer_std140 %122 None
+        %125 = OpFunctionCall %Outer %tint_convert_Outer %124
+               OpStore %120 %125 None
                OpBranch %82
          %82 = OpLabel
          %86 = OpIAdd %uint %85 %uint_1
                OpBranch %83
          %84 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %73 None
-         %99 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-        %100 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %99
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %100
-        %103 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %104 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %103
-               OpStore %106 %104
-               OpBranch %111
-        %111 = OpLabel
-               OpBranch %114
-        %114 = OpLabel
-        %116 = OpPhi %uint %uint_0 %111 %117 %113
-               OpLoopMerge %115 %113 None
-               OpBranch %112
-        %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
-               OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_Inner %108 %116
-        %123 = OpAccessChain %_ptr_Function_Inner_std140 %106 %116
-        %125 = OpLoad %Inner_std140 %123 None
-        %126 = OpFunctionCall %Inner %tint_convert_Inner %125
-               OpStore %121 %126 None
-               OpBranch %113
-        %113 = OpLabel
-        %117 = OpIAdd %uint %116 %uint_1
-               OpBranch %114
-        %115 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %108 None
-        %129 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %129
-        %131 = OpFunctionCall %int %i
-        %132 = OpBitcast %uint %131
-        %133 = OpExtInst %uint %33 UMin %132 %uint_1
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %133
+         %88 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %89 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %88
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %89
+         %93 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %94 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %93
+               OpStore %96 %94
+               OpBranch %101
+        %101 = OpLabel
+               OpBranch %104
+        %104 = OpLabel
+        %106 = OpPhi %uint %uint_0 %101 %107 %103
+               OpLoopMerge %105 %103 None
+               OpBranch %102
+        %102 = OpLabel
+        %126 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %127 None
+               OpBranchConditional %126 %128 %127
+        %128 = OpLabel
+               OpBranch %105
+        %127 = OpLabel
+        %129 = OpAccessChain %_ptr_Function_Inner %98 %106
+        %131 = OpAccessChain %_ptr_Function_Inner_std140 %96 %106
+        %133 = OpLoad %Inner_std140 %131 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %129 %134 None
+               OpBranch %103
+        %103 = OpLabel
+        %107 = OpIAdd %uint %106 %uint_1
+               OpBranch %104
+        %105 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %98 None
+        %109 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %109
+        %112 = OpFunctionCall %int %i
+        %113 = OpBitcast %uint %112
+        %114 = OpExtInst %uint %33 UMin %113 %uint_1
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %114
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %136
@@ -236,7 +236,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %146 = OpLabel
         %148 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
         %147 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %148 %147
                OpBranch %150
@@ -247,25 +247,25 @@
                OpLoopMerge %154 %152 None
                OpBranch %151
         %151 = OpLabel
-        %157 = OpUGreaterThanEqual %bool %155 %uint_4
-               OpSelectionMerge %158 None
-               OpBranchConditional %157 %159 %158
-        %159 = OpLabel
+        %159 = OpUGreaterThanEqual %bool %155 %uint_4
+               OpSelectionMerge %160 None
+               OpBranchConditional %159 %161 %160
+        %161 = OpLabel
                OpBranch %154
-        %158 = OpLabel
-        %160 = OpAccessChain %_ptr_Function_Inner %149 %155
-        %161 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
-        %162 = OpLoad %Inner_std140 %161 None
-        %163 = OpFunctionCall %Inner %tint_convert_Inner %162
-               OpStore %160 %163 None
+        %160 = OpLabel
+        %162 = OpAccessChain %_ptr_Function_Inner %149 %155
+        %163 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
+        %164 = OpLoad %Inner_std140 %163 None
+        %165 = OpFunctionCall %Inner %tint_convert_Inner %164
+               OpStore %162 %165 None
                OpBranch %152
         %152 = OpLabel
         %156 = OpIAdd %uint %155 %uint_1
                OpBranch %153
         %154 = OpLabel
-        %164 = OpLoad %_arr_Inner_uint_4 %149 None
-        %165 = OpCompositeConstruct %Outer %164
-               OpReturnValue %165
+        %157 = OpLoad %_arr_Inner_uint_4 %149 None
+        %158 = OpCompositeConstruct %Outer %157
+               OpReturnValue %158
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %167
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -281,23 +281,23 @@
                OpLoopMerge %177 %175 None
                OpBranch %174
         %174 = OpLabel
-        %180 = OpUGreaterThanEqual %bool %178 %uint_4
-               OpSelectionMerge %181 None
-               OpBranchConditional %180 %182 %181
-        %182 = OpLabel
+        %181 = OpUGreaterThanEqual %bool %178 %uint_4
+               OpSelectionMerge %182 None
+               OpBranchConditional %181 %183 %182
+        %183 = OpLabel
                OpBranch %177
-        %181 = OpLabel
-        %183 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
-        %184 = OpLoad %Inner_std140 %183 None
-        %185 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
-               OpStore %185 %184 None
+        %182 = OpLabel
+        %184 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
+        %185 = OpLoad %Inner_std140 %184 None
+        %186 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
+               OpStore %186 %185 None
                OpBranch %175
         %175 = OpLabel
         %179 = OpIAdd %uint %178 %uint_1
                OpBranch %176
         %177 = OpLabel
-        %186 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
-               OpReturnValue %186
+        %180 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
+               OpReturnValue %180
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %188
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -321,22 +321,22 @@
                OpLoopMerge %204 %202 None
                OpBranch %201
         %201 = OpLabel
-        %207 = OpUGreaterThanEqual %bool %205 %uint_4
-               OpSelectionMerge %208 None
-               OpBranchConditional %207 %209 %208
-        %209 = OpLabel
+        %208 = OpUGreaterThanEqual %bool %205 %uint_4
+               OpSelectionMerge %209 None
+               OpBranchConditional %208 %210 %209
+        %210 = OpLabel
                OpBranch %204
-        %208 = OpLabel
-        %210 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
-        %212 = OpLoad %Outer_std140_tint_explicit_layout %210 None
-        %213 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %212
-        %214 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
-               OpStore %214 %213 None
+        %209 = OpLabel
+        %211 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
+        %213 = OpLoad %Outer_std140_tint_explicit_layout %211 None
+        %214 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %213
+        %215 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
+               OpStore %215 %214 None
                OpBranch %202
         %202 = OpLabel
         %206 = OpIAdd %uint %205 %uint_1
                OpBranch %203
         %204 = OpLabel
-        %215 = OpLoad %_arr_Outer_std140_uint_4 %198 None
-               OpReturnValue %215
+        %207 = OpLoad %_arr_Outer_std140_uint_4 %198 None
+               OpReturnValue %207
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm
index cbf79c9..7551007 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -85,12 +85,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %54 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %75 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %85 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %108 = OpTypeFunction %Inner %Inner_std140
@@ -107,8 +107,8 @@
          %15 = OpLabel
          %46 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %48 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %54
-         %81 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %83 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+         %71 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %73 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -134,56 +134,56 @@
                OpLoopMerge %59 %57 None
                OpBranch %56
          %56 = OpLabel
-         %62 = OpUGreaterThanEqual %bool %60 %uint_4
-               OpSelectionMerge %64 None
-               OpBranchConditional %62 %65 %64
-         %65 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %60 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %59
-         %64 = OpLabel
-         %66 = OpAccessChain %_ptr_Function_Outer %48 %60
-         %68 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
-         %70 = OpLoad %Outer_std140 %68 None
-         %71 = OpFunctionCall %Outer %tint_convert_Outer %70
-               OpStore %66 %71 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_Outer %48 %60
+         %94 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
+         %96 = OpLoad %Outer_std140 %94 None
+         %97 = OpFunctionCall %Outer %tint_convert_Outer %96
+               OpStore %92 %97 None
                OpBranch %57
          %57 = OpLabel
          %61 = OpIAdd %uint %60 %uint_1
                OpBranch %58
          %59 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %48 None
-         %74 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %75 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %74
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %75
-         %78 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %79 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %78
-               OpStore %81 %79
-               OpBranch %86
-         %86 = OpLabel
-               OpBranch %89
-         %89 = OpLabel
-         %91 = OpPhi %uint %uint_0 %86 %92 %88
-               OpLoopMerge %90 %88 None
-               OpBranch %87
-         %87 = OpLabel
-         %93 = OpUGreaterThanEqual %bool %91 %uint_4
-               OpSelectionMerge %94 None
-               OpBranchConditional %93 %95 %94
-         %95 = OpLabel
-               OpBranch %90
-         %94 = OpLabel
-         %96 = OpAccessChain %_ptr_Function_Inner %83 %91
-         %98 = OpAccessChain %_ptr_Function_Inner_std140 %81 %91
-        %100 = OpLoad %Inner_std140 %98 None
-        %101 = OpFunctionCall %Inner %tint_convert_Inner %100
-               OpStore %96 %101 None
-               OpBranch %88
-         %88 = OpLabel
-         %92 = OpIAdd %uint %91 %uint_1
-               OpBranch %89
-         %90 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %83 None
-        %104 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %104
+         %63 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %64 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %63
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %64
+         %68 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %69 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %68
+               OpStore %71 %69
+               OpBranch %76
+         %76 = OpLabel
+               OpBranch %79
+         %79 = OpLabel
+         %81 = OpPhi %uint %uint_0 %76 %82 %78
+               OpLoopMerge %80 %78 None
+               OpBranch %77
+         %77 = OpLabel
+         %98 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %99 None
+               OpBranchConditional %98 %100 %99
+        %100 = OpLabel
+               OpBranch %80
+         %99 = OpLabel
+        %101 = OpAccessChain %_ptr_Function_Inner %73 %81
+        %103 = OpAccessChain %_ptr_Function_Inner_std140 %71 %81
+        %105 = OpLoad %Inner_std140 %103 None
+        %106 = OpFunctionCall %Inner %tint_convert_Inner %105
+               OpStore %101 %106 None
+               OpBranch %78
+         %78 = OpLabel
+         %82 = OpIAdd %uint %81 %uint_1
+               OpBranch %79
+         %80 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %73 None
+         %84 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %84
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %float %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -202,7 +202,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %118 = OpLabel
         %120 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
         %119 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %120 %119
                OpBranch %122
@@ -213,25 +213,25 @@
                OpLoopMerge %126 %124 None
                OpBranch %123
         %123 = OpLabel
-        %129 = OpUGreaterThanEqual %bool %127 %uint_4
-               OpSelectionMerge %130 None
-               OpBranchConditional %129 %131 %130
-        %131 = OpLabel
+        %131 = OpUGreaterThanEqual %bool %127 %uint_4
+               OpSelectionMerge %132 None
+               OpBranchConditional %131 %133 %132
+        %133 = OpLabel
                OpBranch %126
-        %130 = OpLabel
-        %132 = OpAccessChain %_ptr_Function_Inner %121 %127
-        %133 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
-        %134 = OpLoad %Inner_std140 %133 None
-        %135 = OpFunctionCall %Inner %tint_convert_Inner %134
-               OpStore %132 %135 None
+        %132 = OpLabel
+        %134 = OpAccessChain %_ptr_Function_Inner %121 %127
+        %135 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
+        %136 = OpLoad %Inner_std140 %135 None
+        %137 = OpFunctionCall %Inner %tint_convert_Inner %136
+               OpStore %134 %137 None
                OpBranch %124
         %124 = OpLabel
         %128 = OpIAdd %uint %127 %uint_1
                OpBranch %125
         %126 = OpLabel
-        %136 = OpLoad %_arr_Inner_uint_4 %121 None
-        %137 = OpCompositeConstruct %Outer %136
-               OpReturnValue %137
+        %129 = OpLoad %_arr_Inner_uint_4 %121 None
+        %130 = OpCompositeConstruct %Outer %129
+               OpReturnValue %130
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %139
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -247,23 +247,23 @@
                OpLoopMerge %149 %147 None
                OpBranch %146
         %146 = OpLabel
-        %152 = OpUGreaterThanEqual %bool %150 %uint_4
-               OpSelectionMerge %153 None
-               OpBranchConditional %152 %154 %153
-        %154 = OpLabel
+        %153 = OpUGreaterThanEqual %bool %150 %uint_4
+               OpSelectionMerge %154 None
+               OpBranchConditional %153 %155 %154
+        %155 = OpLabel
                OpBranch %149
-        %153 = OpLabel
-        %155 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
-        %156 = OpLoad %Inner_std140 %155 None
-        %157 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
-               OpStore %157 %156 None
+        %154 = OpLabel
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
+               OpStore %158 %157 None
                OpBranch %147
         %147 = OpLabel
         %151 = OpIAdd %uint %150 %uint_1
                OpBranch %148
         %149 = OpLabel
-        %158 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
-               OpReturnValue %158
+        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
+               OpReturnValue %152
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %160
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -287,22 +287,22 @@
                OpLoopMerge %176 %174 None
                OpBranch %173
         %173 = OpLabel
-        %179 = OpUGreaterThanEqual %bool %177 %uint_4
-               OpSelectionMerge %180 None
-               OpBranchConditional %179 %181 %180
-        %181 = OpLabel
+        %180 = OpUGreaterThanEqual %bool %177 %uint_4
+               OpSelectionMerge %181 None
+               OpBranchConditional %180 %182 %181
+        %182 = OpLabel
                OpBranch %176
-        %180 = OpLabel
-        %182 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
-        %184 = OpLoad %Outer_std140_tint_explicit_layout %182 None
-        %185 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %184
-        %186 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
-               OpStore %186 %185 None
+        %181 = OpLabel
+        %183 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
+        %185 = OpLoad %Outer_std140_tint_explicit_layout %183 None
+        %186 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %185
+        %187 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
+               OpStore %187 %186 None
                OpBranch %174
         %174 = OpLabel
         %178 = OpIAdd %uint %177 %uint_1
                OpBranch %175
         %176 = OpLabel
-        %187 = OpLoad %_arr_Outer_std140_uint_4 %170 None
-               OpReturnValue %187
+        %179 = OpLoad %_arr_Outer_std140_uint_4 %170 None
+               OpReturnValue %179
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.spvasm
index 273a5bd..544a490 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.spvasm
@@ -73,14 +73,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %99 = OpTypeFunction %S %S_std140
         %110 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -126,47 +126,47 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_S %47 %55
+         %94 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %96 = OpLoad %S_std140 %94 None
+         %97 = OpFunctionCall %S %tint_convert_S %96
+               OpStore %92 %97 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v2float %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v2float %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v2float %82 None
-         %85 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
-         %86 = OpLoad %v2float %85 None
-         %87 = OpCompositeConstruct %mat4v2float %79 %81 %84 %86
-         %88 = OpFunctionCall %void %c %87
-         %89 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v2float %89 None
-         %91 = OpVectorShuffle %v2float %90 %90 1 0
-         %92 = OpFunctionCall %void %d %91
-         %93 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %94 = OpLoad %v2float %93 None
-         %95 = OpVectorShuffle %v2float %94 %94 1 0
-         %96 = OpCompositeExtract %float %95 0
-         %97 = OpFunctionCall %void %e %96
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v2float %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v2float %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v2float %72 None
+         %75 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
+         %76 = OpLoad %v2float %75 None
+         %77 = OpCompositeConstruct %mat4v2float %69 %71 %74 %76
+         %78 = OpFunctionCall %void %c %77
+         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %80 = OpLoad %v2float %79 None
+         %81 = OpVectorShuffle %v2float %80 %80 1 0
+         %82 = OpFunctionCall %void %d %81
+         %83 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %84 = OpLoad %v2float %83 None
+         %85 = OpVectorShuffle %v2float %84 %84 1 0
+         %86 = OpCompositeExtract %float %85 0
+         %87 = OpFunctionCall %void %e %86
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %99
@@ -196,21 +196,21 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %121
-        %127 = OpLoad %S_std140 %126 None
-        %128 = OpAccessChain %_ptr_Function_S_std140 %114 %121
-               OpStore %128 %127 None
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %121
+        %128 = OpLoad %S_std140 %127 None
+        %129 = OpAccessChain %_ptr_Function_S_std140 %114 %121
+               OpStore %129 %128 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %129 = OpLoad %_arr_S_std140_uint_4_0 %114 None
-               OpReturnValue %129
+        %123 = OpLoad %_arr_S_std140_uint_4_0 %114 None
+               OpReturnValue %123
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.spvasm
index dfec7c4..c4c5ee5 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.spvasm
@@ -61,17 +61,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat4v2float = OpTypePointer Private %mat4v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_Private_v2float = OpTypePointer Private %v2float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %78 = OpTypeFunction %S %S_std140
          %89 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -92,45 +92,45 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_S %30 %37
+         %73 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %75 = OpLoad %S_std140 %73 None
+         %76 = OpFunctionCall %S %tint_convert_S %75
+               OpStore %71 %76 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat4v2float %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v2float %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v2float %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v2float %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
-         %70 = OpLoad %v2float %69 None
-         %71 = OpCompositeConstruct %mat4v2float %64 %66 %68 %70
-               OpStore %59 %71 None
-         %72 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %75 = OpLoad %v2float %74 None
-         %76 = OpVectorShuffle %v2float %75 %75 1 0
-               OpStore %72 %76 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat4v2float %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v2float %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v2float %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v2float %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
+         %60 = OpLoad %v2float %59 None
+         %61 = OpCompositeConstruct %mat4v2float %54 %56 %58 %60
+               OpStore %49 %61 None
+         %62 = OpAccessChain %_ptr_Private_v2float %p %uint_1 %uint_1 %uint_0
+         %64 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %65 = OpLoad %v2float %64 None
+         %66 = OpVectorShuffle %v2float %65 %65 1 0
+               OpStore %62 %66 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %78
@@ -160,21 +160,21 @@
                OpLoopMerge %99 %97 None
                OpBranch %96
          %96 = OpLabel
-        %102 = OpUGreaterThanEqual %bool %100 %uint_4
-               OpSelectionMerge %103 None
-               OpBranchConditional %102 %104 %103
-        %104 = OpLabel
+        %103 = OpUGreaterThanEqual %bool %100 %uint_4
+               OpSelectionMerge %104 None
+               OpBranchConditional %103 %105 %104
+        %105 = OpLabel
                OpBranch %99
-        %103 = OpLabel
-        %105 = OpAccessChain %_ptr_Function_S_std140 %91 %100
-        %106 = OpLoad %S_std140 %105 None
-        %107 = OpAccessChain %_ptr_Function_S_std140 %93 %100
-               OpStore %107 %106 None
+        %104 = OpLabel
+        %106 = OpAccessChain %_ptr_Function_S_std140 %91 %100
+        %107 = OpLoad %S_std140 %106 None
+        %108 = OpAccessChain %_ptr_Function_S_std140 %93 %100
+               OpStore %108 %107 None
                OpBranch %97
          %97 = OpLabel
         %101 = OpIAdd %uint %100 %uint_1
                OpBranch %98
          %99 = OpLabel
-        %108 = OpLoad %_arr_S_std140_uint_4_0 %93 None
-               OpReturnValue %108
+        %102 = OpLoad %_arr_S_std140_uint_4_0 %93 None
+               OpReturnValue %102
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.spvasm
index 2ffe810..18544ed 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.spvasm
@@ -85,17 +85,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat4v2float = OpTypePointer StorageBuffer %mat4v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_StorageBuffer_v2float = OpTypePointer StorageBuffer %v2float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %85 = OpTypeFunction %void %_arr_S_uint_4
         %104 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -119,45 +119,45 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %74 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %76 None
+               OpBranchConditional %74 %77 %76
+         %77 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %76 = OpLabel
+         %78 = OpAccessChain %_ptr_Function_S %30 %40
+         %80 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %82 = OpLoad %S_std140 %80 None
+         %83 = OpFunctionCall %S %tint_convert_S %82
+               OpStore %78 %83 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat4v2float %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v2float %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v2float %72 None
-         %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %75 = OpLoad %v2float %74 None
-         %76 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
-         %77 = OpLoad %v2float %76 None
-         %78 = OpCompositeConstruct %mat4v2float %71 %73 %75 %77
-               OpStore %66 %78 None
-         %79 = OpAccessChain %_ptr_StorageBuffer_v2float %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %81 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %82 = OpLoad %v2float %81 None
-         %83 = OpVectorShuffle %v2float %82 %82 1 0
-               OpStore %79 %83 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat4v2float %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v2float %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v2float %62 None
+         %64 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %65 = OpLoad %v2float %64 None
+         %66 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
+         %67 = OpLoad %v2float %66 None
+         %68 = OpCompositeConstruct %mat4v2float %61 %63 %65 %67
+               OpStore %56 %68 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_v2float %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %72 = OpLoad %v2float %71 None
+         %73 = OpVectorShuffle %v2float %72 %72 1 0
+               OpStore %69 %73 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %85
@@ -233,21 +233,21 @@
                OpLoopMerge %136 %134 None
                OpBranch %133
         %133 = OpLabel
-        %139 = OpUGreaterThanEqual %bool %137 %uint_4
-               OpSelectionMerge %140 None
-               OpBranchConditional %139 %141 %140
-        %141 = OpLabel
+        %140 = OpUGreaterThanEqual %bool %137 %uint_4
+               OpSelectionMerge %141 None
+               OpBranchConditional %140 %142 %141
+        %142 = OpLabel
                OpBranch %136
-        %140 = OpLabel
-        %142 = OpAccessChain %_ptr_Function_S_std140 %128 %137
-        %143 = OpLoad %S_std140 %142 None
-        %144 = OpAccessChain %_ptr_Function_S_std140 %130 %137
-               OpStore %144 %143 None
+        %141 = OpLabel
+        %143 = OpAccessChain %_ptr_Function_S_std140 %128 %137
+        %144 = OpLoad %S_std140 %143 None
+        %145 = OpAccessChain %_ptr_Function_S_std140 %130 %137
+               OpStore %145 %144 None
                OpBranch %134
         %134 = OpLabel
         %138 = OpIAdd %uint %137 %uint_1
                OpBranch %135
         %136 = OpLabel
-        %145 = OpLoad %_arr_S_std140_uint_4_0 %130 None
-               OpReturnValue %145
+        %139 = OpLoad %_arr_S_std140_uint_4_0 %130 None
+               OpReturnValue %139
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
index f419206..598dabc 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -61,10 +61,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -72,14 +68,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat4v2float = OpTypePointer Workgroup %mat4v2float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
+       %bool = OpTypeBool
+         %84 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %95 = OpTypeFunction %void
         %100 = OpTypeFunction %S %S_std140
         %111 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -88,8 +88,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -98,71 +98,71 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %83 %84 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat4v2float %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v2float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v2float %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v2float %84 None
-         %86 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
-         %87 = OpLoad %v2float %86 None
-         %88 = OpCompositeConstruct %mat4v2float %81 %83 %85 %87
-               OpStore %76 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_1 %uint_0
-         %91 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v2float %91 None
-         %93 = OpVectorShuffle %v2float %92 %92 1 0
-               OpStore %89 %93 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %85 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %86
+         %87 = OpLabel
+               OpBranch %49
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_S %42 %50
+         %90 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %92 = OpLoad %S_std140 %90 None
+         %93 = OpFunctionCall %S %tint_convert_S %92
+               OpStore %88 %93 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat4v2float %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v2float %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v2float %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v2float %69 None
+         %71 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_2 %uint_4
+         %72 = OpLoad %v2float %71 None
+         %73 = OpCompositeConstruct %mat4v2float %66 %68 %70 %72
+               OpStore %61 %73 None
+         %74 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1 %uint_1 %uint_0
+         %76 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0 %uint_2
+         %77 = OpLoad %v2float %76 None
+         %78 = OpVectorShuffle %v2float %77 %77 1 0
+               OpStore %74 %78 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %95
@@ -198,21 +198,21 @@
                OpLoopMerge %121 %119 None
                OpBranch %118
         %118 = OpLabel
-        %124 = OpUGreaterThanEqual %bool %122 %uint_4
-               OpSelectionMerge %125 None
-               OpBranchConditional %124 %126 %125
-        %126 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %122 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %121
-        %125 = OpLabel
-        %127 = OpAccessChain %_ptr_Function_S_std140 %113 %122
-        %128 = OpLoad %S_std140 %127 None
-        %129 = OpAccessChain %_ptr_Function_S_std140 %115 %122
-               OpStore %129 %128 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_S_std140 %113 %122
+        %129 = OpLoad %S_std140 %128 None
+        %130 = OpAccessChain %_ptr_Function_S_std140 %115 %122
+               OpStore %130 %129 None
                OpBranch %119
         %119 = OpLabel
         %123 = OpIAdd %uint %122 %uint_1
                OpBranch %120
         %121 = OpLabel
-        %130 = OpLoad %_arr_S_std140_uint_4_0 %115 None
-               OpReturnValue %130
+        %124 = OpLoad %_arr_S_std140_uint_4_0 %115 None
+               OpReturnValue %124
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 1525920..22d5622 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -99,12 +99,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %79 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+        %100 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %110 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %136 = OpTypeFunction %Inner %Inner_std140
@@ -130,8 +130,8 @@
          %57 = OpVariable %_ptr_Function_mat4v3half Function
          %71 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %73 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %79
-        %106 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %108 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+         %96 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %98 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -168,60 +168,60 @@
                OpLoopMerge %84 %82 None
                OpBranch %81
          %81 = OpLabel
-         %87 = OpUGreaterThanEqual %bool %85 %uint_4
-               OpSelectionMerge %89 None
-               OpBranchConditional %87 %90 %89
-         %90 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %85 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %116 %119 %118
+        %119 = OpLabel
                OpBranch %84
-         %89 = OpLabel
-         %91 = OpAccessChain %_ptr_Function_Outer %73 %85
-         %93 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
-         %95 = OpLoad %Outer_std140 %93 None
-         %96 = OpFunctionCall %Outer %tint_convert_Outer %95
-               OpStore %91 %96 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_Outer %73 %85
+        %122 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
+        %124 = OpLoad %Outer_std140 %122 None
+        %125 = OpFunctionCall %Outer %tint_convert_Outer %124
+               OpStore %120 %125 None
                OpBranch %82
          %82 = OpLabel
          %86 = OpIAdd %uint %85 %uint_1
                OpBranch %83
          %84 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %73 None
-         %99 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-        %100 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %99
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %100
-        %103 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %104 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %103
-               OpStore %106 %104
-               OpBranch %111
-        %111 = OpLabel
-               OpBranch %114
-        %114 = OpLabel
-        %116 = OpPhi %uint %uint_0 %111 %117 %113
-               OpLoopMerge %115 %113 None
-               OpBranch %112
-        %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
-               OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_Inner %108 %116
-        %123 = OpAccessChain %_ptr_Function_Inner_std140 %106 %116
-        %125 = OpLoad %Inner_std140 %123 None
-        %126 = OpFunctionCall %Inner %tint_convert_Inner %125
-               OpStore %121 %126 None
-               OpBranch %113
-        %113 = OpLabel
-        %117 = OpIAdd %uint %116 %uint_1
-               OpBranch %114
-        %115 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %108 None
-        %129 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %129
-        %131 = OpFunctionCall %int %i
-        %132 = OpBitcast %uint %131
-        %133 = OpExtInst %uint %33 UMin %132 %uint_2
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %133
+         %88 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %89 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %88
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %89
+         %93 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %94 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %93
+               OpStore %96 %94
+               OpBranch %101
+        %101 = OpLabel
+               OpBranch %104
+        %104 = OpLabel
+        %106 = OpPhi %uint %uint_0 %101 %107 %103
+               OpLoopMerge %105 %103 None
+               OpBranch %102
+        %102 = OpLabel
+        %126 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %127 None
+               OpBranchConditional %126 %128 %127
+        %128 = OpLabel
+               OpBranch %105
+        %127 = OpLabel
+        %129 = OpAccessChain %_ptr_Function_Inner %98 %106
+        %131 = OpAccessChain %_ptr_Function_Inner_std140 %96 %106
+        %133 = OpLoad %Inner_std140 %131 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %129 %134 None
+               OpBranch %103
+        %103 = OpLabel
+        %107 = OpIAdd %uint %106 %uint_1
+               OpBranch %104
+        %105 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %98 None
+        %109 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %109
+        %112 = OpFunctionCall %int %i
+        %113 = OpBitcast %uint %112
+        %114 = OpExtInst %uint %33 UMin %113 %uint_2
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %114
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %136
@@ -239,7 +239,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %146 = OpLabel
         %148 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
         %147 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %148 %147
                OpBranch %150
@@ -250,25 +250,25 @@
                OpLoopMerge %154 %152 None
                OpBranch %151
         %151 = OpLabel
-        %157 = OpUGreaterThanEqual %bool %155 %uint_4
-               OpSelectionMerge %158 None
-               OpBranchConditional %157 %159 %158
-        %159 = OpLabel
+        %159 = OpUGreaterThanEqual %bool %155 %uint_4
+               OpSelectionMerge %160 None
+               OpBranchConditional %159 %161 %160
+        %161 = OpLabel
                OpBranch %154
-        %158 = OpLabel
-        %160 = OpAccessChain %_ptr_Function_Inner %149 %155
-        %161 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
-        %162 = OpLoad %Inner_std140 %161 None
-        %163 = OpFunctionCall %Inner %tint_convert_Inner %162
-               OpStore %160 %163 None
+        %160 = OpLabel
+        %162 = OpAccessChain %_ptr_Function_Inner %149 %155
+        %163 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
+        %164 = OpLoad %Inner_std140 %163 None
+        %165 = OpFunctionCall %Inner %tint_convert_Inner %164
+               OpStore %162 %165 None
                OpBranch %152
         %152 = OpLabel
         %156 = OpIAdd %uint %155 %uint_1
                OpBranch %153
         %154 = OpLabel
-        %164 = OpLoad %_arr_Inner_uint_4 %149 None
-        %165 = OpCompositeConstruct %Outer %164
-               OpReturnValue %165
+        %157 = OpLoad %_arr_Inner_uint_4 %149 None
+        %158 = OpCompositeConstruct %Outer %157
+               OpReturnValue %158
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %167
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -284,23 +284,23 @@
                OpLoopMerge %177 %175 None
                OpBranch %174
         %174 = OpLabel
-        %180 = OpUGreaterThanEqual %bool %178 %uint_4
-               OpSelectionMerge %181 None
-               OpBranchConditional %180 %182 %181
-        %182 = OpLabel
+        %181 = OpUGreaterThanEqual %bool %178 %uint_4
+               OpSelectionMerge %182 None
+               OpBranchConditional %181 %183 %182
+        %183 = OpLabel
                OpBranch %177
-        %181 = OpLabel
-        %183 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
-        %184 = OpLoad %Inner_std140 %183 None
-        %185 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
-               OpStore %185 %184 None
+        %182 = OpLabel
+        %184 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
+        %185 = OpLoad %Inner_std140 %184 None
+        %186 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
+               OpStore %186 %185 None
                OpBranch %175
         %175 = OpLabel
         %179 = OpIAdd %uint %178 %uint_1
                OpBranch %176
         %177 = OpLabel
-        %186 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
-               OpReturnValue %186
+        %180 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
+               OpReturnValue %180
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %188
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -324,22 +324,22 @@
                OpLoopMerge %204 %202 None
                OpBranch %201
         %201 = OpLabel
-        %207 = OpUGreaterThanEqual %bool %205 %uint_4
-               OpSelectionMerge %208 None
-               OpBranchConditional %207 %209 %208
-        %209 = OpLabel
+        %208 = OpUGreaterThanEqual %bool %205 %uint_4
+               OpSelectionMerge %209 None
+               OpBranchConditional %208 %210 %209
+        %210 = OpLabel
                OpBranch %204
-        %208 = OpLabel
-        %210 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
-        %212 = OpLoad %Outer_std140_tint_explicit_layout %210 None
-        %213 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %212
-        %214 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
-               OpStore %214 %213 None
+        %209 = OpLabel
+        %211 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
+        %213 = OpLoad %Outer_std140_tint_explicit_layout %211 None
+        %214 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %213
+        %215 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
+               OpStore %215 %214 None
                OpBranch %202
         %202 = OpLabel
         %206 = OpIAdd %uint %205 %uint_1
                OpBranch %203
         %204 = OpLabel
-        %215 = OpLoad %_arr_Outer_std140_uint_4 %198 None
-               OpReturnValue %215
+        %207 = OpLoad %_arr_Outer_std140_uint_4 %198 None
+               OpReturnValue %207
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm
index a2671fb..b46c4f8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -88,12 +88,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %54 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %75 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %85 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %108 = OpTypeFunction %Inner %Inner_std140
@@ -110,8 +110,8 @@
          %15 = OpLabel
          %46 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %48 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %54
-         %81 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %83 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+         %71 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %73 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -137,56 +137,56 @@
                OpLoopMerge %59 %57 None
                OpBranch %56
          %56 = OpLabel
-         %62 = OpUGreaterThanEqual %bool %60 %uint_4
-               OpSelectionMerge %64 None
-               OpBranchConditional %62 %65 %64
-         %65 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %60 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %59
-         %64 = OpLabel
-         %66 = OpAccessChain %_ptr_Function_Outer %48 %60
-         %68 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
-         %70 = OpLoad %Outer_std140 %68 None
-         %71 = OpFunctionCall %Outer %tint_convert_Outer %70
-               OpStore %66 %71 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_Outer %48 %60
+         %94 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
+         %96 = OpLoad %Outer_std140 %94 None
+         %97 = OpFunctionCall %Outer %tint_convert_Outer %96
+               OpStore %92 %97 None
                OpBranch %57
          %57 = OpLabel
          %61 = OpIAdd %uint %60 %uint_1
                OpBranch %58
          %59 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %48 None
-         %74 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %75 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %74
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %75
-         %78 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %79 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %78
-               OpStore %81 %79
-               OpBranch %86
-         %86 = OpLabel
-               OpBranch %89
-         %89 = OpLabel
-         %91 = OpPhi %uint %uint_0 %86 %92 %88
-               OpLoopMerge %90 %88 None
-               OpBranch %87
-         %87 = OpLabel
-         %93 = OpUGreaterThanEqual %bool %91 %uint_4
-               OpSelectionMerge %94 None
-               OpBranchConditional %93 %95 %94
-         %95 = OpLabel
-               OpBranch %90
-         %94 = OpLabel
-         %96 = OpAccessChain %_ptr_Function_Inner %83 %91
-         %98 = OpAccessChain %_ptr_Function_Inner_std140 %81 %91
-        %100 = OpLoad %Inner_std140 %98 None
-        %101 = OpFunctionCall %Inner %tint_convert_Inner %100
-               OpStore %96 %101 None
-               OpBranch %88
-         %88 = OpLabel
-         %92 = OpIAdd %uint %91 %uint_1
-               OpBranch %89
-         %90 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %83 None
-        %104 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %104
+         %63 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %64 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %63
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %64
+         %68 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %69 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %68
+               OpStore %71 %69
+               OpBranch %76
+         %76 = OpLabel
+               OpBranch %79
+         %79 = OpLabel
+         %81 = OpPhi %uint %uint_0 %76 %82 %78
+               OpLoopMerge %80 %78 None
+               OpBranch %77
+         %77 = OpLabel
+         %98 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %99 None
+               OpBranchConditional %98 %100 %99
+        %100 = OpLabel
+               OpBranch %80
+         %99 = OpLabel
+        %101 = OpAccessChain %_ptr_Function_Inner %73 %81
+        %103 = OpAccessChain %_ptr_Function_Inner_std140 %71 %81
+        %105 = OpLoad %Inner_std140 %103 None
+        %106 = OpFunctionCall %Inner %tint_convert_Inner %105
+               OpStore %101 %106 None
+               OpBranch %78
+         %78 = OpLabel
+         %82 = OpIAdd %uint %81 %uint_1
+               OpBranch %79
+         %80 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %73 None
+         %84 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %84
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -205,7 +205,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %118 = OpLabel
         %120 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
         %119 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %120 %119
                OpBranch %122
@@ -216,25 +216,25 @@
                OpLoopMerge %126 %124 None
                OpBranch %123
         %123 = OpLabel
-        %129 = OpUGreaterThanEqual %bool %127 %uint_4
-               OpSelectionMerge %130 None
-               OpBranchConditional %129 %131 %130
-        %131 = OpLabel
+        %131 = OpUGreaterThanEqual %bool %127 %uint_4
+               OpSelectionMerge %132 None
+               OpBranchConditional %131 %133 %132
+        %133 = OpLabel
                OpBranch %126
-        %130 = OpLabel
-        %132 = OpAccessChain %_ptr_Function_Inner %121 %127
-        %133 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
-        %134 = OpLoad %Inner_std140 %133 None
-        %135 = OpFunctionCall %Inner %tint_convert_Inner %134
-               OpStore %132 %135 None
+        %132 = OpLabel
+        %134 = OpAccessChain %_ptr_Function_Inner %121 %127
+        %135 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
+        %136 = OpLoad %Inner_std140 %135 None
+        %137 = OpFunctionCall %Inner %tint_convert_Inner %136
+               OpStore %134 %137 None
                OpBranch %124
         %124 = OpLabel
         %128 = OpIAdd %uint %127 %uint_1
                OpBranch %125
         %126 = OpLabel
-        %136 = OpLoad %_arr_Inner_uint_4 %121 None
-        %137 = OpCompositeConstruct %Outer %136
-               OpReturnValue %137
+        %129 = OpLoad %_arr_Inner_uint_4 %121 None
+        %130 = OpCompositeConstruct %Outer %129
+               OpReturnValue %130
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %139
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -250,23 +250,23 @@
                OpLoopMerge %149 %147 None
                OpBranch %146
         %146 = OpLabel
-        %152 = OpUGreaterThanEqual %bool %150 %uint_4
-               OpSelectionMerge %153 None
-               OpBranchConditional %152 %154 %153
-        %154 = OpLabel
+        %153 = OpUGreaterThanEqual %bool %150 %uint_4
+               OpSelectionMerge %154 None
+               OpBranchConditional %153 %155 %154
+        %155 = OpLabel
                OpBranch %149
-        %153 = OpLabel
-        %155 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
-        %156 = OpLoad %Inner_std140 %155 None
-        %157 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
-               OpStore %157 %156 None
+        %154 = OpLabel
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
+               OpStore %158 %157 None
                OpBranch %147
         %147 = OpLabel
         %151 = OpIAdd %uint %150 %uint_1
                OpBranch %148
         %149 = OpLabel
-        %158 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
-               OpReturnValue %158
+        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
+               OpReturnValue %152
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %160
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -290,22 +290,22 @@
                OpLoopMerge %176 %174 None
                OpBranch %173
         %173 = OpLabel
-        %179 = OpUGreaterThanEqual %bool %177 %uint_4
-               OpSelectionMerge %180 None
-               OpBranchConditional %179 %181 %180
-        %181 = OpLabel
+        %180 = OpUGreaterThanEqual %bool %177 %uint_4
+               OpSelectionMerge %181 None
+               OpBranchConditional %180 %182 %181
+        %182 = OpLabel
                OpBranch %176
-        %180 = OpLabel
-        %182 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
-        %184 = OpLoad %Outer_std140_tint_explicit_layout %182 None
-        %185 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %184
-        %186 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
-               OpStore %186 %185 None
+        %181 = OpLabel
+        %183 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
+        %185 = OpLoad %Outer_std140_tint_explicit_layout %183 None
+        %186 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %185
+        %187 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
+               OpStore %187 %186 None
                OpBranch %174
         %174 = OpLabel
         %178 = OpIAdd %uint %177 %uint_1
                OpBranch %175
         %176 = OpLabel
-        %187 = OpLoad %_arr_Outer_std140_uint_4 %170 None
-               OpReturnValue %187
+        %179 = OpLoad %_arr_Outer_std140_uint_4 %170 None
+               OpReturnValue %179
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.spvasm
index 165b357..d4447e3 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.spvasm
@@ -76,14 +76,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %99 = OpTypeFunction %S %S_std140
         %110 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -129,47 +129,47 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_S %47 %55
+         %94 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %96 = OpLoad %S_std140 %94 None
+         %97 = OpFunctionCall %S %tint_convert_S %96
+               OpStore %92 %97 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v3half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v3half %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v3half %82 None
-         %85 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
-         %86 = OpLoad %v3half %85 None
-         %87 = OpCompositeConstruct %mat4v3half %79 %81 %84 %86
-         %88 = OpFunctionCall %void %c %87
-         %89 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v3half %89 None
-         %91 = OpVectorShuffle %v3half %90 %90 2 0 1
-         %92 = OpFunctionCall %void %d %91
-         %93 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %94 = OpLoad %v3half %93 None
-         %95 = OpVectorShuffle %v3half %94 %94 2 0 1
-         %96 = OpCompositeExtract %half %95 0
-         %97 = OpFunctionCall %void %e %96
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v3half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v3half %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v3half %72 None
+         %75 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
+         %76 = OpLoad %v3half %75 None
+         %77 = OpCompositeConstruct %mat4v3half %69 %71 %74 %76
+         %78 = OpFunctionCall %void %c %77
+         %79 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %80 = OpLoad %v3half %79 None
+         %81 = OpVectorShuffle %v3half %80 %80 2 0 1
+         %82 = OpFunctionCall %void %d %81
+         %83 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %84 = OpLoad %v3half %83 None
+         %85 = OpVectorShuffle %v3half %84 %84 2 0 1
+         %86 = OpCompositeExtract %half %85 0
+         %87 = OpFunctionCall %void %e %86
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %99
@@ -199,21 +199,21 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %121
-        %127 = OpLoad %S_std140 %126 None
-        %128 = OpAccessChain %_ptr_Function_S_std140 %114 %121
-               OpStore %128 %127 None
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %121
+        %128 = OpLoad %S_std140 %127 None
+        %129 = OpAccessChain %_ptr_Function_S_std140 %114 %121
+               OpStore %129 %128 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %129 = OpLoad %_arr_S_std140_uint_4_0 %114 None
-               OpReturnValue %129
+        %123 = OpLoad %_arr_S_std140_uint_4_0 %114 None
+               OpReturnValue %123
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.spvasm
index 61e0cac..462e372 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.spvasm
@@ -64,17 +64,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat4v3half = OpTypePointer Private %mat4v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
 %_ptr_Private_v3half = OpTypePointer Private %v3half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %78 = OpTypeFunction %S %S_std140
          %89 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -95,45 +95,45 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_S %30 %37
+         %73 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %75 = OpLoad %S_std140 %73 None
+         %76 = OpFunctionCall %S %tint_convert_S %75
+               OpStore %71 %76 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat4v3half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v3half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v3half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v3half %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
-         %70 = OpLoad %v3half %69 None
-         %71 = OpCompositeConstruct %mat4v3half %64 %66 %68 %70
-               OpStore %59 %71 None
-         %72 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %75 = OpLoad %v3half %74 None
-         %76 = OpVectorShuffle %v3half %75 %75 2 0 1
-               OpStore %72 %76 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat4v3half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v3half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v3half %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v3half %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
+         %60 = OpLoad %v3half %59 None
+         %61 = OpCompositeConstruct %mat4v3half %54 %56 %58 %60
+               OpStore %49 %61 None
+         %62 = OpAccessChain %_ptr_Private_v3half %p %uint_1 %uint_1 %uint_0
+         %64 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %65 = OpLoad %v3half %64 None
+         %66 = OpVectorShuffle %v3half %65 %65 2 0 1
+               OpStore %62 %66 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %78
@@ -163,21 +163,21 @@
                OpLoopMerge %99 %97 None
                OpBranch %96
          %96 = OpLabel
-        %102 = OpUGreaterThanEqual %bool %100 %uint_4
-               OpSelectionMerge %103 None
-               OpBranchConditional %102 %104 %103
-        %104 = OpLabel
+        %103 = OpUGreaterThanEqual %bool %100 %uint_4
+               OpSelectionMerge %104 None
+               OpBranchConditional %103 %105 %104
+        %105 = OpLabel
                OpBranch %99
-        %103 = OpLabel
-        %105 = OpAccessChain %_ptr_Function_S_std140 %91 %100
-        %106 = OpLoad %S_std140 %105 None
-        %107 = OpAccessChain %_ptr_Function_S_std140 %93 %100
-               OpStore %107 %106 None
+        %104 = OpLabel
+        %106 = OpAccessChain %_ptr_Function_S_std140 %91 %100
+        %107 = OpLoad %S_std140 %106 None
+        %108 = OpAccessChain %_ptr_Function_S_std140 %93 %100
+               OpStore %108 %107 None
                OpBranch %97
          %97 = OpLabel
         %101 = OpIAdd %uint %100 %uint_1
                OpBranch %98
          %99 = OpLabel
-        %108 = OpLoad %_arr_S_std140_uint_4_0 %93 None
-               OpReturnValue %108
+        %102 = OpLoad %_arr_S_std140_uint_4_0 %93 None
+               OpReturnValue %102
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.spvasm
index 7279a2e..f12bdd1 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.spvasm
@@ -91,16 +91,16 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %86 = OpTypeFunction %void %_arr_S_uint_4
         %105 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -125,45 +125,45 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %75 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %78 %77
+         %78 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %77 = OpLabel
+         %79 = OpAccessChain %_ptr_Function_S %30 %40
+         %81 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %83 = OpLoad %S_std140 %81 None
+         %84 = OpFunctionCall %S %tint_convert_S %83
+               OpStore %79 %84 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %68 = OpLoad %v3half %66 None
-         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %70 = OpLoad %v3half %69 None
-         %71 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %73 = OpLoad %v3half %71 None
-         %74 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
-         %75 = OpLoad %v3half %74 None
-         %76 = OpCompositeConstruct %mat4v3half %68 %70 %73 %75
-         %77 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
-         %78 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %77 %76
-         %80 = OpAccessChain %_ptr_StorageBuffer_v3half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %83 = OpLoad %v3half %82 None
-         %84 = OpVectorShuffle %v3half %83 %83 2 0 1
-               OpStore %80 %84 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3half %56 None
+         %59 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3half %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v3half %61 None
+         %64 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
+         %65 = OpLoad %v3half %64 None
+         %66 = OpCompositeConstruct %mat4v3half %58 %60 %63 %65
+         %67 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
+         %68 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %67 %66
+         %70 = OpAccessChain %_ptr_StorageBuffer_v3half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %72 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %73 = OpLoad %v3half %72 None
+         %74 = OpVectorShuffle %v3half %73 %73 2 0 1
+               OpStore %70 %74 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %86
@@ -258,21 +258,21 @@
                OpLoopMerge %151 %149 None
                OpBranch %148
         %148 = OpLabel
-        %154 = OpUGreaterThanEqual %bool %152 %uint_4
-               OpSelectionMerge %155 None
-               OpBranchConditional %154 %156 %155
-        %156 = OpLabel
+        %155 = OpUGreaterThanEqual %bool %152 %uint_4
+               OpSelectionMerge %156 None
+               OpBranchConditional %155 %157 %156
+        %157 = OpLabel
                OpBranch %151
-        %155 = OpLabel
-        %157 = OpAccessChain %_ptr_Function_S_std140 %143 %152
-        %158 = OpLoad %S_std140 %157 None
-        %159 = OpAccessChain %_ptr_Function_S_std140 %145 %152
-               OpStore %159 %158 None
+        %156 = OpLabel
+        %158 = OpAccessChain %_ptr_Function_S_std140 %143 %152
+        %159 = OpLoad %S_std140 %158 None
+        %160 = OpAccessChain %_ptr_Function_S_std140 %145 %152
+               OpStore %160 %159 None
                OpBranch %149
         %149 = OpLabel
         %153 = OpIAdd %uint %152 %uint_1
                OpBranch %150
         %151 = OpLabel
-        %160 = OpLoad %_arr_S_std140_uint_4_0 %145 None
-               OpReturnValue %160
+        %154 = OpLoad %_arr_S_std140_uint_4_0 %145 None
+               OpReturnValue %154
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
index 4f62eae..6372e6f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -64,10 +64,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -75,14 +71,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat4v3half = OpTypePointer Workgroup %mat4v3half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
+       %bool = OpTypeBool
+         %84 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %95 = OpTypeFunction %void
         %100 = OpTypeFunction %S %S_std140
         %111 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -91,8 +91,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -101,71 +101,71 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %83 %84 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat4v3half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v3half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v3half %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v3half %84 None
-         %86 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
-         %87 = OpLoad %v3half %86 None
-         %88 = OpCompositeConstruct %mat4v3half %81 %83 %85 %87
-               OpStore %76 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_1 %uint_0
-         %91 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v3half %91 None
-         %93 = OpVectorShuffle %v3half %92 %92 2 0 1
-               OpStore %89 %93 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %85 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %86
+         %87 = OpLabel
+               OpBranch %49
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_S %42 %50
+         %90 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %92 = OpLoad %S_std140 %90 None
+         %93 = OpFunctionCall %S %tint_convert_S %92
+               OpStore %88 %93 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat4v3half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v3half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v3half %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v3half %69 None
+         %71 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_2 %uint_4
+         %72 = OpLoad %v3half %71 None
+         %73 = OpCompositeConstruct %mat4v3half %66 %68 %70 %72
+               OpStore %61 %73 None
+         %74 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1 %uint_1 %uint_0
+         %76 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0 %uint_0 %uint_2
+         %77 = OpLoad %v3half %76 None
+         %78 = OpVectorShuffle %v3half %77 %77 2 0 1
+               OpStore %74 %78 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %95
@@ -201,21 +201,21 @@
                OpLoopMerge %121 %119 None
                OpBranch %118
         %118 = OpLabel
-        %124 = OpUGreaterThanEqual %bool %122 %uint_4
-               OpSelectionMerge %125 None
-               OpBranchConditional %124 %126 %125
-        %126 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %122 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %121
-        %125 = OpLabel
-        %127 = OpAccessChain %_ptr_Function_S_std140 %113 %122
-        %128 = OpLoad %S_std140 %127 None
-        %129 = OpAccessChain %_ptr_Function_S_std140 %115 %122
-               OpStore %129 %128 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_S_std140 %113 %122
+        %129 = OpLoad %S_std140 %128 None
+        %130 = OpAccessChain %_ptr_Function_S_std140 %115 %122
+               OpStore %130 %129 None
                OpBranch %119
         %119 = OpLabel
         %123 = OpIAdd %uint %122 %uint_1
                OpBranch %120
         %121 = OpLabel
-        %130 = OpLoad %_arr_S_std140_uint_4_0 %115 None
-               OpReturnValue %130
+        %124 = OpLoad %_arr_S_std140_uint_4_0 %115 None
+               OpReturnValue %124
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index 2c62835..b9f8b6a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -96,12 +96,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %79 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+        %100 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %110 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %136 = OpTypeFunction %Inner %Inner_std140
@@ -127,8 +127,8 @@
          %57 = OpVariable %_ptr_Function_mat4v3float Function
          %71 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %73 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %79
-        %106 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %108 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+         %96 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %98 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -165,60 +165,60 @@
                OpLoopMerge %84 %82 None
                OpBranch %81
          %81 = OpLabel
-         %87 = OpUGreaterThanEqual %bool %85 %uint_4
-               OpSelectionMerge %89 None
-               OpBranchConditional %87 %90 %89
-         %90 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %85 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %116 %119 %118
+        %119 = OpLabel
                OpBranch %84
-         %89 = OpLabel
-         %91 = OpAccessChain %_ptr_Function_Outer %73 %85
-         %93 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
-         %95 = OpLoad %Outer_std140 %93 None
-         %96 = OpFunctionCall %Outer %tint_convert_Outer %95
-               OpStore %91 %96 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_Outer %73 %85
+        %122 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
+        %124 = OpLoad %Outer_std140 %122 None
+        %125 = OpFunctionCall %Outer %tint_convert_Outer %124
+               OpStore %120 %125 None
                OpBranch %82
          %82 = OpLabel
          %86 = OpIAdd %uint %85 %uint_1
                OpBranch %83
          %84 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %73 None
-         %99 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-        %100 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %99
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %100
-        %103 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %104 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %103
-               OpStore %106 %104
-               OpBranch %111
-        %111 = OpLabel
-               OpBranch %114
-        %114 = OpLabel
-        %116 = OpPhi %uint %uint_0 %111 %117 %113
-               OpLoopMerge %115 %113 None
-               OpBranch %112
-        %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
-               OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_Inner %108 %116
-        %123 = OpAccessChain %_ptr_Function_Inner_std140 %106 %116
-        %125 = OpLoad %Inner_std140 %123 None
-        %126 = OpFunctionCall %Inner %tint_convert_Inner %125
-               OpStore %121 %126 None
-               OpBranch %113
-        %113 = OpLabel
-        %117 = OpIAdd %uint %116 %uint_1
-               OpBranch %114
-        %115 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %108 None
-        %129 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %129
-        %131 = OpFunctionCall %int %i
-        %132 = OpBitcast %uint %131
-        %133 = OpExtInst %uint %33 UMin %132 %uint_2
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %133
+         %88 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %89 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %88
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %89
+         %93 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %94 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %93
+               OpStore %96 %94
+               OpBranch %101
+        %101 = OpLabel
+               OpBranch %104
+        %104 = OpLabel
+        %106 = OpPhi %uint %uint_0 %101 %107 %103
+               OpLoopMerge %105 %103 None
+               OpBranch %102
+        %102 = OpLabel
+        %126 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %127 None
+               OpBranchConditional %126 %128 %127
+        %128 = OpLabel
+               OpBranch %105
+        %127 = OpLabel
+        %129 = OpAccessChain %_ptr_Function_Inner %98 %106
+        %131 = OpAccessChain %_ptr_Function_Inner_std140 %96 %106
+        %133 = OpLoad %Inner_std140 %131 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %129 %134 None
+               OpBranch %103
+        %103 = OpLabel
+        %107 = OpIAdd %uint %106 %uint_1
+               OpBranch %104
+        %105 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %98 None
+        %109 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %109
+        %112 = OpFunctionCall %int %i
+        %113 = OpBitcast %uint %112
+        %114 = OpExtInst %uint %33 UMin %113 %uint_2
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %float %l_a_i_a_i_m_i %114
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %136
@@ -236,7 +236,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %146 = OpLabel
         %148 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
         %147 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %148 %147
                OpBranch %150
@@ -247,25 +247,25 @@
                OpLoopMerge %154 %152 None
                OpBranch %151
         %151 = OpLabel
-        %157 = OpUGreaterThanEqual %bool %155 %uint_4
-               OpSelectionMerge %158 None
-               OpBranchConditional %157 %159 %158
-        %159 = OpLabel
+        %159 = OpUGreaterThanEqual %bool %155 %uint_4
+               OpSelectionMerge %160 None
+               OpBranchConditional %159 %161 %160
+        %161 = OpLabel
                OpBranch %154
-        %158 = OpLabel
-        %160 = OpAccessChain %_ptr_Function_Inner %149 %155
-        %161 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
-        %162 = OpLoad %Inner_std140 %161 None
-        %163 = OpFunctionCall %Inner %tint_convert_Inner %162
-               OpStore %160 %163 None
+        %160 = OpLabel
+        %162 = OpAccessChain %_ptr_Function_Inner %149 %155
+        %163 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
+        %164 = OpLoad %Inner_std140 %163 None
+        %165 = OpFunctionCall %Inner %tint_convert_Inner %164
+               OpStore %162 %165 None
                OpBranch %152
         %152 = OpLabel
         %156 = OpIAdd %uint %155 %uint_1
                OpBranch %153
         %154 = OpLabel
-        %164 = OpLoad %_arr_Inner_uint_4 %149 None
-        %165 = OpCompositeConstruct %Outer %164
-               OpReturnValue %165
+        %157 = OpLoad %_arr_Inner_uint_4 %149 None
+        %158 = OpCompositeConstruct %Outer %157
+               OpReturnValue %158
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %167
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -281,23 +281,23 @@
                OpLoopMerge %177 %175 None
                OpBranch %174
         %174 = OpLabel
-        %180 = OpUGreaterThanEqual %bool %178 %uint_4
-               OpSelectionMerge %181 None
-               OpBranchConditional %180 %182 %181
-        %182 = OpLabel
+        %181 = OpUGreaterThanEqual %bool %178 %uint_4
+               OpSelectionMerge %182 None
+               OpBranchConditional %181 %183 %182
+        %183 = OpLabel
                OpBranch %177
-        %181 = OpLabel
-        %183 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
-        %184 = OpLoad %Inner_std140 %183 None
-        %185 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
-               OpStore %185 %184 None
+        %182 = OpLabel
+        %184 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
+        %185 = OpLoad %Inner_std140 %184 None
+        %186 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
+               OpStore %186 %185 None
                OpBranch %175
         %175 = OpLabel
         %179 = OpIAdd %uint %178 %uint_1
                OpBranch %176
         %177 = OpLabel
-        %186 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
-               OpReturnValue %186
+        %180 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
+               OpReturnValue %180
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %188
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -321,22 +321,22 @@
                OpLoopMerge %204 %202 None
                OpBranch %201
         %201 = OpLabel
-        %207 = OpUGreaterThanEqual %bool %205 %uint_4
-               OpSelectionMerge %208 None
-               OpBranchConditional %207 %209 %208
-        %209 = OpLabel
+        %208 = OpUGreaterThanEqual %bool %205 %uint_4
+               OpSelectionMerge %209 None
+               OpBranchConditional %208 %210 %209
+        %210 = OpLabel
                OpBranch %204
-        %208 = OpLabel
-        %210 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
-        %212 = OpLoad %Outer_std140_tint_explicit_layout %210 None
-        %213 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %212
-        %214 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
-               OpStore %214 %213 None
+        %209 = OpLabel
+        %211 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
+        %213 = OpLoad %Outer_std140_tint_explicit_layout %211 None
+        %214 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %213
+        %215 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
+               OpStore %215 %214 None
                OpBranch %202
         %202 = OpLabel
         %206 = OpIAdd %uint %205 %uint_1
                OpBranch %203
         %204 = OpLabel
-        %215 = OpLoad %_arr_Outer_std140_uint_4 %198 None
-               OpReturnValue %215
+        %207 = OpLoad %_arr_Outer_std140_uint_4 %198 None
+               OpReturnValue %207
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm
index bd750ed..3bcdb58 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -85,12 +85,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %54 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %75 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %85 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %108 = OpTypeFunction %Inner %Inner_std140
@@ -107,8 +107,8 @@
          %15 = OpLabel
          %46 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %48 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %54
-         %81 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %83 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+         %71 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %73 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -134,56 +134,56 @@
                OpLoopMerge %59 %57 None
                OpBranch %56
          %56 = OpLabel
-         %62 = OpUGreaterThanEqual %bool %60 %uint_4
-               OpSelectionMerge %64 None
-               OpBranchConditional %62 %65 %64
-         %65 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %60 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %59
-         %64 = OpLabel
-         %66 = OpAccessChain %_ptr_Function_Outer %48 %60
-         %68 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
-         %70 = OpLoad %Outer_std140 %68 None
-         %71 = OpFunctionCall %Outer %tint_convert_Outer %70
-               OpStore %66 %71 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_Outer %48 %60
+         %94 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
+         %96 = OpLoad %Outer_std140 %94 None
+         %97 = OpFunctionCall %Outer %tint_convert_Outer %96
+               OpStore %92 %97 None
                OpBranch %57
          %57 = OpLabel
          %61 = OpIAdd %uint %60 %uint_1
                OpBranch %58
          %59 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %48 None
-         %74 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %75 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %74
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %75
-         %78 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %79 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %78
-               OpStore %81 %79
-               OpBranch %86
-         %86 = OpLabel
-               OpBranch %89
-         %89 = OpLabel
-         %91 = OpPhi %uint %uint_0 %86 %92 %88
-               OpLoopMerge %90 %88 None
-               OpBranch %87
-         %87 = OpLabel
-         %93 = OpUGreaterThanEqual %bool %91 %uint_4
-               OpSelectionMerge %94 None
-               OpBranchConditional %93 %95 %94
-         %95 = OpLabel
-               OpBranch %90
-         %94 = OpLabel
-         %96 = OpAccessChain %_ptr_Function_Inner %83 %91
-         %98 = OpAccessChain %_ptr_Function_Inner_std140 %81 %91
-        %100 = OpLoad %Inner_std140 %98 None
-        %101 = OpFunctionCall %Inner %tint_convert_Inner %100
-               OpStore %96 %101 None
-               OpBranch %88
-         %88 = OpLabel
-         %92 = OpIAdd %uint %91 %uint_1
-               OpBranch %89
-         %90 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %83 None
-        %104 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %104
+         %63 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %64 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %63
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %64
+         %68 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %69 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %68
+               OpStore %71 %69
+               OpBranch %76
+         %76 = OpLabel
+               OpBranch %79
+         %79 = OpLabel
+         %81 = OpPhi %uint %uint_0 %76 %82 %78
+               OpLoopMerge %80 %78 None
+               OpBranch %77
+         %77 = OpLabel
+         %98 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %99 None
+               OpBranchConditional %98 %100 %99
+        %100 = OpLabel
+               OpBranch %80
+         %99 = OpLabel
+        %101 = OpAccessChain %_ptr_Function_Inner %73 %81
+        %103 = OpAccessChain %_ptr_Function_Inner_std140 %71 %81
+        %105 = OpLoad %Inner_std140 %103 None
+        %106 = OpFunctionCall %Inner %tint_convert_Inner %105
+               OpStore %101 %106 None
+               OpBranch %78
+         %78 = OpLabel
+         %82 = OpIAdd %uint %81 %uint_1
+               OpBranch %79
+         %80 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %73 None
+         %84 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %84
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %float %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -202,7 +202,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %118 = OpLabel
         %120 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
         %119 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %120 %119
                OpBranch %122
@@ -213,25 +213,25 @@
                OpLoopMerge %126 %124 None
                OpBranch %123
         %123 = OpLabel
-        %129 = OpUGreaterThanEqual %bool %127 %uint_4
-               OpSelectionMerge %130 None
-               OpBranchConditional %129 %131 %130
-        %131 = OpLabel
+        %131 = OpUGreaterThanEqual %bool %127 %uint_4
+               OpSelectionMerge %132 None
+               OpBranchConditional %131 %133 %132
+        %133 = OpLabel
                OpBranch %126
-        %130 = OpLabel
-        %132 = OpAccessChain %_ptr_Function_Inner %121 %127
-        %133 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
-        %134 = OpLoad %Inner_std140 %133 None
-        %135 = OpFunctionCall %Inner %tint_convert_Inner %134
-               OpStore %132 %135 None
+        %132 = OpLabel
+        %134 = OpAccessChain %_ptr_Function_Inner %121 %127
+        %135 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
+        %136 = OpLoad %Inner_std140 %135 None
+        %137 = OpFunctionCall %Inner %tint_convert_Inner %136
+               OpStore %134 %137 None
                OpBranch %124
         %124 = OpLabel
         %128 = OpIAdd %uint %127 %uint_1
                OpBranch %125
         %126 = OpLabel
-        %136 = OpLoad %_arr_Inner_uint_4 %121 None
-        %137 = OpCompositeConstruct %Outer %136
-               OpReturnValue %137
+        %129 = OpLoad %_arr_Inner_uint_4 %121 None
+        %130 = OpCompositeConstruct %Outer %129
+               OpReturnValue %130
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %139
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -247,23 +247,23 @@
                OpLoopMerge %149 %147 None
                OpBranch %146
         %146 = OpLabel
-        %152 = OpUGreaterThanEqual %bool %150 %uint_4
-               OpSelectionMerge %153 None
-               OpBranchConditional %152 %154 %153
-        %154 = OpLabel
+        %153 = OpUGreaterThanEqual %bool %150 %uint_4
+               OpSelectionMerge %154 None
+               OpBranchConditional %153 %155 %154
+        %155 = OpLabel
                OpBranch %149
-        %153 = OpLabel
-        %155 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
-        %156 = OpLoad %Inner_std140 %155 None
-        %157 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
-               OpStore %157 %156 None
+        %154 = OpLabel
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
+               OpStore %158 %157 None
                OpBranch %147
         %147 = OpLabel
         %151 = OpIAdd %uint %150 %uint_1
                OpBranch %148
         %149 = OpLabel
-        %158 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
-               OpReturnValue %158
+        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
+               OpReturnValue %152
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %160
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -287,22 +287,22 @@
                OpLoopMerge %176 %174 None
                OpBranch %173
         %173 = OpLabel
-        %179 = OpUGreaterThanEqual %bool %177 %uint_4
-               OpSelectionMerge %180 None
-               OpBranchConditional %179 %181 %180
-        %181 = OpLabel
+        %180 = OpUGreaterThanEqual %bool %177 %uint_4
+               OpSelectionMerge %181 None
+               OpBranchConditional %180 %182 %181
+        %182 = OpLabel
                OpBranch %176
-        %180 = OpLabel
-        %182 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
-        %184 = OpLoad %Outer_std140_tint_explicit_layout %182 None
-        %185 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %184
-        %186 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
-               OpStore %186 %185 None
+        %181 = OpLabel
+        %183 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
+        %185 = OpLoad %Outer_std140_tint_explicit_layout %183 None
+        %186 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %185
+        %187 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
+               OpStore %187 %186 None
                OpBranch %174
         %174 = OpLabel
         %178 = OpIAdd %uint %177 %uint_1
                OpBranch %175
         %176 = OpLabel
-        %187 = OpLoad %_arr_Outer_std140_uint_4 %170 None
-               OpReturnValue %187
+        %179 = OpLoad %_arr_Outer_std140_uint_4 %170 None
+               OpReturnValue %179
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.spvasm
index c2ab90d..6dbda93 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.spvasm
@@ -73,14 +73,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %99 = OpTypeFunction %S %S_std140
         %110 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -126,47 +126,47 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_S %47 %55
+         %94 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %96 = OpLoad %S_std140 %94 None
+         %97 = OpFunctionCall %S %tint_convert_S %96
+               OpStore %92 %97 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v3float %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v3float %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v3float %82 None
-         %85 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
-         %86 = OpLoad %v3float %85 None
-         %87 = OpCompositeConstruct %mat4v3float %79 %81 %84 %86
-         %88 = OpFunctionCall %void %c %87
-         %89 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v3float %89 None
-         %91 = OpVectorShuffle %v3float %90 %90 2 0 1
-         %92 = OpFunctionCall %void %d %91
-         %93 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %94 = OpLoad %v3float %93 None
-         %95 = OpVectorShuffle %v3float %94 %94 2 0 1
-         %96 = OpCompositeExtract %float %95 0
-         %97 = OpFunctionCall %void %e %96
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v3float %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v3float %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v3float %72 None
+         %75 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
+         %76 = OpLoad %v3float %75 None
+         %77 = OpCompositeConstruct %mat4v3float %69 %71 %74 %76
+         %78 = OpFunctionCall %void %c %77
+         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %80 = OpLoad %v3float %79 None
+         %81 = OpVectorShuffle %v3float %80 %80 2 0 1
+         %82 = OpFunctionCall %void %d %81
+         %83 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %84 = OpLoad %v3float %83 None
+         %85 = OpVectorShuffle %v3float %84 %84 2 0 1
+         %86 = OpCompositeExtract %float %85 0
+         %87 = OpFunctionCall %void %e %86
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %99
@@ -196,21 +196,21 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %121
-        %127 = OpLoad %S_std140 %126 None
-        %128 = OpAccessChain %_ptr_Function_S_std140 %114 %121
-               OpStore %128 %127 None
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %121
+        %128 = OpLoad %S_std140 %127 None
+        %129 = OpAccessChain %_ptr_Function_S_std140 %114 %121
+               OpStore %129 %128 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %129 = OpLoad %_arr_S_std140_uint_4_0 %114 None
-               OpReturnValue %129
+        %123 = OpLoad %_arr_S_std140_uint_4_0 %114 None
+               OpReturnValue %123
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.spvasm
index e0123eb..f4b6e21 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.spvasm
@@ -61,17 +61,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat4v3float = OpTypePointer Private %mat4v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Private_v3float = OpTypePointer Private %v3float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %78 = OpTypeFunction %S %S_std140
          %89 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -92,45 +92,45 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_S %30 %37
+         %73 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %75 = OpLoad %S_std140 %73 None
+         %76 = OpFunctionCall %S %tint_convert_S %75
+               OpStore %71 %76 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat4v3float %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v3float %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v3float %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v3float %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
-         %70 = OpLoad %v3float %69 None
-         %71 = OpCompositeConstruct %mat4v3float %64 %66 %68 %70
-               OpStore %59 %71 None
-         %72 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %75 = OpLoad %v3float %74 None
-         %76 = OpVectorShuffle %v3float %75 %75 2 0 1
-               OpStore %72 %76 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat4v3float %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v3float %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v3float %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v3float %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
+         %60 = OpLoad %v3float %59 None
+         %61 = OpCompositeConstruct %mat4v3float %54 %56 %58 %60
+               OpStore %49 %61 None
+         %62 = OpAccessChain %_ptr_Private_v3float %p %uint_1 %uint_1 %uint_0
+         %64 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %65 = OpLoad %v3float %64 None
+         %66 = OpVectorShuffle %v3float %65 %65 2 0 1
+               OpStore %62 %66 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %78
@@ -160,21 +160,21 @@
                OpLoopMerge %99 %97 None
                OpBranch %96
          %96 = OpLabel
-        %102 = OpUGreaterThanEqual %bool %100 %uint_4
-               OpSelectionMerge %103 None
-               OpBranchConditional %102 %104 %103
-        %104 = OpLabel
+        %103 = OpUGreaterThanEqual %bool %100 %uint_4
+               OpSelectionMerge %104 None
+               OpBranchConditional %103 %105 %104
+        %105 = OpLabel
                OpBranch %99
-        %103 = OpLabel
-        %105 = OpAccessChain %_ptr_Function_S_std140 %91 %100
-        %106 = OpLoad %S_std140 %105 None
-        %107 = OpAccessChain %_ptr_Function_S_std140 %93 %100
-               OpStore %107 %106 None
+        %104 = OpLabel
+        %106 = OpAccessChain %_ptr_Function_S_std140 %91 %100
+        %107 = OpLoad %S_std140 %106 None
+        %108 = OpAccessChain %_ptr_Function_S_std140 %93 %100
+               OpStore %108 %107 None
                OpBranch %97
          %97 = OpLabel
         %101 = OpIAdd %uint %100 %uint_1
                OpBranch %98
          %99 = OpLabel
-        %108 = OpLoad %_arr_S_std140_uint_4_0 %93 None
-               OpReturnValue %108
+        %102 = OpLoad %_arr_S_std140_uint_4_0 %93 None
+               OpReturnValue %102
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.spvasm
index eef98be..08d536b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.spvasm
@@ -88,16 +88,16 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %86 = OpTypeFunction %void %_arr_S_uint_4
         %105 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -122,45 +122,45 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %75 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %77 None
+               OpBranchConditional %75 %78 %77
+         %78 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %77 = OpLabel
+         %79 = OpAccessChain %_ptr_Function_S %30 %40
+         %81 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %83 = OpLoad %S_std140 %81 None
+         %84 = OpFunctionCall %S %tint_convert_S %83
+               OpStore %79 %84 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %68 = OpLoad %v3float %66 None
-         %69 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %70 = OpLoad %v3float %69 None
-         %71 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %73 = OpLoad %v3float %71 None
-         %74 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
-         %75 = OpLoad %v3float %74 None
-         %76 = OpCompositeConstruct %mat4v3float %68 %70 %73 %75
-         %77 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
-         %78 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %77 %76
-         %80 = OpAccessChain %_ptr_StorageBuffer_v3float %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %83 = OpLoad %v3float %82 None
-         %84 = OpVectorShuffle %v3float %83 %83 2 0 1
-               OpStore %80 %84 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %58 = OpLoad %v3float %56 None
+         %59 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %60 = OpLoad %v3float %59 None
+         %61 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %63 = OpLoad %v3float %61 None
+         %64 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
+         %65 = OpLoad %v3float %64 None
+         %66 = OpCompositeConstruct %mat4v3float %58 %60 %63 %65
+         %67 = OpCompositeConstruct %_arr_uint_uint_1 %uint_3
+         %68 = OpFunctionCall %void %tint_store_and_preserve_padding_1 %67 %66
+         %70 = OpAccessChain %_ptr_StorageBuffer_v3float %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %72 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %73 = OpLoad %v3float %72 None
+         %74 = OpVectorShuffle %v3float %73 %73 2 0 1
+               OpStore %70 %74 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %86
@@ -255,21 +255,21 @@
                OpLoopMerge %151 %149 None
                OpBranch %148
         %148 = OpLabel
-        %154 = OpUGreaterThanEqual %bool %152 %uint_4
-               OpSelectionMerge %155 None
-               OpBranchConditional %154 %156 %155
-        %156 = OpLabel
+        %155 = OpUGreaterThanEqual %bool %152 %uint_4
+               OpSelectionMerge %156 None
+               OpBranchConditional %155 %157 %156
+        %157 = OpLabel
                OpBranch %151
-        %155 = OpLabel
-        %157 = OpAccessChain %_ptr_Function_S_std140 %143 %152
-        %158 = OpLoad %S_std140 %157 None
-        %159 = OpAccessChain %_ptr_Function_S_std140 %145 %152
-               OpStore %159 %158 None
+        %156 = OpLabel
+        %158 = OpAccessChain %_ptr_Function_S_std140 %143 %152
+        %159 = OpLoad %S_std140 %158 None
+        %160 = OpAccessChain %_ptr_Function_S_std140 %145 %152
+               OpStore %160 %159 None
                OpBranch %149
         %149 = OpLabel
         %153 = OpIAdd %uint %152 %uint_1
                OpBranch %150
         %151 = OpLabel
-        %160 = OpLoad %_arr_S_std140_uint_4_0 %145 None
-               OpReturnValue %160
+        %154 = OpLoad %_arr_S_std140_uint_4_0 %145 None
+               OpReturnValue %154
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
index 62ed7fa..ac0837a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -61,10 +61,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -72,14 +68,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat4v3float = OpTypePointer Workgroup %mat4v3float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
+       %bool = OpTypeBool
+         %84 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %95 = OpTypeFunction %void
         %100 = OpTypeFunction %S %S_std140
         %111 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -88,8 +88,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -98,71 +98,71 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %83 %84 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat4v3float %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v3float %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v3float %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v3float %84 None
-         %86 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
-         %87 = OpLoad %v3float %86 None
-         %88 = OpCompositeConstruct %mat4v3float %81 %83 %85 %87
-               OpStore %76 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_1 %uint_0
-         %91 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v3float %91 None
-         %93 = OpVectorShuffle %v3float %92 %92 2 0 1
-               OpStore %89 %93 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %85 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %86
+         %87 = OpLabel
+               OpBranch %49
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_S %42 %50
+         %90 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %92 = OpLoad %S_std140 %90 None
+         %93 = OpFunctionCall %S %tint_convert_S %92
+               OpStore %88 %93 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat4v3float %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v3float %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v3float %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v3float %69 None
+         %71 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_2 %uint_4
+         %72 = OpLoad %v3float %71 None
+         %73 = OpCompositeConstruct %mat4v3float %66 %68 %70 %72
+               OpStore %61 %73 None
+         %74 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1 %uint_1 %uint_0
+         %76 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_0 %uint_2
+         %77 = OpLoad %v3float %76 None
+         %78 = OpVectorShuffle %v3float %77 %77 2 0 1
+               OpStore %74 %78 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %95
@@ -198,21 +198,21 @@
                OpLoopMerge %121 %119 None
                OpBranch %118
         %118 = OpLabel
-        %124 = OpUGreaterThanEqual %bool %122 %uint_4
-               OpSelectionMerge %125 None
-               OpBranchConditional %124 %126 %125
-        %126 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %122 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %121
-        %125 = OpLabel
-        %127 = OpAccessChain %_ptr_Function_S_std140 %113 %122
-        %128 = OpLoad %S_std140 %127 None
-        %129 = OpAccessChain %_ptr_Function_S_std140 %115 %122
-               OpStore %129 %128 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_S_std140 %113 %122
+        %129 = OpLoad %S_std140 %128 None
+        %130 = OpAccessChain %_ptr_Function_S_std140 %115 %122
+               OpStore %130 %129 None
                OpBranch %119
         %119 = OpLabel
         %123 = OpIAdd %uint %122 %uint_1
                OpBranch %120
         %121 = OpLabel
-        %130 = OpLoad %_arr_S_std140_uint_4_0 %115 None
-               OpReturnValue %130
+        %124 = OpLoad %_arr_S_std140_uint_4_0 %115 None
+               OpReturnValue %124
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
index 440d649..1d2b4ec 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -99,12 +99,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %79 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+        %100 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-        %110 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %136 = OpTypeFunction %Inner %Inner_std140
@@ -130,8 +130,8 @@
          %57 = OpVariable %_ptr_Function_mat4v4half Function
          %71 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %73 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %79
-        %106 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %108 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+         %96 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %98 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
          %27 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %30 = OpFunctionCall %int %i
          %31 = OpBitcast %uint %30
@@ -168,60 +168,60 @@
                OpLoopMerge %84 %82 None
                OpBranch %81
          %81 = OpLabel
-         %87 = OpUGreaterThanEqual %bool %85 %uint_4
-               OpSelectionMerge %89 None
-               OpBranchConditional %87 %90 %89
-         %90 = OpLabel
+        %116 = OpUGreaterThanEqual %bool %85 %uint_4
+               OpSelectionMerge %118 None
+               OpBranchConditional %116 %119 %118
+        %119 = OpLabel
                OpBranch %84
-         %89 = OpLabel
-         %91 = OpAccessChain %_ptr_Function_Outer %73 %85
-         %93 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
-         %95 = OpLoad %Outer_std140 %93 None
-         %96 = OpFunctionCall %Outer %tint_convert_Outer %95
-               OpStore %91 %96 None
+        %118 = OpLabel
+        %120 = OpAccessChain %_ptr_Function_Outer %73 %85
+        %122 = OpAccessChain %_ptr_Function_Outer_std140 %71 %85
+        %124 = OpLoad %Outer_std140 %122 None
+        %125 = OpFunctionCall %Outer %tint_convert_Outer %124
+               OpStore %120 %125 None
                OpBranch %82
          %82 = OpLabel
          %86 = OpIAdd %uint %85 %uint_1
                OpBranch %83
          %84 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %73 None
-         %99 = OpLoad %Outer_std140_tint_explicit_layout %35 None
-        %100 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %99
-      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %100
-        %103 = OpLoad %_arr_Inner_std140_uint_4 %37 None
-        %104 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %103
-               OpStore %106 %104
-               OpBranch %111
-        %111 = OpLabel
-               OpBranch %114
-        %114 = OpLabel
-        %116 = OpPhi %uint %uint_0 %111 %117 %113
-               OpLoopMerge %115 %113 None
-               OpBranch %112
-        %112 = OpLabel
-        %118 = OpUGreaterThanEqual %bool %116 %uint_4
-               OpSelectionMerge %119 None
-               OpBranchConditional %118 %120 %119
-        %120 = OpLabel
-               OpBranch %115
-        %119 = OpLabel
-        %121 = OpAccessChain %_ptr_Function_Inner %108 %116
-        %123 = OpAccessChain %_ptr_Function_Inner_std140 %106 %116
-        %125 = OpLoad %Inner_std140 %123 None
-        %126 = OpFunctionCall %Inner %tint_convert_Inner %125
-               OpStore %121 %126 None
-               OpBranch %113
-        %113 = OpLabel
-        %117 = OpIAdd %uint %116 %uint_1
-               OpBranch %114
-        %115 = OpLabel
-    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %108 None
-        %129 = OpLoad %Inner_std140 %42 None
-  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %129
-        %131 = OpFunctionCall %int %i
-        %132 = OpBitcast %uint %131
-        %133 = OpExtInst %uint %33 UMin %132 %uint_3
-%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %133
+         %88 = OpLoad %Outer_std140_tint_explicit_layout %35 None
+         %89 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %88
+      %l_a_i = OpFunctionCall %Outer %tint_convert_Outer %89
+         %93 = OpLoad %_arr_Inner_std140_uint_4 %37 None
+         %94 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %93
+               OpStore %96 %94
+               OpBranch %101
+        %101 = OpLabel
+               OpBranch %104
+        %104 = OpLabel
+        %106 = OpPhi %uint %uint_0 %101 %107 %103
+               OpLoopMerge %105 %103 None
+               OpBranch %102
+        %102 = OpLabel
+        %126 = OpUGreaterThanEqual %bool %106 %uint_4
+               OpSelectionMerge %127 None
+               OpBranchConditional %126 %128 %127
+        %128 = OpLabel
+               OpBranch %105
+        %127 = OpLabel
+        %129 = OpAccessChain %_ptr_Function_Inner %98 %106
+        %131 = OpAccessChain %_ptr_Function_Inner_std140 %96 %106
+        %133 = OpLoad %Inner_std140 %131 None
+        %134 = OpFunctionCall %Inner %tint_convert_Inner %133
+               OpStore %129 %134 None
+               OpBranch %103
+        %103 = OpLabel
+        %107 = OpIAdd %uint %106 %uint_1
+               OpBranch %104
+        %105 = OpLabel
+    %l_a_i_a = OpLoad %_arr_Inner_uint_4 %98 None
+        %109 = OpLoad %Inner_std140 %42 None
+  %l_a_i_a_i = OpFunctionCall %Inner %tint_convert_Inner %109
+        %112 = OpFunctionCall %int %i
+        %113 = OpBitcast %uint %112
+        %114 = OpExtInst %uint %33 UMin %113 %uint_3
+%l_a_i_a_i_m_i_i = OpVectorExtractDynamic %half %l_a_i_a_i_m_i %114
                OpReturn
                OpFunctionEnd
 %tint_convert_Inner = OpFunction %Inner None %136
@@ -239,7 +239,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %146 = OpLabel
         %148 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %110
+        %149 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %100
         %147 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %148 %147
                OpBranch %150
@@ -250,25 +250,25 @@
                OpLoopMerge %154 %152 None
                OpBranch %151
         %151 = OpLabel
-        %157 = OpUGreaterThanEqual %bool %155 %uint_4
-               OpSelectionMerge %158 None
-               OpBranchConditional %157 %159 %158
-        %159 = OpLabel
+        %159 = OpUGreaterThanEqual %bool %155 %uint_4
+               OpSelectionMerge %160 None
+               OpBranchConditional %159 %161 %160
+        %161 = OpLabel
                OpBranch %154
-        %158 = OpLabel
-        %160 = OpAccessChain %_ptr_Function_Inner %149 %155
-        %161 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
-        %162 = OpLoad %Inner_std140 %161 None
-        %163 = OpFunctionCall %Inner %tint_convert_Inner %162
-               OpStore %160 %163 None
+        %160 = OpLabel
+        %162 = OpAccessChain %_ptr_Function_Inner %149 %155
+        %163 = OpAccessChain %_ptr_Function_Inner_std140 %148 %155
+        %164 = OpLoad %Inner_std140 %163 None
+        %165 = OpFunctionCall %Inner %tint_convert_Inner %164
+               OpStore %162 %165 None
                OpBranch %152
         %152 = OpLabel
         %156 = OpIAdd %uint %155 %uint_1
                OpBranch %153
         %154 = OpLabel
-        %164 = OpLoad %_arr_Inner_uint_4 %149 None
-        %165 = OpCompositeConstruct %Outer %164
-               OpReturnValue %165
+        %157 = OpLoad %_arr_Inner_uint_4 %149 None
+        %158 = OpCompositeConstruct %Outer %157
+               OpReturnValue %158
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %167
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -284,23 +284,23 @@
                OpLoopMerge %177 %175 None
                OpBranch %174
         %174 = OpLabel
-        %180 = OpUGreaterThanEqual %bool %178 %uint_4
-               OpSelectionMerge %181 None
-               OpBranchConditional %180 %182 %181
-        %182 = OpLabel
+        %181 = OpUGreaterThanEqual %bool %178 %uint_4
+               OpSelectionMerge %182 None
+               OpBranchConditional %181 %183 %182
+        %183 = OpLabel
                OpBranch %177
-        %181 = OpLabel
-        %183 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
-        %184 = OpLoad %Inner_std140 %183 None
-        %185 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
-               OpStore %185 %184 None
+        %182 = OpLabel
+        %184 = OpAccessChain %_ptr_Function_Inner_std140 %169 %178
+        %185 = OpLoad %Inner_std140 %184 None
+        %186 = OpAccessChain %_ptr_Function_Inner_std140 %171 %178
+               OpStore %186 %185 None
                OpBranch %175
         %175 = OpLabel
         %179 = OpIAdd %uint %178 %uint_1
                OpBranch %176
         %177 = OpLabel
-        %186 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
-               OpReturnValue %186
+        %180 = OpLoad %_arr_Inner_std140_uint_4_0 %171 None
+               OpReturnValue %180
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %188
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -324,22 +324,22 @@
                OpLoopMerge %204 %202 None
                OpBranch %201
         %201 = OpLabel
-        %207 = OpUGreaterThanEqual %bool %205 %uint_4
-               OpSelectionMerge %208 None
-               OpBranchConditional %207 %209 %208
-        %209 = OpLabel
+        %208 = OpUGreaterThanEqual %bool %205 %uint_4
+               OpSelectionMerge %209 None
+               OpBranchConditional %208 %210 %209
+        %210 = OpLabel
                OpBranch %204
-        %208 = OpLabel
-        %210 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
-        %212 = OpLoad %Outer_std140_tint_explicit_layout %210 None
-        %213 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %212
-        %214 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
-               OpStore %214 %213 None
+        %209 = OpLabel
+        %211 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %196 %205
+        %213 = OpLoad %Outer_std140_tint_explicit_layout %211 None
+        %214 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %213
+        %215 = OpAccessChain %_ptr_Function_Outer_std140 %198 %205
+               OpStore %215 %214 None
                OpBranch %202
         %202 = OpLabel
         %206 = OpIAdd %uint %205 %uint_1
                OpBranch %203
         %204 = OpLabel
-        %215 = OpLoad %_arr_Outer_std140_uint_4 %198 None
-               OpReturnValue %215
+        %207 = OpLoad %_arr_Outer_std140_uint_4 %198 None
+               OpReturnValue %207
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm
index e61ec43..db9c2f0 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.spvasm
@@ -88,12 +88,12 @@
 %_arr_Outer_uint_4 = OpTypeArray %Outer %uint_4
 %_ptr_Function__arr_Outer_uint_4 = OpTypePointer Function %_arr_Outer_uint_4
          %54 = OpConstantNull %_arr_Outer_uint_4
+%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
+%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
+         %75 = OpConstantNull %_arr_Inner_uint_4
        %bool = OpTypeBool
 %_ptr_Function_Outer = OpTypePointer Function %Outer
 %_ptr_Function_Outer_std140 = OpTypePointer Function %Outer_std140
-%_ptr_Function__arr_Inner_std140_uint_4_0 = OpTypePointer Function %_arr_Inner_std140_uint_4_0
-%_ptr_Function__arr_Inner_uint_4 = OpTypePointer Function %_arr_Inner_uint_4
-         %85 = OpConstantNull %_arr_Inner_uint_4
 %_ptr_Function_Inner = OpTypePointer Function %Inner
 %_ptr_Function_Inner_std140 = OpTypePointer Function %Inner_std140
         %108 = OpTypeFunction %Inner %Inner_std140
@@ -110,8 +110,8 @@
          %15 = OpLabel
          %46 = OpVariable %_ptr_Function__arr_Outer_std140_uint_4 Function
          %48 = OpVariable %_ptr_Function__arr_Outer_uint_4 Function %54
-         %81 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-         %83 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+         %71 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
+         %73 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
          %16 = OpAccessChain %_ptr_Uniform__arr_Outer_std140_tint_explicit_layout_uint_4 %1 %uint_0
          %19 = OpAccessChain %_ptr_Uniform_Outer_std140_tint_explicit_layout %16 %uint_3
          %22 = OpAccessChain %_ptr_Uniform__arr_Inner_std140_uint_4 %19 %uint_0
@@ -137,56 +137,56 @@
                OpLoopMerge %59 %57 None
                OpBranch %56
          %56 = OpLabel
-         %62 = OpUGreaterThanEqual %bool %60 %uint_4
-               OpSelectionMerge %64 None
-               OpBranchConditional %62 %65 %64
-         %65 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %60 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %59
-         %64 = OpLabel
-         %66 = OpAccessChain %_ptr_Function_Outer %48 %60
-         %68 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
-         %70 = OpLoad %Outer_std140 %68 None
-         %71 = OpFunctionCall %Outer %tint_convert_Outer %70
-               OpStore %66 %71 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_Outer %48 %60
+         %94 = OpAccessChain %_ptr_Function_Outer_std140 %46 %60
+         %96 = OpLoad %Outer_std140 %94 None
+         %97 = OpFunctionCall %Outer %tint_convert_Outer %96
+               OpStore %92 %97 None
                OpBranch %57
          %57 = OpLabel
          %61 = OpIAdd %uint %60 %uint_1
                OpBranch %58
          %59 = OpLabel
         %l_a = OpLoad %_arr_Outer_uint_4 %48 None
-         %74 = OpLoad %Outer_std140_tint_explicit_layout %19 None
-         %75 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %74
-      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %75
-         %78 = OpLoad %_arr_Inner_std140_uint_4 %22 None
-         %79 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %78
-               OpStore %81 %79
-               OpBranch %86
-         %86 = OpLabel
-               OpBranch %89
-         %89 = OpLabel
-         %91 = OpPhi %uint %uint_0 %86 %92 %88
-               OpLoopMerge %90 %88 None
-               OpBranch %87
-         %87 = OpLabel
-         %93 = OpUGreaterThanEqual %bool %91 %uint_4
-               OpSelectionMerge %94 None
-               OpBranchConditional %93 %95 %94
-         %95 = OpLabel
-               OpBranch %90
-         %94 = OpLabel
-         %96 = OpAccessChain %_ptr_Function_Inner %83 %91
-         %98 = OpAccessChain %_ptr_Function_Inner_std140 %81 %91
-        %100 = OpLoad %Inner_std140 %98 None
-        %101 = OpFunctionCall %Inner %tint_convert_Inner %100
-               OpStore %96 %101 None
-               OpBranch %88
-         %88 = OpLabel
-         %92 = OpIAdd %uint %91 %uint_1
-               OpBranch %89
-         %90 = OpLabel
-    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %83 None
-        %104 = OpLoad %Inner_std140 %24 None
-  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %104
+         %63 = OpLoad %Outer_std140_tint_explicit_layout %19 None
+         %64 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %63
+      %l_a_3 = OpFunctionCall %Outer %tint_convert_Outer %64
+         %68 = OpLoad %_arr_Inner_std140_uint_4 %22 None
+         %69 = OpFunctionCall %_arr_Inner_std140_uint_4_0 %tint_convert_explicit_layout %68
+               OpStore %71 %69
+               OpBranch %76
+         %76 = OpLabel
+               OpBranch %79
+         %79 = OpLabel
+         %81 = OpPhi %uint %uint_0 %76 %82 %78
+               OpLoopMerge %80 %78 None
+               OpBranch %77
+         %77 = OpLabel
+         %98 = OpUGreaterThanEqual %bool %81 %uint_4
+               OpSelectionMerge %99 None
+               OpBranchConditional %98 %100 %99
+        %100 = OpLabel
+               OpBranch %80
+         %99 = OpLabel
+        %101 = OpAccessChain %_ptr_Function_Inner %73 %81
+        %103 = OpAccessChain %_ptr_Function_Inner_std140 %71 %81
+        %105 = OpLoad %Inner_std140 %103 None
+        %106 = OpFunctionCall %Inner %tint_convert_Inner %105
+               OpStore %101 %106 None
+               OpBranch %78
+         %78 = OpLabel
+         %82 = OpIAdd %uint %81 %uint_1
+               OpBranch %79
+         %80 = OpLabel
+    %l_a_3_a = OpLoad %_arr_Inner_uint_4 %73 None
+         %84 = OpLoad %Inner_std140 %24 None
+  %l_a_3_a_2 = OpFunctionCall %Inner %tint_convert_Inner %84
 %l_a_3_a_2_m_1_0 = OpCompositeExtract %half %l_a_3_a_2_m_1 0
                OpReturn
                OpFunctionEnd
@@ -205,7 +205,7 @@
 %tint_input_0 = OpFunctionParameter %Outer_std140
         %118 = OpLabel
         %120 = OpVariable %_ptr_Function__arr_Inner_std140_uint_4_0 Function
-        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %85
+        %121 = OpVariable %_ptr_Function__arr_Inner_uint_4 Function %75
         %119 = OpCompositeExtract %_arr_Inner_std140_uint_4_0 %tint_input_0 0
                OpStore %120 %119
                OpBranch %122
@@ -216,25 +216,25 @@
                OpLoopMerge %126 %124 None
                OpBranch %123
         %123 = OpLabel
-        %129 = OpUGreaterThanEqual %bool %127 %uint_4
-               OpSelectionMerge %130 None
-               OpBranchConditional %129 %131 %130
-        %131 = OpLabel
+        %131 = OpUGreaterThanEqual %bool %127 %uint_4
+               OpSelectionMerge %132 None
+               OpBranchConditional %131 %133 %132
+        %133 = OpLabel
                OpBranch %126
-        %130 = OpLabel
-        %132 = OpAccessChain %_ptr_Function_Inner %121 %127
-        %133 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
-        %134 = OpLoad %Inner_std140 %133 None
-        %135 = OpFunctionCall %Inner %tint_convert_Inner %134
-               OpStore %132 %135 None
+        %132 = OpLabel
+        %134 = OpAccessChain %_ptr_Function_Inner %121 %127
+        %135 = OpAccessChain %_ptr_Function_Inner_std140 %120 %127
+        %136 = OpLoad %Inner_std140 %135 None
+        %137 = OpFunctionCall %Inner %tint_convert_Inner %136
+               OpStore %134 %137 None
                OpBranch %124
         %124 = OpLabel
         %128 = OpIAdd %uint %127 %uint_1
                OpBranch %125
         %126 = OpLabel
-        %136 = OpLoad %_arr_Inner_uint_4 %121 None
-        %137 = OpCompositeConstruct %Outer %136
-               OpReturnValue %137
+        %129 = OpLoad %_arr_Inner_uint_4 %121 None
+        %130 = OpCompositeConstruct %Outer %129
+               OpReturnValue %130
                OpFunctionEnd
 %tint_convert_explicit_layout = OpFunction %_arr_Inner_std140_uint_4_0 None %139
 %tint_source = OpFunctionParameter %_arr_Inner_std140_uint_4
@@ -250,23 +250,23 @@
                OpLoopMerge %149 %147 None
                OpBranch %146
         %146 = OpLabel
-        %152 = OpUGreaterThanEqual %bool %150 %uint_4
-               OpSelectionMerge %153 None
-               OpBranchConditional %152 %154 %153
-        %154 = OpLabel
+        %153 = OpUGreaterThanEqual %bool %150 %uint_4
+               OpSelectionMerge %154 None
+               OpBranchConditional %153 %155 %154
+        %155 = OpLabel
                OpBranch %149
-        %153 = OpLabel
-        %155 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
-        %156 = OpLoad %Inner_std140 %155 None
-        %157 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
-               OpStore %157 %156 None
+        %154 = OpLabel
+        %156 = OpAccessChain %_ptr_Function_Inner_std140 %141 %150
+        %157 = OpLoad %Inner_std140 %156 None
+        %158 = OpAccessChain %_ptr_Function_Inner_std140 %143 %150
+               OpStore %158 %157 None
                OpBranch %147
         %147 = OpLabel
         %151 = OpIAdd %uint %150 %uint_1
                OpBranch %148
         %149 = OpLabel
-        %158 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
-               OpReturnValue %158
+        %152 = OpLoad %_arr_Inner_std140_uint_4_0 %143 None
+               OpReturnValue %152
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer_std140 None %160
 %tint_source_0 = OpFunctionParameter %Outer_std140_tint_explicit_layout
@@ -290,22 +290,22 @@
                OpLoopMerge %176 %174 None
                OpBranch %173
         %173 = OpLabel
-        %179 = OpUGreaterThanEqual %bool %177 %uint_4
-               OpSelectionMerge %180 None
-               OpBranchConditional %179 %181 %180
-        %181 = OpLabel
+        %180 = OpUGreaterThanEqual %bool %177 %uint_4
+               OpSelectionMerge %181 None
+               OpBranchConditional %180 %182 %181
+        %182 = OpLabel
                OpBranch %176
-        %180 = OpLabel
-        %182 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
-        %184 = OpLoad %Outer_std140_tint_explicit_layout %182 None
-        %185 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %184
-        %186 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
-               OpStore %186 %185 None
+        %181 = OpLabel
+        %183 = OpAccessChain %_ptr_Function_Outer_std140_tint_explicit_layout %168 %177
+        %185 = OpLoad %Outer_std140_tint_explicit_layout %183 None
+        %186 = OpFunctionCall %Outer_std140 %tint_convert_explicit_layout_0 %185
+        %187 = OpAccessChain %_ptr_Function_Outer_std140 %170 %177
+               OpStore %187 %186 None
                OpBranch %174
         %174 = OpLabel
         %178 = OpIAdd %uint %177 %uint_1
                OpBranch %175
         %176 = OpLabel
-        %187 = OpLoad %_arr_Outer_std140_uint_4 %170 None
-               OpReturnValue %187
+        %179 = OpLoad %_arr_Outer_std140_uint_4 %170 None
+               OpReturnValue %179
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.spvasm
index aaccf9b..74ee438 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.spvasm
@@ -76,14 +76,14 @@
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %49 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
+     %uint_1 = OpConstant %uint 1
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %99 = OpTypeFunction %S %S_std140
         %110 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -129,47 +129,47 @@
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
-         %57 = OpUGreaterThanEqual %bool %55 %uint_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %60 %59
-         %60 = OpLabel
+         %88 = OpUGreaterThanEqual %bool %55 %uint_4
+               OpSelectionMerge %90 None
+               OpBranchConditional %88 %91 %90
+         %91 = OpLabel
                OpBranch %54
-         %59 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_S %47 %55
-         %63 = OpAccessChain %_ptr_Function_S_std140 %45 %55
-         %65 = OpLoad %S_std140 %63 None
-         %66 = OpFunctionCall %S %tint_convert_S %65
-               OpStore %61 %66 None
+         %90 = OpLabel
+         %92 = OpAccessChain %_ptr_Function_S %47 %55
+         %94 = OpAccessChain %_ptr_Function_S_std140 %45 %55
+         %96 = OpLoad %S_std140 %94 None
+         %97 = OpFunctionCall %S %tint_convert_S %96
+               OpStore %92 %97 None
                OpBranch %52
          %52 = OpLabel
          %56 = OpIAdd %uint %55 %uint_1
                OpBranch %53
          %54 = OpLabel
-         %69 = OpLoad %_arr_S_uint_4 %47 None
-         %70 = OpFunctionCall %void %a %69
-         %71 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %71 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-         %76 = OpFunctionCall %void %b %75
-         %77 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %79 = OpLoad %v4half %77 None
-         %80 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %81 = OpLoad %v4half %80 None
-         %82 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %84 = OpLoad %v4half %82 None
-         %85 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
-         %86 = OpLoad %v4half %85 None
-         %87 = OpCompositeConstruct %mat4v4half %79 %81 %84 %86
-         %88 = OpFunctionCall %void %c %87
-         %89 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %90 = OpLoad %v4half %89 None
-         %91 = OpVectorShuffle %v4half %90 %90 1 3 0 2
-         %92 = OpFunctionCall %void %d %91
-         %93 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %94 = OpLoad %v4half %93 None
-         %95 = OpVectorShuffle %v4half %94 %94 1 3 0 2
-         %96 = OpCompositeExtract %half %95 0
-         %97 = OpFunctionCall %void %e %96
+         %57 = OpLoad %_arr_S_uint_4 %47 None
+         %58 = OpFunctionCall %void %a %57
+         %59 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %62 = OpLoad %S_std140 %59 None
+         %63 = OpFunctionCall %S %tint_convert_S %62
+         %65 = OpFunctionCall %void %b %63
+         %66 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %69 = OpLoad %v4half %66 None
+         %70 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %71 = OpLoad %v4half %70 None
+         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %74 = OpLoad %v4half %72 None
+         %75 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
+         %76 = OpLoad %v4half %75 None
+         %77 = OpCompositeConstruct %mat4v4half %69 %71 %74 %76
+         %78 = OpFunctionCall %void %c %77
+         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %80 = OpLoad %v4half %79 None
+         %81 = OpVectorShuffle %v4half %80 %80 1 3 0 2
+         %82 = OpFunctionCall %void %d %81
+         %83 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %84 = OpLoad %v4half %83 None
+         %85 = OpVectorShuffle %v4half %84 %84 1 3 0 2
+         %86 = OpCompositeExtract %half %85 0
+         %87 = OpFunctionCall %void %e %86
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %99
@@ -199,21 +199,21 @@
                OpLoopMerge %120 %118 None
                OpBranch %117
         %117 = OpLabel
-        %123 = OpUGreaterThanEqual %bool %121 %uint_4
-               OpSelectionMerge %124 None
-               OpBranchConditional %123 %125 %124
-        %125 = OpLabel
+        %124 = OpUGreaterThanEqual %bool %121 %uint_4
+               OpSelectionMerge %125 None
+               OpBranchConditional %124 %126 %125
+        %126 = OpLabel
                OpBranch %120
-        %124 = OpLabel
-        %126 = OpAccessChain %_ptr_Function_S_std140 %112 %121
-        %127 = OpLoad %S_std140 %126 None
-        %128 = OpAccessChain %_ptr_Function_S_std140 %114 %121
-               OpStore %128 %127 None
+        %125 = OpLabel
+        %127 = OpAccessChain %_ptr_Function_S_std140 %112 %121
+        %128 = OpLoad %S_std140 %127 None
+        %129 = OpAccessChain %_ptr_Function_S_std140 %114 %121
+               OpStore %129 %128 None
                OpBranch %118
         %118 = OpLabel
         %122 = OpIAdd %uint %121 %uint_1
                OpBranch %119
         %120 = OpLabel
-        %129 = OpLoad %_arr_S_std140_uint_4_0 %114 None
-               OpReturnValue %129
+        %123 = OpLoad %_arr_S_std140_uint_4_0 %114 None
+               OpReturnValue %123
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.spvasm
index 509bbd2..dd32522 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.spvasm
@@ -64,17 +64,17 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Private_S = OpTypePointer Private %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
 %_ptr_Private_mat4v4half = OpTypePointer Private %mat4v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_Private_v4half = OpTypePointer Private %v4half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %78 = OpTypeFunction %S %S_std140
          %89 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
 %_ptr_Function__arr_S_std140_uint_4 = OpTypePointer Function %_arr_S_std140_uint_4
@@ -95,45 +95,45 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_S %30 %37
-         %45 = OpAccessChain %_ptr_Function_S_std140 %28 %37
-         %47 = OpLoad %S_std140 %45 None
-         %48 = OpFunctionCall %S %tint_convert_S %47
-               OpStore %43 %48 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_S %30 %37
+         %73 = OpAccessChain %_ptr_Function_S_std140 %28 %37
+         %75 = OpLoad %S_std140 %73 None
+         %76 = OpFunctionCall %S %tint_convert_S %75
+               OpStore %71 %76 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %51 = OpLoad %_arr_S_uint_4 %30 None
-               OpStore %p %51 None
-         %52 = OpAccessChain %_ptr_Private_S %p %uint_1
-         %54 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %57 = OpLoad %S_std140 %54 None
-         %58 = OpFunctionCall %S %tint_convert_S %57
-               OpStore %52 %58 None
-         %59 = OpAccessChain %_ptr_Private_mat4v4half %p %uint_3 %uint_1
-         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %64 = OpLoad %v4half %62 None
-         %65 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %66 = OpLoad %v4half %65 None
-         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %68 = OpLoad %v4half %67 None
-         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
-         %70 = OpLoad %v4half %69 None
-         %71 = OpCompositeConstruct %mat4v4half %64 %66 %68 %70
-               OpStore %59 %71 None
-         %72 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %75 = OpLoad %v4half %74 None
-         %76 = OpVectorShuffle %v4half %75 %75 1 3 0 2
-               OpStore %72 %76 None
+         %39 = OpLoad %_arr_S_uint_4 %30 None
+               OpStore %p %39 None
+         %40 = OpAccessChain %_ptr_Private_S %p %uint_1
+         %43 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %46 = OpLoad %S_std140 %43 None
+         %47 = OpFunctionCall %S %tint_convert_S %46
+               OpStore %40 %47 None
+         %49 = OpAccessChain %_ptr_Private_mat4v4half %p %uint_3 %uint_1
+         %52 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %54 = OpLoad %v4half %52 None
+         %55 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %56 = OpLoad %v4half %55 None
+         %57 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %58 = OpLoad %v4half %57 None
+         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
+         %60 = OpLoad %v4half %59 None
+         %61 = OpCompositeConstruct %mat4v4half %54 %56 %58 %60
+               OpStore %49 %61 None
+         %62 = OpAccessChain %_ptr_Private_v4half %p %uint_1 %uint_1 %uint_0
+         %64 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %65 = OpLoad %v4half %64 None
+         %66 = OpVectorShuffle %v4half %65 %65 1 3 0 2
+               OpStore %62 %66 None
                OpReturn
                OpFunctionEnd
 %tint_convert_S = OpFunction %S None %78
@@ -163,21 +163,21 @@
                OpLoopMerge %99 %97 None
                OpBranch %96
          %96 = OpLabel
-        %102 = OpUGreaterThanEqual %bool %100 %uint_4
-               OpSelectionMerge %103 None
-               OpBranchConditional %102 %104 %103
-        %104 = OpLabel
+        %103 = OpUGreaterThanEqual %bool %100 %uint_4
+               OpSelectionMerge %104 None
+               OpBranchConditional %103 %105 %104
+        %105 = OpLabel
                OpBranch %99
-        %103 = OpLabel
-        %105 = OpAccessChain %_ptr_Function_S_std140 %91 %100
-        %106 = OpLoad %S_std140 %105 None
-        %107 = OpAccessChain %_ptr_Function_S_std140 %93 %100
-               OpStore %107 %106 None
+        %104 = OpLabel
+        %106 = OpAccessChain %_ptr_Function_S_std140 %91 %100
+        %107 = OpLoad %S_std140 %106 None
+        %108 = OpAccessChain %_ptr_Function_S_std140 %93 %100
+               OpStore %108 %107 None
                OpBranch %97
          %97 = OpLabel
         %101 = OpIAdd %uint %100 %uint_1
                OpBranch %98
          %99 = OpLabel
-        %108 = OpLoad %_arr_S_std140_uint_4_0 %93 None
-               OpReturnValue %108
+        %102 = OpLoad %_arr_S_std140_uint_4_0 %93 None
+               OpReturnValue %102
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.spvasm
index 2878686..523348c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.spvasm
@@ -88,17 +88,17 @@
 %_arr_S_uint_4 = OpTypeArray %S %uint_4
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
          %34 = OpConstantNull %_arr_S_uint_4
-       %bool = OpTypeBool
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
-     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
      %uint_2 = OpConstant %uint 2
+     %uint_1 = OpConstant %uint 1
 %_arr_uint_uint_1 = OpTypeArray %uint %uint_1
 %_ptr_StorageBuffer_mat4v4half = OpTypePointer StorageBuffer %mat4v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+       %bool = OpTypeBool
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %85 = OpTypeFunction %void %_arr_S_uint_4
         %104 = OpTypeFunction %void %_arr_uint_uint_1 %S
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
@@ -122,45 +122,45 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_4
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %74 = OpUGreaterThanEqual %bool %40 %uint_4
+               OpSelectionMerge %76 None
+               OpBranchConditional %74 %77 %76
+         %77 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Function_S %30 %40
-         %48 = OpAccessChain %_ptr_Function_S_std140 %28 %40
-         %50 = OpLoad %S_std140 %48 None
-         %51 = OpFunctionCall %S %tint_convert_S %50
-               OpStore %46 %51 None
+         %76 = OpLabel
+         %78 = OpAccessChain %_ptr_Function_S %30 %40
+         %80 = OpAccessChain %_ptr_Function_S_std140 %28 %40
+         %82 = OpLoad %S_std140 %80 None
+         %83 = OpFunctionCall %S %tint_convert_S %82
+               OpStore %78 %83 None
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
-         %54 = OpLoad %_arr_S_uint_4 %30 None
-         %55 = OpFunctionCall %void %tint_store_and_preserve_padding %54
-         %57 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %60 = OpLoad %S_std140 %57 None
-         %61 = OpFunctionCall %S %tint_convert_S %60
-         %63 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %64 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %63 %61
-         %66 = OpAccessChain %_ptr_StorageBuffer_mat4v4half %11 %uint_0 %uint_3 %uint_1
-         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %71 = OpLoad %v4half %69 None
-         %72 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %73 = OpLoad %v4half %72 None
-         %74 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %75 = OpLoad %v4half %74 None
-         %76 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
-         %77 = OpLoad %v4half %76 None
-         %78 = OpCompositeConstruct %mat4v4half %71 %73 %75 %77
-               OpStore %66 %78 None
-         %79 = OpAccessChain %_ptr_StorageBuffer_v4half %11 %uint_0 %uint_1 %uint_1 %uint_0
-         %81 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %82 = OpLoad %v4half %81 None
-         %83 = OpVectorShuffle %v4half %82 %82 1 3 0 2
-               OpStore %79 %83 None
+         %42 = OpLoad %_arr_S_uint_4 %30 None
+         %43 = OpFunctionCall %void %tint_store_and_preserve_padding %42
+         %45 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %48 = OpLoad %S_std140 %45 None
+         %49 = OpFunctionCall %S %tint_convert_S %48
+         %53 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_0 %53 %49
+         %56 = OpAccessChain %_ptr_StorageBuffer_mat4v4half %11 %uint_0 %uint_3 %uint_1
+         %59 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %61 = OpLoad %v4half %59 None
+         %62 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %63 = OpLoad %v4half %62 None
+         %64 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %65 = OpLoad %v4half %64 None
+         %66 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
+         %67 = OpLoad %v4half %66 None
+         %68 = OpCompositeConstruct %mat4v4half %61 %63 %65 %67
+               OpStore %56 %68 None
+         %69 = OpAccessChain %_ptr_StorageBuffer_v4half %11 %uint_0 %uint_1 %uint_1 %uint_0
+         %71 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %72 = OpLoad %v4half %71 None
+         %73 = OpVectorShuffle %v4half %72 %72 1 3 0 2
+               OpStore %69 %73 None
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %85
@@ -236,21 +236,21 @@
                OpLoopMerge %136 %134 None
                OpBranch %133
         %133 = OpLabel
-        %139 = OpUGreaterThanEqual %bool %137 %uint_4
-               OpSelectionMerge %140 None
-               OpBranchConditional %139 %141 %140
-        %141 = OpLabel
+        %140 = OpUGreaterThanEqual %bool %137 %uint_4
+               OpSelectionMerge %141 None
+               OpBranchConditional %140 %142 %141
+        %142 = OpLabel
                OpBranch %136
-        %140 = OpLabel
-        %142 = OpAccessChain %_ptr_Function_S_std140 %128 %137
-        %143 = OpLoad %S_std140 %142 None
-        %144 = OpAccessChain %_ptr_Function_S_std140 %130 %137
-               OpStore %144 %143 None
+        %141 = OpLabel
+        %143 = OpAccessChain %_ptr_Function_S_std140 %128 %137
+        %144 = OpLoad %S_std140 %143 None
+        %145 = OpAccessChain %_ptr_Function_S_std140 %130 %137
+               OpStore %145 %144 None
                OpBranch %134
         %134 = OpLabel
         %138 = OpIAdd %uint %137 %uint_1
                OpBranch %135
         %136 = OpLabel
-        %145 = OpLoad %_arr_S_std140_uint_4_0 %130 None
-               OpReturnValue %145
+        %139 = OpLoad %_arr_S_std140_uint_4_0 %130 None
+               OpReturnValue %139
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
index dcf0458..8f4367b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -64,10 +64,6 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_std140_uint_4 = OpTypePointer Uniform %_arr_S_std140_uint_4
@@ -75,14 +71,18 @@
 %_arr_S_std140_uint_4_0 = OpTypeArray %S_std140 %uint_4
 %_ptr_Function__arr_S_std140_uint_4_0 = OpTypePointer Function %_arr_S_std140_uint_4_0
 %_ptr_Function__arr_S_uint_4 = OpTypePointer Function %_arr_S_uint_4
-         %52 = OpConstantNull %_arr_S_uint_4
-%_ptr_Function_S = OpTypePointer Function %S
-%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
+         %44 = OpConstantNull %_arr_S_uint_4
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_std140 = OpTypePointer Uniform %S_std140
 %_ptr_Workgroup_mat4v4half = OpTypePointer Workgroup %mat4v4half
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
+       %bool = OpTypeBool
+         %84 = OpConstantNull %S
+%_ptr_Function_S = OpTypePointer Function %S
+%_ptr_Function_S_std140 = OpTypePointer Function %S_std140
          %95 = OpTypeFunction %void
         %100 = OpTypeFunction %S %S_std140
         %111 = OpTypeFunction %_arr_S_std140_uint_4_0 %_arr_S_std140_uint_4
@@ -91,8 +91,8 @@
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
          %22 = OpLabel
-         %48 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
-         %50 = OpVariable %_ptr_Function__arr_S_uint_4 Function %52
+         %40 = OpVariable %_ptr_Function__arr_S_std140_uint_4_0 Function
+         %42 = OpVariable %_ptr_Function__arr_S_uint_4 Function %44
                OpBranch %23
          %23 = OpLabel
                OpBranch %26
@@ -101,71 +101,71 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %79 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %81 None
+               OpBranchConditional %79 %82 %81
+         %82 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %81 = OpLabel
+         %83 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %83 %84 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_std140_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %44
-               OpStore %48 %45
-               OpBranch %53
-         %53 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-         %58 = OpPhi %uint %uint_0 %53 %59 %55
-               OpLoopMerge %57 %55 None
-               OpBranch %54
-         %54 = OpLabel
-         %60 = OpUGreaterThanEqual %bool %58 %uint_4
-               OpSelectionMerge %61 None
-               OpBranchConditional %60 %62 %61
-         %62 = OpLabel
-               OpBranch %57
-         %61 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_S %50 %58
-         %65 = OpAccessChain %_ptr_Function_S_std140 %48 %58
-         %67 = OpLoad %S_std140 %65 None
-         %68 = OpFunctionCall %S %tint_convert_S %67
-               OpStore %63 %68 None
-               OpBranch %55
-         %55 = OpLabel
-         %59 = OpIAdd %uint %58 %uint_1
-               OpBranch %56
-         %57 = OpLabel
-         %70 = OpLoad %_arr_S_uint_4 %50 None
-               OpStore %w %70 None
-         %71 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %72 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
-         %74 = OpLoad %S_std140 %72 None
-         %75 = OpFunctionCall %S %tint_convert_S %74
-               OpStore %71 %75 None
-         %76 = OpAccessChain %_ptr_Workgroup_mat4v4half %w %uint_3 %uint_1
-         %79 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
-         %81 = OpLoad %v4half %79 None
-         %82 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
-         %83 = OpLoad %v4half %82 None
-         %84 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
-         %85 = OpLoad %v4half %84 None
-         %86 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
-         %87 = OpLoad %v4half %86 None
-         %88 = OpCompositeConstruct %mat4v4half %81 %83 %85 %87
-               OpStore %76 %88 None
-         %89 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_1 %uint_0
-         %91 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
-         %92 = OpLoad %v4half %91 None
-         %93 = OpVectorShuffle %v4half %92 %92 1 3 0 2
-               OpStore %89 %93 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_std140_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_std140_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_std140_uint_4_0 %tint_convert_explicit_layout %36
+               OpStore %40 %37
+               OpBranch %45
+         %45 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %50 = OpPhi %uint %uint_0 %45 %51 %47
+               OpLoopMerge %49 %47 None
+               OpBranch %46
+         %46 = OpLabel
+         %85 = OpUGreaterThanEqual %bool %50 %uint_4
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %86
+         %87 = OpLabel
+               OpBranch %49
+         %86 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_S %42 %50
+         %90 = OpAccessChain %_ptr_Function_S_std140 %40 %50
+         %92 = OpLoad %S_std140 %90 None
+         %93 = OpFunctionCall %S %tint_convert_S %92
+               OpStore %88 %93 None
+               OpBranch %47
+         %47 = OpLabel
+         %51 = OpIAdd %uint %50 %uint_1
+               OpBranch %48
+         %49 = OpLabel
+         %52 = OpLoad %_arr_S_uint_4 %42 None
+               OpStore %w %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %56 = OpAccessChain %_ptr_Uniform_S_std140 %1 %uint_0 %uint_2
+         %58 = OpLoad %S_std140 %56 None
+         %59 = OpFunctionCall %S %tint_convert_S %58
+               OpStore %53 %59 None
+         %61 = OpAccessChain %_ptr_Workgroup_mat4v4half %w %uint_3 %uint_1
+         %64 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_1
+         %66 = OpLoad %v4half %64 None
+         %67 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_2
+         %68 = OpLoad %v4half %67 None
+         %69 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_3
+         %70 = OpLoad %v4half %69 None
+         %71 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_2 %uint_4
+         %72 = OpLoad %v4half %71 None
+         %73 = OpCompositeConstruct %mat4v4half %66 %68 %70 %72
+               OpStore %61 %73 None
+         %74 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1 %uint_1 %uint_0
+         %76 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0 %uint_0 %uint_2
+         %77 = OpLoad %v4half %76 None
+         %78 = OpVectorShuffle %v4half %77 %77 1 3 0 2
+               OpStore %74 %78 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %95
@@ -201,21 +201,21 @@
                OpLoopMerge %121 %119 None
                OpBranch %118
         %118 = OpLabel
-        %124 = OpUGreaterThanEqual %bool %122 %uint_4
-               OpSelectionMerge %125 None
-               OpBranchConditional %124 %126 %125
-        %126 = OpLabel
+        %125 = OpUGreaterThanEqual %bool %122 %uint_4
+               OpSelectionMerge %126 None
+               OpBranchConditional %125 %127 %126
+        %127 = OpLabel
                OpBranch %121
-        %125 = OpLabel
-        %127 = OpAccessChain %_ptr_Function_S_std140 %113 %122
-        %128 = OpLoad %S_std140 %127 None
-        %129 = OpAccessChain %_ptr_Function_S_std140 %115 %122
-               OpStore %129 %128 None
+        %126 = OpLabel
+        %128 = OpAccessChain %_ptr_Function_S_std140 %113 %122
+        %129 = OpLoad %S_std140 %128 None
+        %130 = OpAccessChain %_ptr_Function_S_std140 %115 %122
+               OpStore %130 %129 None
                OpBranch %119
         %119 = OpLabel
         %123 = OpIAdd %uint %122 %uint_1
                OpBranch %120
         %121 = OpLabel
-        %130 = OpLoad %_arr_S_std140_uint_4_0 %115 None
-               OpReturnValue %130
+        %124 = OpLoad %_arr_S_std140_uint_4_0 %115 None
+               OpReturnValue %124
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
index cbb3848..a2759c5 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.spvasm
@@ -150,23 +150,23 @@
                OpLoopMerge %85 %83 None
                OpBranch %82
          %82 = OpLabel
-         %88 = OpUGreaterThanEqual %bool %86 %uint_4
-               OpSelectionMerge %90 None
-               OpBranchConditional %88 %91 %90
-         %91 = OpLabel
+         %89 = OpUGreaterThanEqual %bool %86 %uint_4
+               OpSelectionMerge %91 None
+               OpBranchConditional %89 %92 %91
+         %92 = OpLabel
                OpBranch %85
-         %90 = OpLabel
-         %92 = OpAccessChain %_ptr_Function_Inner %76 %86
-         %94 = OpLoad %Inner %92 None
-         %95 = OpAccessChain %_ptr_Function_Inner %78 %86
-               OpStore %95 %94 None
+         %91 = OpLabel
+         %93 = OpAccessChain %_ptr_Function_Inner %76 %86
+         %95 = OpLoad %Inner %93 None
+         %96 = OpAccessChain %_ptr_Function_Inner %78 %86
+               OpStore %96 %95 None
                OpBranch %83
          %83 = OpLabel
          %87 = OpIAdd %uint %86 %uint_1
                OpBranch %84
          %85 = OpLabel
-         %97 = OpLoad %_arr_Inner_uint_4_0 %78 None
-               OpReturnValue %97
+         %88 = OpLoad %_arr_Inner_uint_4_0 %78 None
+               OpReturnValue %88
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer None %99
 %tint_source_0 = OpFunctionParameter %Outer_tint_explicit_layout
@@ -190,22 +190,22 @@
                OpLoopMerge %116 %114 None
                OpBranch %113
         %113 = OpLabel
-        %119 = OpUGreaterThanEqual %bool %117 %uint_4
-               OpSelectionMerge %120 None
-               OpBranchConditional %119 %121 %120
-        %121 = OpLabel
+        %120 = OpUGreaterThanEqual %bool %117 %uint_4
+               OpSelectionMerge %121 None
+               OpBranchConditional %120 %122 %121
+        %122 = OpLabel
                OpBranch %116
-        %120 = OpLabel
-        %122 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %107 %117
-        %124 = OpLoad %Outer_tint_explicit_layout %122 None
-        %125 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %124
-        %126 = OpAccessChain %_ptr_Function_Outer %109 %117
-               OpStore %126 %125 None
+        %121 = OpLabel
+        %123 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %107 %117
+        %125 = OpLoad %Outer_tint_explicit_layout %123 None
+        %126 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %125
+        %127 = OpAccessChain %_ptr_Function_Outer %109 %117
+               OpStore %127 %126 None
                OpBranch %114
         %114 = OpLabel
         %118 = OpIAdd %uint %117 %uint_1
                OpBranch %115
         %116 = OpLabel
-        %128 = OpLoad %_arr_Outer_uint_4 %109 None
-               OpReturnValue %128
+        %119 = OpLoad %_arr_Outer_uint_4 %109 None
+               OpReturnValue %119
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm
index 4e37035..6f4c424 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.spvasm
@@ -122,23 +122,23 @@
                OpLoopMerge %63 %61 None
                OpBranch %60
          %60 = OpLabel
-         %66 = OpUGreaterThanEqual %bool %64 %uint_4
-               OpSelectionMerge %68 None
-               OpBranchConditional %66 %69 %68
-         %69 = OpLabel
+         %67 = OpUGreaterThanEqual %bool %64 %uint_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %67 %70 %69
+         %70 = OpLabel
                OpBranch %63
-         %68 = OpLabel
-         %70 = OpAccessChain %_ptr_Function_Inner %54 %64
-         %72 = OpLoad %Inner %70 None
-         %73 = OpAccessChain %_ptr_Function_Inner %56 %64
-               OpStore %73 %72 None
+         %69 = OpLabel
+         %71 = OpAccessChain %_ptr_Function_Inner %54 %64
+         %73 = OpLoad %Inner %71 None
+         %74 = OpAccessChain %_ptr_Function_Inner %56 %64
+               OpStore %74 %73 None
                OpBranch %61
          %61 = OpLabel
          %65 = OpIAdd %uint %64 %uint_1
                OpBranch %62
          %63 = OpLabel
-         %74 = OpLoad %_arr_Inner_uint_4_0 %56 None
-               OpReturnValue %74
+         %66 = OpLoad %_arr_Inner_uint_4_0 %56 None
+               OpReturnValue %66
                OpFunctionEnd
 %tint_convert_explicit_layout_0 = OpFunction %Outer None %76
 %tint_source_0 = OpFunctionParameter %Outer_tint_explicit_layout
@@ -162,22 +162,22 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %84 %94
-        %101 = OpLoad %Outer_tint_explicit_layout %99 None
-        %102 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %101
-        %103 = OpAccessChain %_ptr_Function_Outer %86 %94
-               OpStore %103 %102 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_Outer_tint_explicit_layout %84 %94
+        %102 = OpLoad %Outer_tint_explicit_layout %100 None
+        %103 = OpFunctionCall %Outer %tint_convert_explicit_layout_0 %102
+        %104 = OpAccessChain %_ptr_Function_Outer %86 %94
+               OpStore %104 %103 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %105 = OpLoad %_arr_Outer_uint_4 %86 None
-               OpReturnValue %105
+         %96 = OpLoad %_arr_Outer_uint_4 %86 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.spvasm
index 5250528..23373a1 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.spvasm
@@ -131,21 +131,21 @@
                OpLoopMerge %76 %74 None
                OpBranch %73
          %73 = OpLabel
-         %79 = OpUGreaterThanEqual %bool %77 %uint_4
-               OpSelectionMerge %81 None
-               OpBranchConditional %79 %82 %81
-         %82 = OpLabel
+         %80 = OpUGreaterThanEqual %bool %77 %uint_4
+               OpSelectionMerge %82 None
+               OpBranchConditional %80 %83 %82
+         %83 = OpLabel
                OpBranch %76
-         %81 = OpLabel
-         %83 = OpAccessChain %_ptr_Function_S %67 %77
-         %85 = OpLoad %S %83 None
-         %86 = OpAccessChain %_ptr_Function_S %69 %77
-               OpStore %86 %85 None
+         %82 = OpLabel
+         %84 = OpAccessChain %_ptr_Function_S %67 %77
+         %86 = OpLoad %S %84 None
+         %87 = OpAccessChain %_ptr_Function_S %69 %77
+               OpStore %87 %86 None
                OpBranch %74
          %74 = OpLabel
          %78 = OpIAdd %uint %77 %uint_1
                OpBranch %75
          %76 = OpLabel
-         %87 = OpLoad %_arr_S_uint_4_0 %69 None
-               OpReturnValue %87
+         %79 = OpLoad %_arr_S_uint_4_0 %69 None
+               OpReturnValue %79
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.spvasm
index 20a3946..dd14d1c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.spvasm
@@ -115,22 +115,22 @@
                OpLoopMerge %66 %64 None
                OpBranch %63
          %63 = OpLabel
-         %69 = OpUGreaterThanEqual %bool %67 %uint_4
-               OpSelectionMerge %71 None
-               OpBranchConditional %69 %72 %71
-         %72 = OpLabel
+         %70 = OpUGreaterThanEqual %bool %67 %uint_4
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %73 %72
+         %73 = OpLabel
                OpBranch %66
-         %71 = OpLabel
-         %73 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %58 %67
-         %75 = OpLoad %S_tint_explicit_layout %73 None
-         %76 = OpFunctionCall %S %tint_convert_explicit_layout %75
-         %77 = OpAccessChain %_ptr_Function_S %60 %67
-               OpStore %77 %76 None
+         %72 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %58 %67
+         %76 = OpLoad %S_tint_explicit_layout %74 None
+         %77 = OpFunctionCall %S %tint_convert_explicit_layout %76
+         %78 = OpAccessChain %_ptr_Function_S %60 %67
+               OpStore %78 %77 None
                OpBranch %64
          %64 = OpLabel
          %68 = OpIAdd %uint %67 %uint_1
                OpBranch %65
          %66 = OpLabel
-         %79 = OpLoad %_arr_S_uint_4 %60 None
-               OpReturnValue %79
+         %69 = OpLoad %_arr_S_uint_4 %60 None
+               OpReturnValue %69
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.spvasm
index c3fc9ce..dbb7e49 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.spvasm
@@ -157,21 +157,21 @@
                OpLoopMerge %93 %91 None
                OpBranch %90
          %90 = OpLabel
-         %96 = OpUGreaterThanEqual %bool %94 %uint_4
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %97
-         %98 = OpLabel
+         %97 = OpUGreaterThanEqual %bool %94 %uint_4
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %98
+         %99 = OpLabel
                OpBranch %93
-         %97 = OpLabel
-         %99 = OpAccessChain %_ptr_Function_S %85 %94
-        %100 = OpLoad %S %99 None
-        %101 = OpAccessChain %_ptr_Function_S %87 %94
-               OpStore %101 %100 None
+         %98 = OpLabel
+        %100 = OpAccessChain %_ptr_Function_S %85 %94
+        %101 = OpLoad %S %100 None
+        %102 = OpAccessChain %_ptr_Function_S %87 %94
+               OpStore %102 %101 None
                OpBranch %91
          %91 = OpLabel
          %95 = OpIAdd %uint %94 %uint_1
                OpBranch %92
          %93 = OpLabel
-        %102 = OpLoad %_arr_S_uint_4_0 %87 None
-               OpReturnValue %102
+         %96 = OpLoad %_arr_S_uint_4_0 %87 None
+               OpReturnValue %96
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
index 0e5f18e..dfa9f96 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -57,20 +57,20 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_S = OpTypePointer Workgroup %S
-         %36 = OpConstantNull %S
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 = OpTypePointer Uniform %_arr_S_tint_explicit_layout_uint_4
      %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_S = OpTypePointer Workgroup %S
+     %uint_1 = OpConstant %uint 1
 %_ptr_Uniform_S_tint_explicit_layout = OpTypePointer Uniform %S_tint_explicit_layout
 %_ptr_Workgroup_mat4v4float = OpTypePointer Workgroup %mat4v4float
      %uint_3 = OpConstant %uint 3
 %_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
 %_ptr_Workgroup_v4float = OpTypePointer Workgroup %v4float
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+       %bool = OpTypeBool
+         %64 = OpConstantNull %S
          %66 = OpTypeFunction %void
          %71 = OpTypeFunction %S %S_tint_explicit_layout
          %78 = OpTypeFunction %_arr_S_uint_4 %_arr_S_tint_explicit_layout_uint_4
@@ -90,38 +90,38 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_4
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %59 = OpUGreaterThanEqual %bool %28 %uint_4
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %61
+         %62 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_S %w %28
-               OpStore %34 %36 None
+         %61 = OpLabel
+         %63 = OpAccessChain %_ptr_Workgroup_S %w %28
+               OpStore %63 %64 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpAccessChain %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 %1 %uint_0
-         %44 = OpLoad %_arr_S_tint_explicit_layout_uint_4 %41 None
-         %45 = OpFunctionCall %_arr_S_uint_4 %tint_convert_explicit_layout_0 %44
-               OpStore %w %45 None
-         %47 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_S_tint_explicit_layout %1 %uint_0 %uint_2
-         %50 = OpLoad %S_tint_explicit_layout %48 None
-         %51 = OpFunctionCall %S %tint_convert_explicit_layout %50
-               OpStore %47 %51 None
-         %53 = OpAccessChain %_ptr_Workgroup_mat4v4float %w %uint_3 %uint_1
-         %56 = OpAccessChain %_ptr_Uniform_mat4v4float %1 %uint_0 %uint_2 %uint_1
-         %58 = OpLoad %mat4v4float %56 None
+         %33 = OpAccessChain %_ptr_Uniform__arr_S_tint_explicit_layout_uint_4 %1 %uint_0
+         %36 = OpLoad %_arr_S_tint_explicit_layout_uint_4 %33 None
+         %37 = OpFunctionCall %_arr_S_uint_4 %tint_convert_explicit_layout_0 %36
+               OpStore %w %37 None
+         %39 = OpAccessChain %_ptr_Workgroup_S %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_S_tint_explicit_layout %1 %uint_0 %uint_2
+         %44 = OpLoad %S_tint_explicit_layout %42 None
+         %45 = OpFunctionCall %S %tint_convert_explicit_layout %44
+               OpStore %39 %45 None
+         %47 = OpAccessChain %_ptr_Workgroup_mat4v4float %w %uint_3 %uint_1
+         %50 = OpAccessChain %_ptr_Uniform_mat4v4float %1 %uint_0 %uint_2 %uint_1
+         %52 = OpLoad %mat4v4float %50 None
+               OpStore %47 %52 None
+         %53 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_1 %uint_0
+         %55 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1 %uint_1
+         %57 = OpLoad %v4float %55 None
+         %58 = OpVectorShuffle %v4float %57 %57 1 3 0 2
                OpStore %53 %58 None
-         %59 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1 %uint_1 %uint_0
-         %61 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0 %uint_1 %uint_1
-         %63 = OpLoad %v4float %61 None
-         %64 = OpVectorShuffle %v4float %63 %63 1 3 0 2
-               OpStore %59 %64 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %66
@@ -153,22 +153,22 @@
                OpLoopMerge %89 %87 None
                OpBranch %86
          %86 = OpLabel
-         %92 = OpUGreaterThanEqual %bool %90 %uint_4
-               OpSelectionMerge %93 None
-               OpBranchConditional %92 %94 %93
-         %94 = OpLabel
+         %93 = OpUGreaterThanEqual %bool %90 %uint_4
+               OpSelectionMerge %94 None
+               OpBranchConditional %93 %95 %94
+         %95 = OpLabel
                OpBranch %89
-         %93 = OpLabel
-         %95 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %80 %90
-         %97 = OpLoad %S_tint_explicit_layout %95 None
-         %98 = OpFunctionCall %S %tint_convert_explicit_layout %97
-         %99 = OpAccessChain %_ptr_Function_S %82 %90
-               OpStore %99 %98 None
+         %94 = OpLabel
+         %96 = OpAccessChain %_ptr_Function_S_tint_explicit_layout %80 %90
+         %98 = OpLoad %S_tint_explicit_layout %96 None
+         %99 = OpFunctionCall %S %tint_convert_explicit_layout %98
+        %100 = OpAccessChain %_ptr_Function_S %82 %90
+               OpStore %100 %99 None
                OpBranch %87
          %87 = OpLabel
          %91 = OpIAdd %uint %90 %uint_1
                OpBranch %88
          %89 = OpLabel
-        %101 = OpLoad %_arr_S_uint_4 %82 None
-               OpReturnValue %101
+         %92 = OpLoad %_arr_S_uint_4 %82 None
+               OpReturnValue %92
                OpFunctionEnd
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.spvasm
index ccd227c..a68aa7f 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.spvasm
@@ -40,7 +40,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat2v2half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
@@ -48,6 +47,7 @@
 %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %47 = OpConstantNull %mat2v2half
          %49 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -56,31 +56,31 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %47 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %29 = OpLoad %v2half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
-         %31 = OpLoad %v2half %30 None
-         %32 = OpCompositeConstruct %mat2v2half %29 %31
-               OpStore %w %32 None
-         %33 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
-         %35 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %36 = OpLoad %v2half %35 None
-               OpStore %33 %36 None
-         %37 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
-         %38 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %39 = OpLoad %v2half %38 None
-         %40 = OpVectorShuffle %v2half %39 %39 1 0
-               OpStore %37 %40 None
-         %41 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_0
-         %42 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_half %42 %uint_0
-         %45 = OpLoad %half %43 None
-         %46 = OpAccessChain %_ptr_Workgroup_half %41 %uint_1
-               OpStore %46 %45 None
+         %25 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %28 = OpLoad %v2half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
+         %30 = OpLoad %v2half %29 None
+         %31 = OpCompositeConstruct %mat2v2half %28 %30
+               OpStore %w %31 None
+         %32 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
+         %34 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %35 = OpLoad %v2half %34 None
+               OpStore %32 %35 None
+         %36 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
+         %37 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %38 = OpLoad %v2half %37 None
+         %39 = OpVectorShuffle %v2half %38 %38 1 0
+               OpStore %36 %39 None
+         %40 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_0
+         %41 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_half %41 %uint_0
+         %44 = OpLoad %half %42 None
+         %45 = OpAccessChain %_ptr_Workgroup_half %40 %uint_1
+               OpStore %45 %44 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %49
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
index b9e8dee..22947f7 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -37,7 +37,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat2v2float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
@@ -45,6 +44,7 @@
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %47 = OpConstantNull %mat2v2float
          %49 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -53,31 +53,31 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %47 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %29 = OpLoad %v2float %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
-         %31 = OpLoad %v2float %30 None
-         %32 = OpCompositeConstruct %mat2v2float %29 %31
-               OpStore %w %32 None
-         %33 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
-         %35 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %36 = OpLoad %v2float %35 None
-               OpStore %33 %36 None
-         %37 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
-         %38 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %39 = OpLoad %v2float %38 None
-         %40 = OpVectorShuffle %v2float %39 %39 1 0
-               OpStore %37 %40 None
-         %41 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_0
-         %42 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_float %42 %uint_0
-         %45 = OpLoad %float %43 None
-         %46 = OpAccessChain %_ptr_Workgroup_float %41 %uint_1
-               OpStore %46 %45 None
+         %25 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %28 = OpLoad %v2float %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
+         %30 = OpLoad %v2float %29 None
+         %31 = OpCompositeConstruct %mat2v2float %28 %30
+               OpStore %w %31 None
+         %32 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
+         %34 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %35 = OpLoad %v2float %34 None
+               OpStore %32 %35 None
+         %36 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
+         %37 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %38 = OpLoad %v2float %37 None
+         %39 = OpVectorShuffle %v2float %38 %38 1 0
+               OpStore %36 %39 None
+         %40 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_0
+         %41 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_float %41 %uint_0
+         %44 = OpLoad %float %42 None
+         %45 = OpAccessChain %_ptr_Workgroup_float %40 %uint_1
+               OpStore %45 %44 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %49
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
index b10f166..00fb879 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -40,7 +40,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat2v3half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
@@ -48,6 +47,7 @@
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %47 = OpConstantNull %mat2v3half
          %49 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -56,31 +56,31 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %47 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %29 = OpLoad %v3half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
-         %31 = OpLoad %v3half %30 None
-         %32 = OpCompositeConstruct %mat2v3half %29 %31
-               OpStore %w %32 None
-         %33 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
-         %35 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %36 = OpLoad %v3half %35 None
-               OpStore %33 %36 None
-         %37 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
-         %38 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %39 = OpLoad %v3half %38 None
-         %40 = OpVectorShuffle %v3half %39 %39 2 0 1
-               OpStore %37 %40 None
-         %41 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_0
-         %42 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_half %42 %uint_0
-         %45 = OpLoad %half %43 None
-         %46 = OpAccessChain %_ptr_Workgroup_half %41 %uint_1
-               OpStore %46 %45 None
+         %25 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %28 = OpLoad %v3half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
+         %30 = OpLoad %v3half %29 None
+         %31 = OpCompositeConstruct %mat2v3half %28 %30
+               OpStore %w %31 None
+         %32 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
+         %34 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %35 = OpLoad %v3half %34 None
+               OpStore %32 %35 None
+         %36 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
+         %37 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %38 = OpLoad %v3half %37 None
+         %39 = OpVectorShuffle %v3half %38 %38 2 0 1
+               OpStore %36 %39 None
+         %40 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_0
+         %41 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_half %41 %uint_0
+         %44 = OpLoad %half %42 None
+         %45 = OpAccessChain %_ptr_Workgroup_half %40 %uint_1
+               OpStore %45 %44 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %49
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
index 8231ff3..4d59076 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -37,7 +37,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat2v3float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
@@ -45,6 +44,7 @@
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %47 = OpConstantNull %mat2v3float
          %49 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -53,31 +53,31 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %47 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %29 = OpLoad %v3float %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
-         %31 = OpLoad %v3float %30 None
-         %32 = OpCompositeConstruct %mat2v3float %29 %31
-               OpStore %w %32 None
-         %33 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
-         %35 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %36 = OpLoad %v3float %35 None
-               OpStore %33 %36 None
-         %37 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
-         %38 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %39 = OpLoad %v3float %38 None
-         %40 = OpVectorShuffle %v3float %39 %39 2 0 1
-               OpStore %37 %40 None
-         %41 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_0
-         %42 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_float %42 %uint_0
-         %45 = OpLoad %float %43 None
-         %46 = OpAccessChain %_ptr_Workgroup_float %41 %uint_1
-               OpStore %46 %45 None
+         %25 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %28 = OpLoad %v3float %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
+         %30 = OpLoad %v3float %29 None
+         %31 = OpCompositeConstruct %mat2v3float %28 %30
+               OpStore %w %31 None
+         %32 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
+         %34 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %35 = OpLoad %v3float %34 None
+               OpStore %32 %35 None
+         %36 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
+         %37 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %38 = OpLoad %v3float %37 None
+         %39 = OpVectorShuffle %v3float %38 %38 2 0 1
+               OpStore %36 %39 None
+         %40 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_0
+         %41 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_float %41 %uint_0
+         %44 = OpLoad %float %42 None
+         %45 = OpAccessChain %_ptr_Workgroup_float %40 %uint_1
+               OpStore %45 %44 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %49
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
index d5f0731..9f5c63e 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -40,7 +40,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat2v4half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
@@ -48,6 +47,7 @@
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %47 = OpConstantNull %mat2v4half
          %49 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -56,31 +56,31 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %47 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %29 = OpLoad %v4half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
-         %31 = OpLoad %v4half %30 None
-         %32 = OpCompositeConstruct %mat2v4half %29 %31
-               OpStore %w %32 None
-         %33 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
-         %35 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %36 = OpLoad %v4half %35 None
-               OpStore %33 %36 None
-         %37 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
-         %38 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %39 = OpLoad %v4half %38 None
-         %40 = OpVectorShuffle %v4half %39 %39 1 3 0 2
-               OpStore %37 %40 None
-         %41 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_0
-         %42 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_half %42 %uint_0
-         %45 = OpLoad %half %43 None
-         %46 = OpAccessChain %_ptr_Workgroup_half %41 %uint_1
-               OpStore %46 %45 None
+         %25 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %28 = OpLoad %v4half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
+         %30 = OpLoad %v4half %29 None
+         %31 = OpCompositeConstruct %mat2v4half %28 %30
+               OpStore %w %31 None
+         %32 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
+         %34 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %35 = OpLoad %v4half %34 None
+               OpStore %32 %35 None
+         %36 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
+         %37 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %38 = OpLoad %v4half %37 None
+         %39 = OpVectorShuffle %v4half %38 %38 1 3 0 2
+               OpStore %36 %39 None
+         %40 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_0
+         %41 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_half %41 %uint_0
+         %44 = OpLoad %half %42 None
+         %45 = OpAccessChain %_ptr_Workgroup_half %40 %uint_1
+               OpStore %45 %44 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %49
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
index 4bca0db..2f604c9 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -37,7 +37,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat2v4float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_mat2v4float = OpTypePointer Uniform %mat2v4float
@@ -46,6 +45,7 @@
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %45 = OpConstantNull %mat2v4float
          %47 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -54,28 +54,28 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %45 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_mat2v4float %1 %uint_0
-         %29 = OpLoad %mat2v4float %26 None
-               OpStore %w %29 None
-         %30 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
-         %32 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
-         %34 = OpLoad %v4float %32 None
-               OpStore %30 %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
-         %36 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
-         %37 = OpLoad %v4float %36 None
-         %38 = OpVectorShuffle %v4float %37 %37 1 3 0 2
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_0
-         %40 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_1
-         %41 = OpAccessChain %_ptr_Uniform_float %40 %uint_0
-         %43 = OpLoad %float %41 None
-         %44 = OpAccessChain %_ptr_Workgroup_float %39 %uint_1
-               OpStore %44 %43 None
+         %25 = OpAccessChain %_ptr_Uniform_mat2v4float %1 %uint_0
+         %28 = OpLoad %mat2v4float %25 None
+               OpStore %w %28 None
+         %29 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
+         %31 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
+         %33 = OpLoad %v4float %31 None
+               OpStore %29 %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
+         %35 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
+         %36 = OpLoad %v4float %35 None
+         %37 = OpVectorShuffle %v4float %36 %36 1 3 0 2
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_0
+         %39 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_1
+         %40 = OpAccessChain %_ptr_Uniform_float %39 %uint_0
+         %42 = OpLoad %float %40 None
+         %43 = OpAccessChain %_ptr_Workgroup_float %38 %uint_1
+               OpStore %43 %42 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %47
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.spvasm
index 2fe8f7c..3bd1ad3 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.spvasm
@@ -42,7 +42,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat3v2half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
@@ -50,6 +49,7 @@
 %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %49 = OpConstantNull %mat3v2half
          %51 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -58,33 +58,33 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %49 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %29 = OpLoad %v2half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
-         %31 = OpLoad %v2half %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_2
-         %33 = OpLoad %v2half %32 None
-         %34 = OpCompositeConstruct %mat3v2half %29 %31 %33
-               OpStore %w %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
-         %37 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %38 = OpLoad %v2half %37 None
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %41 = OpLoad %v2half %40 None
-         %42 = OpVectorShuffle %v2half %41 %41 1 0
-               OpStore %39 %42 None
-         %43 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_0
-         %44 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_half %44 %uint_0
-         %47 = OpLoad %half %45 None
-         %48 = OpAccessChain %_ptr_Workgroup_half %43 %uint_1
-               OpStore %48 %47 None
+         %25 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %28 = OpLoad %v2half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
+         %30 = OpLoad %v2half %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_2
+         %32 = OpLoad %v2half %31 None
+         %33 = OpCompositeConstruct %mat3v2half %28 %30 %32
+               OpStore %w %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
+         %36 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %37 = OpLoad %v2half %36 None
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %40 = OpLoad %v2half %39 None
+         %41 = OpVectorShuffle %v2half %40 %40 1 0
+               OpStore %38 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_0
+         %43 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_half %43 %uint_0
+         %46 = OpLoad %half %44 None
+         %47 = OpAccessChain %_ptr_Workgroup_half %42 %uint_1
+               OpStore %47 %46 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %51
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.spvasm
index e76d7a9..0c55fa5 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -39,7 +39,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat3v2float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
@@ -47,6 +46,7 @@
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %49 = OpConstantNull %mat3v2float
          %51 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -55,33 +55,33 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %49 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %29 = OpLoad %v2float %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
-         %31 = OpLoad %v2float %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_2
-         %33 = OpLoad %v2float %32 None
-         %34 = OpCompositeConstruct %mat3v2float %29 %31 %33
-               OpStore %w %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
-         %37 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %38 = OpLoad %v2float %37 None
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %41 = OpLoad %v2float %40 None
-         %42 = OpVectorShuffle %v2float %41 %41 1 0
-               OpStore %39 %42 None
-         %43 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_0
-         %44 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_float %44 %uint_0
-         %47 = OpLoad %float %45 None
-         %48 = OpAccessChain %_ptr_Workgroup_float %43 %uint_1
-               OpStore %48 %47 None
+         %25 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %28 = OpLoad %v2float %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
+         %30 = OpLoad %v2float %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_2
+         %32 = OpLoad %v2float %31 None
+         %33 = OpCompositeConstruct %mat3v2float %28 %30 %32
+               OpStore %w %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
+         %36 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %37 = OpLoad %v2float %36 None
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %40 = OpLoad %v2float %39 None
+         %41 = OpVectorShuffle %v2float %40 %40 1 0
+               OpStore %38 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_0
+         %43 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_float %43 %uint_0
+         %46 = OpLoad %float %44 None
+         %47 = OpAccessChain %_ptr_Workgroup_float %42 %uint_1
+               OpStore %47 %46 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %51
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.spvasm
index d9beea5..d46af07 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -42,7 +42,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat3v3half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
@@ -50,6 +49,7 @@
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %49 = OpConstantNull %mat3v3half
          %51 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -58,33 +58,33 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %49 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %29 = OpLoad %v3half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
-         %31 = OpLoad %v3half %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_2
-         %33 = OpLoad %v3half %32 None
-         %34 = OpCompositeConstruct %mat3v3half %29 %31 %33
-               OpStore %w %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
-         %37 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %38 = OpLoad %v3half %37 None
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %41 = OpLoad %v3half %40 None
-         %42 = OpVectorShuffle %v3half %41 %41 2 0 1
-               OpStore %39 %42 None
-         %43 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_0
-         %44 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_half %44 %uint_0
-         %47 = OpLoad %half %45 None
-         %48 = OpAccessChain %_ptr_Workgroup_half %43 %uint_1
-               OpStore %48 %47 None
+         %25 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %28 = OpLoad %v3half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
+         %30 = OpLoad %v3half %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_2
+         %32 = OpLoad %v3half %31 None
+         %33 = OpCompositeConstruct %mat3v3half %28 %30 %32
+               OpStore %w %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
+         %36 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %37 = OpLoad %v3half %36 None
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %40 = OpLoad %v3half %39 None
+         %41 = OpVectorShuffle %v3half %40 %40 2 0 1
+               OpStore %38 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_0
+         %43 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_half %43 %uint_0
+         %46 = OpLoad %half %44 None
+         %47 = OpAccessChain %_ptr_Workgroup_half %42 %uint_1
+               OpStore %47 %46 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %51
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
index 280f9a2..f017cfd 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -39,7 +39,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat3v3float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
@@ -47,6 +46,7 @@
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %49 = OpConstantNull %mat3v3float
          %51 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -55,33 +55,33 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %49 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %29 = OpLoad %v3float %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
-         %31 = OpLoad %v3float %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_2
-         %33 = OpLoad %v3float %32 None
-         %34 = OpCompositeConstruct %mat3v3float %29 %31 %33
-               OpStore %w %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
-         %37 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %38 = OpLoad %v3float %37 None
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %41 = OpLoad %v3float %40 None
-         %42 = OpVectorShuffle %v3float %41 %41 2 0 1
-               OpStore %39 %42 None
-         %43 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_0
-         %44 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_float %44 %uint_0
-         %47 = OpLoad %float %45 None
-         %48 = OpAccessChain %_ptr_Workgroup_float %43 %uint_1
-               OpStore %48 %47 None
+         %25 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %28 = OpLoad %v3float %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
+         %30 = OpLoad %v3float %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_2
+         %32 = OpLoad %v3float %31 None
+         %33 = OpCompositeConstruct %mat3v3float %28 %30 %32
+               OpStore %w %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
+         %36 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %37 = OpLoad %v3float %36 None
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %40 = OpLoad %v3float %39 None
+         %41 = OpVectorShuffle %v3float %40 %40 2 0 1
+               OpStore %38 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_0
+         %43 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_float %43 %uint_0
+         %46 = OpLoad %float %44 None
+         %47 = OpAccessChain %_ptr_Workgroup_float %42 %uint_1
+               OpStore %47 %46 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %51
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.spvasm
index 7d509aa..99e2b42 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -42,7 +42,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat3v4half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
@@ -50,6 +49,7 @@
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %49 = OpConstantNull %mat3v4half
          %51 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -58,33 +58,33 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %49 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %29 = OpLoad %v4half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
-         %31 = OpLoad %v4half %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_2
-         %33 = OpLoad %v4half %32 None
-         %34 = OpCompositeConstruct %mat3v4half %29 %31 %33
-               OpStore %w %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
-         %37 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %38 = OpLoad %v4half %37 None
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %41 = OpLoad %v4half %40 None
-         %42 = OpVectorShuffle %v4half %41 %41 1 3 0 2
-               OpStore %39 %42 None
-         %43 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_0
-         %44 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
-         %45 = OpAccessChain %_ptr_Uniform_half %44 %uint_0
-         %47 = OpLoad %half %45 None
-         %48 = OpAccessChain %_ptr_Workgroup_half %43 %uint_1
-               OpStore %48 %47 None
+         %25 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %28 = OpLoad %v4half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
+         %30 = OpLoad %v4half %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_2
+         %32 = OpLoad %v4half %31 None
+         %33 = OpCompositeConstruct %mat3v4half %28 %30 %32
+               OpStore %w %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
+         %36 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %37 = OpLoad %v4half %36 None
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %40 = OpLoad %v4half %39 None
+         %41 = OpVectorShuffle %v4half %40 %40 1 3 0 2
+               OpStore %38 %41 None
+         %42 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_0
+         %43 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
+         %44 = OpAccessChain %_ptr_Uniform_half %43 %uint_0
+         %46 = OpLoad %half %44 None
+         %47 = OpAccessChain %_ptr_Workgroup_half %42 %uint_1
+               OpStore %47 %46 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %51
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
index 7e425e1..b61ff82 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -37,7 +37,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat3v4float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_mat3v4float = OpTypePointer Uniform %mat3v4float
@@ -46,6 +45,7 @@
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %45 = OpConstantNull %mat3v4float
          %47 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -54,28 +54,28 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %45 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_mat3v4float %1 %uint_0
-         %29 = OpLoad %mat3v4float %26 None
-               OpStore %w %29 None
-         %30 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
-         %32 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
-         %34 = OpLoad %v4float %32 None
-               OpStore %30 %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
-         %36 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
-         %37 = OpLoad %v4float %36 None
-         %38 = OpVectorShuffle %v4float %37 %37 1 3 0 2
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_0
-         %40 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_1
-         %41 = OpAccessChain %_ptr_Uniform_float %40 %uint_0
-         %43 = OpLoad %float %41 None
-         %44 = OpAccessChain %_ptr_Workgroup_float %39 %uint_1
-               OpStore %44 %43 None
+         %25 = OpAccessChain %_ptr_Uniform_mat3v4float %1 %uint_0
+         %28 = OpLoad %mat3v4float %25 None
+               OpStore %w %28 None
+         %29 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
+         %31 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
+         %33 = OpLoad %v4float %31 None
+               OpStore %29 %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
+         %35 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
+         %36 = OpLoad %v4float %35 None
+         %37 = OpVectorShuffle %v4float %36 %36 1 3 0 2
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_0
+         %39 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_1
+         %40 = OpAccessChain %_ptr_Uniform_float %39 %uint_0
+         %42 = OpLoad %float %40 None
+         %43 = OpAccessChain %_ptr_Workgroup_float %38 %uint_1
+               OpStore %43 %42 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %47
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
index ab6ac78..d839648 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.spvasm
@@ -44,7 +44,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat4v2half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v2half = OpTypePointer Uniform %v2half
@@ -53,6 +52,7 @@
 %_ptr_Workgroup_v2half = OpTypePointer Workgroup %v2half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %52 = OpConstantNull %mat4v2half
          %54 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -61,35 +61,35 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %52 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %29 = OpLoad %v2half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
-         %31 = OpLoad %v2half %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_2
-         %33 = OpLoad %v2half %32 None
-         %34 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_3
-         %36 = OpLoad %v2half %34 None
-         %37 = OpCompositeConstruct %mat4v2half %29 %31 %33 %36
-               OpStore %w %37 None
-         %38 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %41 = OpLoad %v2half %40 None
-               OpStore %38 %41 None
-         %42 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
-         %44 = OpLoad %v2half %43 None
-         %45 = OpVectorShuffle %v2half %44 %44 1 0
-               OpStore %42 %45 None
-         %46 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_0
-         %47 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_half %47 %uint_0
-         %50 = OpLoad %half %48 None
-         %51 = OpAccessChain %_ptr_Workgroup_half %46 %uint_1
-               OpStore %51 %50 None
+         %25 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %28 = OpLoad %v2half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
+         %30 = OpLoad %v2half %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_2
+         %32 = OpLoad %v2half %31 None
+         %33 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_3
+         %35 = OpLoad %v2half %33 None
+         %36 = OpCompositeConstruct %mat4v2half %28 %30 %32 %35
+               OpStore %w %36 None
+         %37 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %40 = OpLoad %v2half %39 None
+               OpStore %37 %40 None
+         %41 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_0
+         %43 = OpLoad %v2half %42 None
+         %44 = OpVectorShuffle %v2half %43 %43 1 0
+               OpStore %41 %44 None
+         %45 = OpAccessChain %_ptr_Workgroup_v2half %w %uint_0
+         %46 = OpAccessChain %_ptr_Uniform_v2half %1 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_half %46 %uint_0
+         %49 = OpLoad %half %47 None
+         %50 = OpAccessChain %_ptr_Workgroup_half %45 %uint_1
+               OpStore %50 %49 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %54
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
index 42bc05e..7109933 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.spvasm
@@ -41,7 +41,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat4v2float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
@@ -50,6 +49,7 @@
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %52 = OpConstantNull %mat4v2float
          %54 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -58,35 +58,35 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %52 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %29 = OpLoad %v2float %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
-         %31 = OpLoad %v2float %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_2
-         %33 = OpLoad %v2float %32 None
-         %34 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_3
-         %36 = OpLoad %v2float %34 None
-         %37 = OpCompositeConstruct %mat4v2float %29 %31 %33 %36
-               OpStore %w %37 None
-         %38 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %41 = OpLoad %v2float %40 None
-               OpStore %38 %41 None
-         %42 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
-         %44 = OpLoad %v2float %43 None
-         %45 = OpVectorShuffle %v2float %44 %44 1 0
-               OpStore %42 %45 None
-         %46 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_0
-         %47 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_float %47 %uint_0
-         %50 = OpLoad %float %48 None
-         %51 = OpAccessChain %_ptr_Workgroup_float %46 %uint_1
-               OpStore %51 %50 None
+         %25 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %28 = OpLoad %v2float %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
+         %30 = OpLoad %v2float %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_2
+         %32 = OpLoad %v2float %31 None
+         %33 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_3
+         %35 = OpLoad %v2float %33 None
+         %36 = OpCompositeConstruct %mat4v2float %28 %30 %32 %35
+               OpStore %w %36 None
+         %37 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %40 = OpLoad %v2float %39 None
+               OpStore %37 %40 None
+         %41 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0
+         %43 = OpLoad %v2float %42 None
+         %44 = OpVectorShuffle %v2float %43 %43 1 0
+               OpStore %41 %44 None
+         %45 = OpAccessChain %_ptr_Workgroup_v2float %w %uint_0
+         %46 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_float %46 %uint_0
+         %49 = OpLoad %float %47 None
+         %50 = OpAccessChain %_ptr_Workgroup_float %45 %uint_1
+               OpStore %50 %49 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %54
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
index a89bf7e..24eac03 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.spvasm
@@ -44,7 +44,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat4v3half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
@@ -53,6 +52,7 @@
 %_ptr_Workgroup_v3half = OpTypePointer Workgroup %v3half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %52 = OpConstantNull %mat4v3half
          %54 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -61,35 +61,35 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %52 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %29 = OpLoad %v3half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
-         %31 = OpLoad %v3half %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_2
-         %33 = OpLoad %v3half %32 None
-         %34 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_3
-         %36 = OpLoad %v3half %34 None
-         %37 = OpCompositeConstruct %mat4v3half %29 %31 %33 %36
-               OpStore %w %37 None
-         %38 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %41 = OpLoad %v3half %40 None
-               OpStore %38 %41 None
-         %42 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
-         %44 = OpLoad %v3half %43 None
-         %45 = OpVectorShuffle %v3half %44 %44 2 0 1
-               OpStore %42 %45 None
-         %46 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_0
-         %47 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_half %47 %uint_0
-         %50 = OpLoad %half %48 None
-         %51 = OpAccessChain %_ptr_Workgroup_half %46 %uint_1
-               OpStore %51 %50 None
+         %25 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %28 = OpLoad %v3half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
+         %30 = OpLoad %v3half %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_2
+         %32 = OpLoad %v3half %31 None
+         %33 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_3
+         %35 = OpLoad %v3half %33 None
+         %36 = OpCompositeConstruct %mat4v3half %28 %30 %32 %35
+               OpStore %w %36 None
+         %37 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %40 = OpLoad %v3half %39 None
+               OpStore %37 %40 None
+         %41 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_0
+         %43 = OpLoad %v3half %42 None
+         %44 = OpVectorShuffle %v3half %43 %43 2 0 1
+               OpStore %41 %44 None
+         %45 = OpAccessChain %_ptr_Workgroup_v3half %w %uint_0
+         %46 = OpAccessChain %_ptr_Uniform_v3half %1 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_half %46 %uint_0
+         %49 = OpLoad %half %47 None
+         %50 = OpAccessChain %_ptr_Workgroup_half %45 %uint_1
+               OpStore %50 %49 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %54
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
index 432dcae..66d8394 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.spvasm
@@ -41,7 +41,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat4v3float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
@@ -50,6 +49,7 @@
 %_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %52 = OpConstantNull %mat4v3float
          %54 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -58,35 +58,35 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %52 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %29 = OpLoad %v3float %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
-         %31 = OpLoad %v3float %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_2
-         %33 = OpLoad %v3float %32 None
-         %34 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_3
-         %36 = OpLoad %v3float %34 None
-         %37 = OpCompositeConstruct %mat4v3float %29 %31 %33 %36
-               OpStore %w %37 None
-         %38 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %41 = OpLoad %v3float %40 None
-               OpStore %38 %41 None
-         %42 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
-         %44 = OpLoad %v3float %43 None
-         %45 = OpVectorShuffle %v3float %44 %44 2 0 1
-               OpStore %42 %45 None
-         %46 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_0
-         %47 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_float %47 %uint_0
-         %50 = OpLoad %float %48 None
-         %51 = OpAccessChain %_ptr_Workgroup_float %46 %uint_1
-               OpStore %51 %50 None
+         %25 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %28 = OpLoad %v3float %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
+         %30 = OpLoad %v3float %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_2
+         %32 = OpLoad %v3float %31 None
+         %33 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_3
+         %35 = OpLoad %v3float %33 None
+         %36 = OpCompositeConstruct %mat4v3float %28 %30 %32 %35
+               OpStore %w %36 None
+         %37 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %40 = OpLoad %v3float %39 None
+               OpStore %37 %40 None
+         %41 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0
+         %43 = OpLoad %v3float %42 None
+         %44 = OpVectorShuffle %v3float %43 %43 2 0 1
+               OpStore %41 %44 None
+         %45 = OpAccessChain %_ptr_Workgroup_v3float %w %uint_0
+         %46 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_float %46 %uint_0
+         %49 = OpLoad %float %47 None
+         %50 = OpAccessChain %_ptr_Workgroup_float %45 %uint_1
+               OpStore %50 %49 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %54
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
index 4d308d7..1e9ea80 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.spvasm
@@ -44,7 +44,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat4v4half
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_v4half = OpTypePointer Uniform %v4half
@@ -53,6 +52,7 @@
 %_ptr_Workgroup_v4half = OpTypePointer Workgroup %v4half
 %_ptr_Uniform_half = OpTypePointer Uniform %half
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
+         %52 = OpConstantNull %mat4v4half
          %54 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -61,35 +61,35 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %52 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %29 = OpLoad %v4half %26 None
-         %30 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
-         %31 = OpLoad %v4half %30 None
-         %32 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_2
-         %33 = OpLoad %v4half %32 None
-         %34 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_3
-         %36 = OpLoad %v4half %34 None
-         %37 = OpCompositeConstruct %mat4v4half %29 %31 %33 %36
-               OpStore %w %37 None
-         %38 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
-         %40 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %41 = OpLoad %v4half %40 None
-               OpStore %38 %41 None
-         %42 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
-         %43 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
-         %44 = OpLoad %v4half %43 None
-         %45 = OpVectorShuffle %v4half %44 %44 1 3 0 2
-               OpStore %42 %45 None
-         %46 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_0
-         %47 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
-         %48 = OpAccessChain %_ptr_Uniform_half %47 %uint_0
-         %50 = OpLoad %half %48 None
-         %51 = OpAccessChain %_ptr_Workgroup_half %46 %uint_1
-               OpStore %51 %50 None
+         %25 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %28 = OpLoad %v4half %25 None
+         %29 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
+         %30 = OpLoad %v4half %29 None
+         %31 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_2
+         %32 = OpLoad %v4half %31 None
+         %33 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_3
+         %35 = OpLoad %v4half %33 None
+         %36 = OpCompositeConstruct %mat4v4half %28 %30 %32 %35
+               OpStore %w %36 None
+         %37 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
+         %39 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %40 = OpLoad %v4half %39 None
+               OpStore %37 %40 None
+         %41 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_1
+         %42 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_0
+         %43 = OpLoad %v4half %42 None
+         %44 = OpVectorShuffle %v4half %43 %43 1 3 0 2
+               OpStore %41 %44 None
+         %45 = OpAccessChain %_ptr_Workgroup_v4half %w %uint_0
+         %46 = OpAccessChain %_ptr_Uniform_v4half %1 %uint_1
+         %47 = OpAccessChain %_ptr_Uniform_half %46 %uint_0
+         %49 = OpLoad %half %47 None
+         %50 = OpAccessChain %_ptr_Workgroup_half %45 %uint_1
+               OpStore %50 %49 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %54
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.spvasm b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
index 8120a23..71d3107 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.spvasm
@@ -37,7 +37,6 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %mat4v4float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
@@ -46,6 +45,7 @@
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
 %_ptr_Uniform_float = OpTypePointer Uniform %float
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
+         %45 = OpConstantNull %mat4v4float
          %47 = OpTypeFunction %void
     %f_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -54,28 +54,28 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %w %22 None
+               OpStore %w %45 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %26 = OpAccessChain %_ptr_Uniform_mat4v4float %1 %uint_0
-         %29 = OpLoad %mat4v4float %26 None
-               OpStore %w %29 None
-         %30 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
-         %32 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
-         %34 = OpLoad %v4float %32 None
-               OpStore %30 %34 None
-         %35 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
-         %36 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
-         %37 = OpLoad %v4float %36 None
-         %38 = OpVectorShuffle %v4float %37 %37 1 3 0 2
-               OpStore %35 %38 None
-         %39 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_0
-         %40 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_1
-         %41 = OpAccessChain %_ptr_Uniform_float %40 %uint_0
-         %43 = OpLoad %float %41 None
-         %44 = OpAccessChain %_ptr_Workgroup_float %39 %uint_1
-               OpStore %44 %43 None
+         %25 = OpAccessChain %_ptr_Uniform_mat4v4float %1 %uint_0
+         %28 = OpLoad %mat4v4float %25 None
+               OpStore %w %28 None
+         %29 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
+         %31 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
+         %33 = OpLoad %v4float %31 None
+               OpStore %29 %33 None
+         %34 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_1
+         %35 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_0
+         %36 = OpLoad %v4float %35 None
+         %37 = OpVectorShuffle %v4float %36 %36 1 3 0 2
+               OpStore %34 %37 None
+         %38 = OpAccessChain %_ptr_Workgroup_v4float %w %uint_0
+         %39 = OpAccessChain %_ptr_Uniform_v4float %1 %uint_0 %uint_1
+         %40 = OpAccessChain %_ptr_Uniform_float %39 %uint_0
+         %42 = OpLoad %float %40 None
+         %43 = OpAccessChain %_ptr_Workgroup_float %38 %uint_1
+               OpStore %43 %42 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %47
diff --git a/test/tint/bug/chromium/1449538.wgsl.expected.spvasm b/test/tint/bug/chromium/1449538.wgsl.expected.spvasm
index a63f231..cb0ae3a 100644
--- a/test/tint/bug/chromium/1449538.wgsl.expected.spvasm
+++ b/test/tint/bug/chromium/1449538.wgsl.expected.spvasm
@@ -47,11 +47,11 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %14 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %49 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
         %int = OpTypeInt 32 1
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
-         %22 = OpConstantNull %v2uint
+         %57 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %false = OpConstantFalse %bool
@@ -78,294 +78,294 @@
       %i60_0 = OpVariable %_ptr_Function_int Function
                OpBranch %5
           %5 = OpLabel
-               OpStore %tint_loop_idx %14
+               OpStore %tint_loop_idx %49
                OpStore %i0520 %int_0
                OpBranch %8
           %8 = OpLabel
                OpLoopMerge %9 %7 None
                OpBranch %6
           %6 = OpLabel
-         %20 = OpLoad %v2uint %tint_loop_idx None
-         %21 = OpIEqual %v2bool %20 %22
-         %25 = OpAll %bool %21
-               OpSelectionMerge %26 None
-               OpBranchConditional %25 %27 %26
-         %27 = OpLabel
+         %55 = OpLoad %v2uint %tint_loop_idx None
+         %56 = OpIEqual %v2bool %55 %57
+         %60 = OpAll %bool %56
+               OpSelectionMerge %61 None
+               OpBranchConditional %60 %62 %61
+         %62 = OpLabel
                OpBranch %9
-         %26 = OpLabel
-               OpSelectionMerge %28 None
-               OpBranchConditional %false %28 %29
-         %29 = OpLabel
+         %61 = OpLabel
+               OpSelectionMerge %63 None
+               OpBranchConditional %false %63 %64
+         %64 = OpLabel
                OpBranch %9
-         %28 = OpLabel
+         %63 = OpLabel
                OpBranch %7
           %7 = OpLabel
-         %31 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %34 = OpLoad %uint %31 None
-%tint_low_inc = OpISub %uint %34 %uint_1
-         %37 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %37 %tint_low_inc None
-         %38 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %38 %uint_1 %uint_0
-         %40 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %41 = OpLoad %uint %40 None
-         %42 = OpISub %uint %41 %tint_carry
-         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %43 %42 None
+         %66 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %69 = OpLoad %uint %66 None
+%tint_low_inc = OpISub %uint %69 %uint_1
+         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %72 %tint_low_inc None
+         %73 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %73 %uint_1 %uint_0
+         %75 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %76 = OpLoad %uint %75 None
+         %77 = OpISub %uint %76 %tint_carry
+         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %78 %77 None
                OpBranch %8
           %9 = OpLabel
-               OpBranch %44
-         %44 = OpLabel
-               OpStore %tint_loop_idx_0 %14
+               OpBranch %10
+         %10 = OpLabel
+               OpStore %tint_loop_idx_0 %49
                OpStore %i62 %int_0
-               OpBranch %47
-         %47 = OpLabel
-               OpLoopMerge %48 %46 None
-               OpBranch %45
-         %45 = OpLabel
-         %51 = OpLoad %v2uint %tint_loop_idx_0 None
-         %52 = OpIEqual %v2bool %51 %22
-         %53 = OpAll %bool %52
-               OpSelectionMerge %54 None
-               OpBranchConditional %53 %55 %54
-         %55 = OpLabel
-               OpBranch %48
-         %54 = OpLabel
-               OpSelectionMerge %56 None
-               OpBranchConditional %false %56 %57
-         %57 = OpLabel
-               OpBranch %48
-         %56 = OpLabel
-               OpBranch %46
-         %46 = OpLabel
-         %58 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %59 = OpLoad %uint %58 None
-%tint_low_inc_1 = OpISub %uint %59 %uint_1
-         %61 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %61 %tint_low_inc_1 None
-         %62 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %62 %uint_1 %uint_0
-         %64 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %65 = OpLoad %uint %64 None
-         %66 = OpISub %uint %65 %tint_carry_1
-         %67 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %67 %66 None
-               OpBranch %47
-         %48 = OpLabel
-               OpBranch %68
-         %68 = OpLabel
-               OpStore %tint_loop_idx_1 %14
-               OpStore %i0520_0 %int_0
-               OpBranch %71
-         %71 = OpLabel
-               OpLoopMerge %72 %70 None
-               OpBranch %69
-         %69 = OpLabel
-         %75 = OpLoad %v2uint %tint_loop_idx_1 None
-         %76 = OpIEqual %v2bool %75 %22
-         %77 = OpAll %bool %76
-               OpSelectionMerge %78 None
-               OpBranchConditional %77 %79 %78
-         %79 = OpLabel
-               OpBranch %72
-         %78 = OpLabel
-               OpSelectionMerge %80 None
-               OpBranchConditional %false %80 %81
-         %81 = OpLabel
-               OpBranch %72
-         %80 = OpLabel
-               OpBranch %70
-         %70 = OpLabel
-         %82 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_0
-         %83 = OpLoad %uint %82 None
-%tint_low_inc_2 = OpISub %uint %83 %uint_1
-         %85 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_0
-               OpStore %85 %tint_low_inc_2 None
-         %86 = OpIEqual %bool %tint_low_inc_2 %uint_4294967295
-%tint_carry_2 = OpSelect %uint %86 %uint_1 %uint_0
-         %88 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_1
+               OpBranch %13
+         %13 = OpLabel
+               OpLoopMerge %14 %12 None
+               OpBranch %11
+         %11 = OpLabel
+         %81 = OpLoad %v2uint %tint_loop_idx_0 None
+         %82 = OpIEqual %v2bool %81 %57
+         %83 = OpAll %bool %82
+               OpSelectionMerge %84 None
+               OpBranchConditional %83 %85 %84
+         %85 = OpLabel
+               OpBranch %14
+         %84 = OpLabel
+               OpSelectionMerge %86 None
+               OpBranchConditional %false %86 %87
+         %87 = OpLabel
+               OpBranch %14
+         %86 = OpLabel
+               OpBranch %12
+         %12 = OpLabel
+         %88 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
          %89 = OpLoad %uint %88 None
-         %90 = OpISub %uint %89 %tint_carry_2
-         %91 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_1
-               OpStore %91 %90 None
-               OpBranch %71
-         %72 = OpLabel
-               OpBranch %92
-         %92 = OpLabel
-               OpStore %tint_loop_idx_2 %14
-               OpStore %i62_0 %int_0
-               OpBranch %95
-         %95 = OpLabel
-               OpLoopMerge %96 %94 None
-               OpBranch %93
-         %93 = OpLabel
-         %99 = OpLoad %v2uint %tint_loop_idx_2 None
-        %100 = OpIEqual %v2bool %99 %22
-        %101 = OpAll %bool %100
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %102
-        %103 = OpLabel
-               OpBranch %96
-        %102 = OpLabel
-               OpSelectionMerge %104 None
-               OpBranchConditional %false %104 %105
-        %105 = OpLabel
-               OpBranch %96
+%tint_low_inc_1 = OpISub %uint %89 %uint_1
+         %91 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %91 %tint_low_inc_1 None
+         %92 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %92 %uint_1 %uint_0
+         %94 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %95 = OpLoad %uint %94 None
+         %96 = OpISub %uint %95 %tint_carry_1
+         %97 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %97 %96 None
+               OpBranch %13
+         %14 = OpLabel
+               OpBranch %15
+         %15 = OpLabel
+               OpStore %tint_loop_idx_1 %49
+               OpStore %i0520_0 %int_0
+               OpBranch %18
+         %18 = OpLabel
+               OpLoopMerge %19 %17 None
+               OpBranch %16
+         %16 = OpLabel
+        %100 = OpLoad %v2uint %tint_loop_idx_1 None
+        %101 = OpIEqual %v2bool %100 %57
+        %102 = OpAll %bool %101
+               OpSelectionMerge %103 None
+               OpBranchConditional %102 %104 %103
         %104 = OpLabel
-               OpBranch %94
-         %94 = OpLabel
-        %106 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_0
-        %107 = OpLoad %uint %106 None
-%tint_low_inc_3 = OpISub %uint %107 %uint_1
-        %109 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_0
-               OpStore %109 %tint_low_inc_3 None
-        %110 = OpIEqual %bool %tint_low_inc_3 %uint_4294967295
-%tint_carry_3 = OpSelect %uint %110 %uint_1 %uint_0
-        %112 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_1
-        %113 = OpLoad %uint %112 None
-        %114 = OpISub %uint %113 %tint_carry_3
-        %115 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_1
-               OpStore %115 %114 None
-               OpBranch %95
-         %96 = OpLabel
-               OpBranch %116
-        %116 = OpLabel
-               OpStore %tint_loop_idx_3 %14
+               OpBranch %19
+        %103 = OpLabel
+               OpSelectionMerge %105 None
+               OpBranchConditional %false %105 %106
+        %106 = OpLabel
+               OpBranch %19
+        %105 = OpLabel
+               OpBranch %17
+         %17 = OpLabel
+        %107 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_0
+        %108 = OpLoad %uint %107 None
+%tint_low_inc_2 = OpISub %uint %108 %uint_1
+        %110 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_0
+               OpStore %110 %tint_low_inc_2 None
+        %111 = OpIEqual %bool %tint_low_inc_2 %uint_4294967295
+%tint_carry_2 = OpSelect %uint %111 %uint_1 %uint_0
+        %113 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_1
+        %114 = OpLoad %uint %113 None
+        %115 = OpISub %uint %114 %tint_carry_2
+        %116 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_1 %uint_1
+               OpStore %116 %115 None
+               OpBranch %18
+         %19 = OpLabel
+               OpBranch %20
+         %20 = OpLabel
+               OpStore %tint_loop_idx_2 %49
+               OpStore %i62_0 %int_0
+               OpBranch %23
+         %23 = OpLabel
+               OpLoopMerge %24 %22 None
+               OpBranch %21
+         %21 = OpLabel
+        %119 = OpLoad %v2uint %tint_loop_idx_2 None
+        %120 = OpIEqual %v2bool %119 %57
+        %121 = OpAll %bool %120
+               OpSelectionMerge %122 None
+               OpBranchConditional %121 %123 %122
+        %123 = OpLabel
+               OpBranch %24
+        %122 = OpLabel
+               OpSelectionMerge %124 None
+               OpBranchConditional %false %124 %125
+        %125 = OpLabel
+               OpBranch %24
+        %124 = OpLabel
+               OpBranch %22
+         %22 = OpLabel
+        %126 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_0
+        %127 = OpLoad %uint %126 None
+%tint_low_inc_3 = OpISub %uint %127 %uint_1
+        %129 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_0
+               OpStore %129 %tint_low_inc_3 None
+        %130 = OpIEqual %bool %tint_low_inc_3 %uint_4294967295
+%tint_carry_3 = OpSelect %uint %130 %uint_1 %uint_0
+        %132 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_1
+        %133 = OpLoad %uint %132 None
+        %134 = OpISub %uint %133 %tint_carry_3
+        %135 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_2 %uint_1
+               OpStore %135 %134 None
+               OpBranch %23
+         %24 = OpLabel
+               OpBranch %25
+         %25 = OpLabel
+               OpStore %tint_loop_idx_3 %49
                OpStore %i62_1 %int_0
-               OpBranch %119
-        %119 = OpLabel
-               OpLoopMerge %120 %118 None
-               OpBranch %117
-        %117 = OpLabel
-        %123 = OpLoad %v2uint %tint_loop_idx_3 None
-        %124 = OpIEqual %v2bool %123 %22
-        %125 = OpAll %bool %124
-               OpSelectionMerge %126 None
-               OpBranchConditional %125 %127 %126
-        %127 = OpLabel
-               OpBranch %120
-        %126 = OpLabel
-               OpSelectionMerge %128 None
-               OpBranchConditional %false %128 %129
-        %129 = OpLabel
-               OpBranch %120
-        %128 = OpLabel
-               OpBranch %118
-        %118 = OpLabel
-        %130 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_0
-        %131 = OpLoad %uint %130 None
-%tint_low_inc_4 = OpISub %uint %131 %uint_1
-        %133 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_0
-               OpStore %133 %tint_low_inc_4 None
-        %134 = OpIEqual %bool %tint_low_inc_4 %uint_4294967295
-%tint_carry_4 = OpSelect %uint %134 %uint_1 %uint_0
-        %136 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_1
-        %137 = OpLoad %uint %136 None
-        %138 = OpISub %uint %137 %tint_carry_4
-        %139 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_1
-               OpStore %139 %138 None
-               OpBranch %119
-        %120 = OpLabel
-               OpBranch %140
-        %140 = OpLabel
-               OpStore %tint_loop_idx_4 %14
-               OpStore %i60 %int_0
-               OpBranch %143
-        %143 = OpLabel
-               OpLoopMerge %144 %142 None
-               OpBranch %141
-        %141 = OpLabel
-        %147 = OpLoad %v2uint %tint_loop_idx_4 None
-        %148 = OpIEqual %v2bool %147 %22
-        %149 = OpAll %bool %148
-               OpSelectionMerge %150 None
-               OpBranchConditional %149 %151 %150
-        %151 = OpLabel
-               OpBranch %144
-        %150 = OpLabel
-               OpSelectionMerge %152 None
-               OpBranchConditional %false %152 %153
-        %153 = OpLabel
-               OpBranch %144
-        %152 = OpLabel
-               OpBranch %142
+               OpBranch %28
+         %28 = OpLabel
+               OpLoopMerge %29 %27 None
+               OpBranch %26
+         %26 = OpLabel
+        %138 = OpLoad %v2uint %tint_loop_idx_3 None
+        %139 = OpIEqual %v2bool %138 %57
+        %140 = OpAll %bool %139
+               OpSelectionMerge %141 None
+               OpBranchConditional %140 %142 %141
         %142 = OpLabel
-        %154 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_0
-        %155 = OpLoad %uint %154 None
-%tint_low_inc_5 = OpISub %uint %155 %uint_1
-        %157 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_0
-               OpStore %157 %tint_low_inc_5 None
-        %158 = OpIEqual %bool %tint_low_inc_5 %uint_4294967295
-%tint_carry_5 = OpSelect %uint %158 %uint_1 %uint_0
-        %160 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_1
-        %161 = OpLoad %uint %160 None
-        %162 = OpISub %uint %161 %tint_carry_5
-        %163 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_1
-               OpStore %163 %162 None
-               OpBranch %143
+               OpBranch %29
+        %141 = OpLabel
+               OpSelectionMerge %143 None
+               OpBranchConditional %false %143 %144
         %144 = OpLabel
-               OpBranch %164
-        %164 = OpLabel
-               OpStore %tint_loop_idx_5 %14
+               OpBranch %29
+        %143 = OpLabel
+               OpBranch %27
+         %27 = OpLabel
+        %145 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_0
+        %146 = OpLoad %uint %145 None
+%tint_low_inc_4 = OpISub %uint %146 %uint_1
+        %148 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_0
+               OpStore %148 %tint_low_inc_4 None
+        %149 = OpIEqual %bool %tint_low_inc_4 %uint_4294967295
+%tint_carry_4 = OpSelect %uint %149 %uint_1 %uint_0
+        %151 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_1
+        %152 = OpLoad %uint %151 None
+        %153 = OpISub %uint %152 %tint_carry_4
+        %154 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_3 %uint_1
+               OpStore %154 %153 None
+               OpBranch %28
+         %29 = OpLabel
+               OpBranch %30
+         %30 = OpLabel
+               OpStore %tint_loop_idx_4 %49
+               OpStore %i60 %int_0
+               OpBranch %33
+         %33 = OpLabel
+               OpLoopMerge %34 %32 None
+               OpBranch %31
+         %31 = OpLabel
+        %157 = OpLoad %v2uint %tint_loop_idx_4 None
+        %158 = OpIEqual %v2bool %157 %57
+        %159 = OpAll %bool %158
+               OpSelectionMerge %160 None
+               OpBranchConditional %159 %161 %160
+        %161 = OpLabel
+               OpBranch %34
+        %160 = OpLabel
+               OpSelectionMerge %162 None
+               OpBranchConditional %false %162 %163
+        %163 = OpLabel
+               OpBranch %34
+        %162 = OpLabel
+               OpBranch %32
+         %32 = OpLabel
+        %164 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_0
+        %165 = OpLoad %uint %164 None
+%tint_low_inc_5 = OpISub %uint %165 %uint_1
+        %167 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_0
+               OpStore %167 %tint_low_inc_5 None
+        %168 = OpIEqual %bool %tint_low_inc_5 %uint_4294967295
+%tint_carry_5 = OpSelect %uint %168 %uint_1 %uint_0
+        %170 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_1
+        %171 = OpLoad %uint %170 None
+        %172 = OpISub %uint %171 %tint_carry_5
+        %173 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_4 %uint_1
+               OpStore %173 %172 None
+               OpBranch %33
+         %34 = OpLabel
+               OpBranch %35
+         %35 = OpLabel
+               OpStore %tint_loop_idx_5 %49
                OpStore %i62_2 %int_0
-               OpBranch %167
-        %167 = OpLabel
-               OpLoopMerge %168 %166 None
-               OpBranch %165
-        %165 = OpLabel
-        %171 = OpLoad %v2uint %tint_loop_idx_5 None
-        %172 = OpIEqual %v2bool %171 %22
-        %173 = OpAll %bool %172
-               OpSelectionMerge %174 None
-               OpBranchConditional %173 %175 %174
-        %175 = OpLabel
-               OpBranch %168
-        %174 = OpLabel
-               OpSelectionMerge %176 None
-               OpBranchConditional %false %176 %177
-        %177 = OpLabel
-               OpBranch %168
-        %176 = OpLabel
-               OpBranch %166
-        %166 = OpLabel
-        %178 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_0
-        %179 = OpLoad %uint %178 None
-%tint_low_inc_6 = OpISub %uint %179 %uint_1
-        %181 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_0
-               OpStore %181 %tint_low_inc_6 None
-        %182 = OpIEqual %bool %tint_low_inc_6 %uint_4294967295
-%tint_carry_6 = OpSelect %uint %182 %uint_1 %uint_0
-        %184 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_1
-        %185 = OpLoad %uint %184 None
-        %186 = OpISub %uint %185 %tint_carry_6
-        %187 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_1
-               OpStore %187 %186 None
-               OpBranch %167
-        %168 = OpLabel
-               OpBranch %188
-        %188 = OpLabel
-               OpStore %tint_loop_idx_6 %14
+               OpBranch %38
+         %38 = OpLabel
+               OpLoopMerge %39 %37 None
+               OpBranch %36
+         %36 = OpLabel
+        %176 = OpLoad %v2uint %tint_loop_idx_5 None
+        %177 = OpIEqual %v2bool %176 %57
+        %178 = OpAll %bool %177
+               OpSelectionMerge %179 None
+               OpBranchConditional %178 %180 %179
+        %180 = OpLabel
+               OpBranch %39
+        %179 = OpLabel
+               OpSelectionMerge %181 None
+               OpBranchConditional %false %181 %182
+        %182 = OpLabel
+               OpBranch %39
+        %181 = OpLabel
+               OpBranch %37
+         %37 = OpLabel
+        %183 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_0
+        %184 = OpLoad %uint %183 None
+%tint_low_inc_6 = OpISub %uint %184 %uint_1
+        %186 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_0
+               OpStore %186 %tint_low_inc_6 None
+        %187 = OpIEqual %bool %tint_low_inc_6 %uint_4294967295
+%tint_carry_6 = OpSelect %uint %187 %uint_1 %uint_0
+        %189 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_1
+        %190 = OpLoad %uint %189 None
+        %191 = OpISub %uint %190 %tint_carry_6
+        %192 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_5 %uint_1
+               OpStore %192 %191 None
+               OpBranch %38
+         %39 = OpLabel
+               OpBranch %40
+         %40 = OpLabel
+               OpStore %tint_loop_idx_6 %49
                OpStore %i60_0 %int_0
-               OpBranch %191
-        %191 = OpLabel
-               OpLoopMerge %192 %190 None
-               OpBranch %189
-        %189 = OpLabel
+               OpBranch %43
+         %43 = OpLabel
+               OpLoopMerge %44 %42 None
+               OpBranch %41
+         %41 = OpLabel
         %195 = OpLoad %v2uint %tint_loop_idx_6 None
-        %196 = OpIEqual %v2bool %195 %22
+        %196 = OpIEqual %v2bool %195 %57
         %197 = OpAll %bool %196
                OpSelectionMerge %198 None
                OpBranchConditional %197 %199 %198
         %199 = OpLabel
-               OpBranch %192
+               OpBranch %44
         %198 = OpLabel
                OpSelectionMerge %200 None
                OpBranchConditional %false %200 %201
         %201 = OpLabel
-               OpBranch %192
+               OpBranch %44
         %200 = OpLabel
-               OpBranch %190
-        %190 = OpLabel
+               OpBranch %42
+         %42 = OpLabel
         %202 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_6 %uint_0
         %203 = OpLoad %uint %202 None
 %tint_low_inc_7 = OpISub %uint %203 %uint_1
@@ -378,8 +378,8 @@
         %210 = OpISub %uint %209 %tint_carry_7
         %211 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_6 %uint_1
                OpStore %211 %210 None
-               OpBranch %191
-        %192 = OpLabel
+               OpBranch %43
+         %44 = OpLabel
                OpReturn
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %3
diff --git a/test/tint/bug/chromium/343597426.wgsl.expected.spvasm b/test/tint/bug/chromium/343597426.wgsl.expected.spvasm
index aed9f23..220e1cb 100644
--- a/test/tint/bug/chromium/343597426.wgsl.expected.spvasm
+++ b/test/tint/bug/chromium/343597426.wgsl.expected.spvasm
@@ -40,10 +40,10 @@
                OpStore %continue_execution %false None
                OpBranch %16
          %16 = OpLabel
-         %19 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %20 None
-               OpBranchConditional %19 %21 %20
-         %21 = OpLabel
+         %18 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %19 None
+               OpBranchConditional %18 %20 %19
+         %20 = OpLabel
                OpSelectionMerge %22 None
                OpBranchConditional %c %23 %22
          %23 = OpLabel
@@ -66,8 +66,8 @@
          %27 = OpLabel
                OpBranch %22
          %22 = OpLabel
-               OpBranch %20
-         %20 = OpLabel
+               OpBranch %19
+         %19 = OpLabel
                OpBranch %14
          %14 = OpLabel
                OpReturn
diff --git a/test/tint/bug/chromium/344265982.wgsl.expected.spvasm b/test/tint/bug/chromium/344265982.wgsl.expected.spvasm
index f8cfe27..f9aab32 100644
--- a/test/tint/bug/chromium/344265982.wgsl.expected.spvasm
+++ b/test/tint/bug/chromium/344265982.wgsl.expected.spvasm
@@ -35,8 +35,8 @@
      %uint_3 = OpConstant %uint 3
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
      %uint_0 = OpConstant %uint 0
-      %int_2 = OpConstant %int 2
       %int_1 = OpConstant %int 1
+      %int_2 = OpConstant %int 2
         %foo = OpFunction %void None %10
          %11 = OpLabel
           %i = OpVariable %_ptr_Function_int Function
@@ -62,21 +62,21 @@
          %34 = OpLoad %int %31 None
                OpSelectionMerge %37 None
                OpSwitch %34 %35 1 %36
+         %35 = OpLabel
+         %41 = OpLoad %int %i None
+         %42 = OpBitcast %uint %41
+         %43 = OpExtInst %uint %29 UMin %42 %uint_3
+         %44 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %43
+               OpStore %44 %int_2 None
+               OpBranch %37
          %36 = OpLabel
                OpBranch %14
-         %35 = OpLabel
-         %38 = OpLoad %int %i None
-         %39 = OpBitcast %uint %38
-         %40 = OpExtInst %uint %29 UMin %39 %uint_3
-         %41 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %40
-               OpStore %41 %int_2 None
-               OpBranch %37
          %37 = OpLabel
                OpBranch %14
          %14 = OpLabel
-         %43 = OpLoad %int %i None
-         %44 = OpIAdd %int %43 %int_1
-               OpStore %i %44 None
+         %38 = OpLoad %int %i None
+         %39 = OpIAdd %int %38 %int_1
+               OpStore %i %39 None
                OpBranch %15
          %16 = OpLabel
                OpReturn
diff --git a/test/tint/bug/chromium/40943165.wgsl.expected.spvasm b/test/tint/bug/chromium/40943165.wgsl.expected.spvasm
index 6c2ff9f..8cad14b 100644
--- a/test/tint/bug/chromium/40943165.wgsl.expected.spvasm
+++ b/test/tint/bug/chromium/40943165.wgsl.expected.spvasm
@@ -25,12 +25,12 @@
          %12 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %19 = OpConstantNull %mat2v2float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
      %uint_0 = OpConstant %uint 0
     %float_0 = OpConstant %float 0
+         %29 = OpConstantNull %mat2v2float
          %31 = OpTypeFunction %void
     %F_inner = OpFunction %void None %12
      %mat2x2 = OpFunctionParameter %uint
@@ -39,15 +39,15 @@
                OpSelectionMerge %17 None
                OpBranchConditional %14 %18 %17
          %18 = OpLabel
-               OpStore %W %19 None
+               OpStore %W %29 None
                OpBranch %17
          %17 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %23 = OpAccessChain %_ptr_Workgroup_v2float %W %uint_0
-         %26 = OpLoad %v2float %23 None
-         %27 = OpCompositeConstruct %v2float %float_0 %float_0
-         %29 = OpFAdd %v2float %26 %27
-               OpStore %23 %29 None
+         %22 = OpAccessChain %_ptr_Workgroup_v2float %W %uint_0
+         %25 = OpLoad %v2float %22 None
+         %26 = OpCompositeConstruct %v2float %float_0 %float_0
+         %28 = OpFAdd %v2float %25 %26
+               OpStore %22 %28 None
                OpReturn
                OpFunctionEnd
           %F = OpFunction %void None %31
diff --git a/test/tint/bug/dawn/947.wgsl.expected.spvasm b/test/tint/bug/dawn/947.wgsl.expected.spvasm
index 5b29ddc..c7baabb 100644
--- a/test/tint/bug/dawn/947.wgsl.expected.spvasm
+++ b/test/tint/bug/dawn/947.wgsl.expected.spvasm
@@ -83,8 +83,8 @@
        %bool = OpTypeBool
 %_ptr_Function_bool = OpTypePointer Function %bool
    %float_n1 = OpConstant %float -1
-         %77 = OpConstantComposite %v2float %float_1 %float_n1
-         %80 = OpConstantComposite %v2float %float_0 %float_1
+         %78 = OpConstantComposite %v2float %float_1 %float_n1
+         %81 = OpConstantComposite %v2float %float_0 %float_1
        %void = OpTypeVoid
          %96 = OpTypeFunction %void
 %vs_main_inner = OpFunction %VertexOutputs None %20
@@ -111,38 +111,38 @@
                OpSelectionMerge %63 None
                OpBranchConditional %62 %64 %65
          %64 = OpLabel
-         %66 = OpAccessChain %_ptr_Function_v2float %output %uint_0
-         %67 = OpExtInst %uint %42 UMin %VertexIndex %uint_2
-         %68 = OpAccessChain %_ptr_Function_v2float %texcoord %67
-         %69 = OpLoad %v2float %68 None
-         %70 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0
-         %71 = OpLoad %v2float %70 None
-         %72 = OpFMul %v2float %69 %71
-         %73 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1
-         %74 = OpLoad %v2float %73 None
-         %75 = OpFAdd %v2float %72 %74
-         %76 = OpFMul %v2float %75 %77
-         %79 = OpFAdd %v2float %76 %80
-               OpStore %66 %79 None
+         %67 = OpAccessChain %_ptr_Function_v2float %output %uint_0
+         %68 = OpExtInst %uint %42 UMin %VertexIndex %uint_2
+         %69 = OpAccessChain %_ptr_Function_v2float %texcoord %68
+         %70 = OpLoad %v2float %69 None
+         %71 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0
+         %72 = OpLoad %v2float %71 None
+         %73 = OpFMul %v2float %70 %72
+         %74 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1
+         %75 = OpLoad %v2float %74 None
+         %76 = OpFAdd %v2float %73 %75
+         %77 = OpFMul %v2float %76 %78
+         %80 = OpFAdd %v2float %77 %81
+               OpStore %67 %80 None
                OpBranch %63
          %65 = OpLabel
-         %81 = OpAccessChain %_ptr_Function_v2float %output %uint_0
-         %82 = OpExtInst %uint %42 UMin %VertexIndex %uint_2
-         %83 = OpAccessChain %_ptr_Function_v2float %texcoord %82
-         %84 = OpLoad %v2float %83 None
-         %85 = OpFMul %v2float %84 %77
-         %86 = OpFAdd %v2float %85 %80
-         %87 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0
-         %88 = OpLoad %v2float %87 None
-         %89 = OpFMul %v2float %86 %88
-         %90 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1
-         %91 = OpLoad %v2float %90 None
-         %92 = OpFAdd %v2float %89 %91
-               OpStore %81 %92 None
+         %82 = OpAccessChain %_ptr_Function_v2float %output %uint_0
+         %83 = OpExtInst %uint %42 UMin %VertexIndex %uint_2
+         %84 = OpAccessChain %_ptr_Function_v2float %texcoord %83
+         %85 = OpLoad %v2float %84 None
+         %86 = OpFMul %v2float %85 %78
+         %87 = OpFAdd %v2float %86 %81
+         %88 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_0
+         %89 = OpLoad %v2float %88 None
+         %90 = OpFMul %v2float %87 %89
+         %91 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_1
+         %92 = OpLoad %v2float %91 None
+         %93 = OpFAdd %v2float %90 %92
+               OpStore %82 %93 None
                OpBranch %63
          %63 = OpLabel
-         %93 = OpLoad %VertexOutputs %output None
-               OpReturnValue %93
+         %66 = OpLoad %VertexOutputs %output None
+               OpReturnValue %66
                OpFunctionEnd
     %vs_main = OpFunction %void None %96
          %97 = OpLabel
@@ -195,9 +195,9 @@
          %19 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
      %v2bool = OpTypeVector %bool 2
-      %false = OpConstantFalse %bool
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %33 = OpConstantNull %v4float
+         %32 = OpConstantNull %v4float
+      %false = OpConstantFalse %bool
        %void = OpTypeVoid
          %41 = OpTypeFunction %void
 %fs_main_inner = OpFunction %v4float None %14
@@ -217,16 +217,16 @@
                OpStore %continue_execution %false None
                OpBranch %28
          %28 = OpLabel
-               OpStore %srcColor %33
-         %34 = OpLoad %v4float %srcColor None
-         %35 = OpLoad %bool %continue_execution None
-         %36 = OpLogicalNot %bool %35
-               OpSelectionMerge %37 None
-               OpBranchConditional %36 %38 %37
-         %38 = OpLabel
-               OpKill
+               OpStore %srcColor %32
+         %33 = OpLoad %v4float %srcColor None
+         %34 = OpLoad %bool %continue_execution None
+         %35 = OpLogicalNot %bool %34
+               OpSelectionMerge %36 None
+               OpBranchConditional %35 %37 %36
          %37 = OpLabel
-               OpReturnValue %34
+               OpKill
+         %36 = OpLabel
+               OpReturnValue %33
                OpFunctionEnd
     %fs_main = OpFunction %void None %41
          %42 = OpLabel
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.spvasm b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.spvasm
index 25b70a9..1b2b6ec 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.spvasm
+++ b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 58
 ; Schema: 0
                OpCapability Shader
-         %49 = OpExtInstImport "GLSL.std.450"
+         %41 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %f "f" %f_local_invocation_index_Input
                OpExecutionMode %f LocalSize 1 1 1
@@ -55,16 +55,16 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+     %uint_0 = OpConstant %uint 0
 %_ptr_Uniform_int = OpTypePointer Uniform %int
     %uint_63 = OpConstant %uint 63
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
+     %uint_1 = OpConstant %uint 1
          %54 = OpTypeFunction %void
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
@@ -77,28 +77,28 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_64
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %46 = OpUGreaterThanEqual %bool %28 %uint_64
+               OpSelectionMerge %48 None
+               OpBranchConditional %46 %49 %48
+         %49 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %28
-               OpStore %34 %int_0 None
+         %48 = OpLabel
+         %50 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %28
+               OpStore %50 %int_0 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %42 = OpAccessChain %_ptr_StorageBuffer_int %6 %uint_0 %uint_0
-         %44 = OpAccessChain %_ptr_Uniform_int %1 %uint_0 %uint_0
-         %46 = OpLoad %int %44 None
-         %47 = OpBitcast %uint %46
-         %48 = OpExtInst %uint %49 UMin %47 %uint_63
-         %51 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %48
-         %52 = OpLoad %int %51 None
-               OpStore %42 %52 None
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %6 %uint_0 %uint_0
+         %36 = OpAccessChain %_ptr_Uniform_int %1 %uint_0 %uint_0
+         %38 = OpLoad %int %36 None
+         %39 = OpBitcast %uint %38
+         %40 = OpExtInst %uint %41 UMin %39 %uint_63
+         %43 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %40
+         %45 = OpLoad %int %43 None
+               OpStore %33 %45 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %54
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.spvasm b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.spvasm
index 0cfe1b1..b0bd517 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.spvasm
+++ b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 61
 ; Schema: 0
                OpCapability Shader
-         %47 = OpExtInstImport "GLSL.std.450"
+         %39 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %f "f" %f_local_invocation_index_Input
                OpExecutionMode %f LocalSize 1 1 1
@@ -55,18 +55,18 @@
 %f_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %21 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_int = OpTypePointer Uniform %int
+     %uint_0 = OpConstant %uint 0
     %uint_63 = OpConstant %uint 63
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %int_1 = OpConstant %int 1
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
      %uint_3 = OpConstant %uint 3
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
+     %uint_1 = OpConstant %uint 1
          %57 = OpTypeFunction %void
     %f_inner = OpFunction %void None %21
 %tint_local_index = OpFunctionParameter %uint
@@ -79,30 +79,30 @@
                OpLoopMerge %27 %25 None
                OpBranch %24
          %24 = OpLabel
-         %30 = OpUGreaterThanEqual %bool %28 %uint_64
-               OpSelectionMerge %32 None
-               OpBranchConditional %30 %33 %32
-         %33 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %28 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %27
-         %32 = OpLabel
-         %34 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %28
-               OpStore %34 %int_0 None
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %28
+               OpStore %53 %int_0 None
                OpBranch %25
          %25 = OpLabel
          %29 = OpIAdd %uint %28 %uint_1
                OpBranch %26
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %42 = OpAccessChain %_ptr_Uniform_int %1 %uint_0 %uint_0
-         %44 = OpLoad %int %42 None
-         %45 = OpBitcast %uint %44
-         %46 = OpExtInst %uint %47 UMin %45 %uint_63
-         %49 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %46
-               OpStore %49 %int_1 None
-         %51 = OpAccessChain %_ptr_StorageBuffer_int %6 %uint_0 %uint_0
-         %53 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %uint_3
-         %55 = OpLoad %int %53 None
-               OpStore %51 %55 None
+         %33 = OpAccessChain %_ptr_Uniform_int %1 %uint_0 %uint_0
+         %36 = OpLoad %int %33 None
+         %37 = OpBitcast %uint %36
+         %38 = OpExtInst %uint %39 UMin %37 %uint_63
+         %41 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %38
+               OpStore %41 %int_1 None
+         %44 = OpAccessChain %_ptr_StorageBuffer_int %6 %uint_0 %uint_0
+         %46 = OpAccessChain %_ptr_Workgroup_int %s %uint_0 %uint_3
+         %48 = OpLoad %int %46 None
+               OpStore %44 %48 None
                OpReturn
                OpFunctionEnd
           %f = OpFunction %void None %57
diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm
index 61e6158..931d53c 100644
--- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm
+++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm
@@ -46,22 +46,22 @@
         %int = OpTypeInt 32 1
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
+    %float_1 = OpConstant %float 1
+         %34 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %38 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %42 = OpConstantNull %v2uint
+         %40 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %44 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %int_1 = OpConstant %int 1
 %sampleDepth = OpConstant %float 0
        %true = OpConstantTrue %bool
-    %float_1 = OpConstant %float 1
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
-         %97 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
        %void = OpTypeVoid
         %100 = OpTypeFunction %void
  %main_inner = OpFunction %v4float None %16
@@ -77,89 +77,89 @@
                OpStore %i %int_0
                OpBranch %29
          %29 = OpLabel
-               OpStore %tint_loop_idx %38
+               OpStore %tint_loop_idx %40
                OpBranch %32
          %32 = OpLabel
                OpLoopMerge %33 %31 None
                OpBranch %30
          %30 = OpLabel
-         %40 = OpLoad %v2uint %tint_loop_idx None
-         %41 = OpIEqual %v2bool %40 %42
-         %45 = OpAll %bool %41
-               OpSelectionMerge %46 None
-               OpBranchConditional %45 %47 %46
-         %47 = OpLabel
+         %42 = OpLoad %v2uint %tint_loop_idx None
+         %43 = OpIEqual %v2bool %42 %44
+         %47 = OpAll %bool %43
+               OpSelectionMerge %48 None
+               OpBranchConditional %47 %49 %48
+         %49 = OpLabel
                OpBranch %33
-         %46 = OpLabel
-         %48 = OpLoad %int %i None
-         %49 = OpSLessThan %bool %48 %int_1
-               OpSelectionMerge %51 None
-               OpBranchConditional %49 %51 %52
-         %52 = OpLabel
+         %48 = OpLabel
+         %50 = OpLoad %int %i None
+         %51 = OpSLessThan %bool %50 %int_1
+               OpSelectionMerge %53 None
+               OpBranchConditional %51 %53 %54
+         %54 = OpLabel
                OpBranch %33
-         %51 = OpLabel
-         %53 = OpCompositeExtract %float %random 0
-     %offset = OpCompositeConstruct %v3float %53 %53 %53
-         %55 = OpCompositeExtract %float %offset 0
-         %56 = OpFOrdLessThan %bool %55 %sampleDepth
-               OpSelectionMerge %58 None
-               OpBranchConditional %56 %59 %60
-         %59 = OpLabel
-               OpBranch %58
+         %53 = OpLabel
+         %55 = OpCompositeExtract %float %random 0
+     %offset = OpCompositeConstruct %v3float %55 %55 %55
+         %57 = OpCompositeExtract %float %offset 0
+         %58 = OpFOrdLessThan %bool %57 %sampleDepth
+               OpSelectionMerge %60 None
+               OpBranchConditional %58 %61 %62
+         %61 = OpLabel
+               OpBranch %60
+         %62 = OpLabel
+         %93 = OpCompositeExtract %float %offset 1
+         %65 = OpFOrdLessThan %bool %93 %sampleDepth
+               OpBranch %60
          %60 = OpLabel
-         %61 = OpCompositeExtract %float %offset 1
-         %62 = OpFOrdLessThan %bool %61 %sampleDepth
-               OpBranch %58
-         %58 = OpLabel
-         %63 = OpPhi %bool %true %59 %62 %60
-               OpSelectionMerge %65 None
-               OpBranchConditional %63 %66 %67
-         %66 = OpLabel
-               OpBranch %65
+         %63 = OpPhi %bool %true %61 %65 %62
+               OpSelectionMerge %66 None
+               OpBranchConditional %63 %67 %68
          %67 = OpLabel
-         %68 = OpCompositeExtract %float %offset 0
-         %69 = OpFOrdGreaterThan %bool %68 %float_1
-               OpBranch %65
-         %65 = OpLabel
-         %71 = OpPhi %bool %true %66 %69 %67
-               OpSelectionMerge %72 None
-               OpBranchConditional %71 %73 %74
-         %73 = OpLabel
-               OpBranch %72
-         %74 = OpLabel
-         %75 = OpCompositeExtract %float %offset 1
-         %76 = OpFOrdGreaterThan %bool %75 %float_1
-               OpBranch %72
+               OpBranch %66
+         %68 = OpLabel
+         %94 = OpCompositeExtract %float %offset 0
+         %70 = OpFOrdGreaterThan %bool %94 %float_1
+               OpBranch %66
+         %66 = OpLabel
+         %69 = OpPhi %bool %true %67 %70 %68
+               OpSelectionMerge %71 None
+               OpBranchConditional %69 %72 %73
          %72 = OpLabel
-         %77 = OpPhi %bool %true %73 %76 %74
-               OpSelectionMerge %78 None
-               OpBranchConditional %77 %79 %78
-         %79 = OpLabel
-         %80 = OpLoad %int %i None
-         %81 = OpIAdd %int %80 %int_1
-               OpStore %i %81 None
+               OpBranch %71
+         %73 = OpLabel
+         %95 = OpCompositeExtract %float %offset 1
+         %75 = OpFOrdGreaterThan %bool %95 %float_1
+               OpBranch %71
+         %71 = OpLabel
+         %74 = OpPhi %bool %true %72 %75 %73
+               OpSelectionMerge %76 None
+               OpBranchConditional %74 %77 %76
+         %77 = OpLabel
+         %96 = OpLoad %int %i None
+         %97 = OpIAdd %int %96 %int_1
+               OpStore %i %97 None
                OpBranch %31
-         %78 = OpLabel
-         %82 = OpLoad %int %i None
-         %83 = OpIAdd %int %82 %int_1
-               OpStore %i %83 None
+         %76 = OpLabel
+         %78 = OpLoad %int %i None
+         %79 = OpIAdd %int %78 %int_1
+               OpStore %i %79 None
                OpBranch %31
          %31 = OpLabel
-         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %87 = OpLoad %uint %84 None
-%tint_low_inc = OpISub %uint %87 %uint_1
-         %90 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %90 %tint_low_inc None
-         %91 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %91 %uint_1 %uint_0
-         %93 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %94 = OpLoad %uint %93 None
-         %95 = OpISub %uint %94 %tint_carry
-         %96 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %96 %95 None
+         %80 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %83 = OpLoad %uint %80 None
+%tint_low_inc = OpISub %uint %83 %uint_1
+         %86 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %86 %tint_low_inc None
+         %87 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %87 %uint_1 %uint_0
+         %89 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %90 = OpLoad %uint %89 None
+         %91 = OpISub %uint %90 %tint_carry
+         %92 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %92 %91 None
                OpBranch %32
          %33 = OpLabel
-               OpReturnValue %97
+               OpReturnValue %34
                OpFunctionEnd
        %main = OpFunction %void None %100
         %101 = OpLabel
diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.spvasm b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.spvasm
index 50c6250..a892c4a 100644
--- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.spvasm
+++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.spvasm
@@ -132,21 +132,21 @@
                OpLoopMerge %74 %72 None
                OpBranch %71
          %71 = OpLabel
-         %77 = OpUGreaterThanEqual %bool %75 %uint_8
-               OpSelectionMerge %79 None
-               OpBranchConditional %77 %80 %79
-         %80 = OpLabel
+         %78 = OpUGreaterThanEqual %bool %75 %uint_8
+               OpSelectionMerge %80 None
+               OpBranchConditional %78 %81 %80
+         %81 = OpLabel
                OpBranch %74
-         %79 = OpLabel
-         %81 = OpAccessChain %_ptr_Function_v3float %65 %75
-         %82 = OpLoad %v3float %81 None
-         %83 = OpAccessChain %_ptr_Function_v3float %67 %75
-               OpStore %83 %82 None
+         %80 = OpLabel
+         %82 = OpAccessChain %_ptr_Function_v3float %65 %75
+         %83 = OpLoad %v3float %82 None
+         %84 = OpAccessChain %_ptr_Function_v3float %67 %75
+               OpStore %84 %83 None
                OpBranch %72
          %72 = OpLabel
          %76 = OpIAdd %uint %75 %uint_1
                OpBranch %73
          %74 = OpLabel
-         %84 = OpLoad %_arr_v3float_uint_8_0 %67 None
-               OpReturnValue %84
+         %77 = OpLoad %_arr_v3float_uint_8_0 %67 None
+               OpReturnValue %77
                OpFunctionEnd
diff --git a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.spvasm b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.spvasm
index 12aff07..bd21757 100644
--- a/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.spvasm
+++ b/test/tint/bug/fxc/vector_assignment_in_loop/loop_types_some.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 131
 ; Schema: 0
                OpCapability Shader
-         %73 = OpExtInstImport "GLSL.std.450"
+         %68 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %main "main"
                OpExecutionMode %main LocalSize 1 1 1
@@ -67,16 +67,16 @@
          %56 = OpConstantNull %v4bool
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
-      %int_2 = OpConstant %int 2
-     %uint_1 = OpConstant %uint 1
+     %uint_2 = OpConstant %uint 2
 %_ptr_Function_float = OpTypePointer Function %float
     %float_1 = OpConstant %float 1
+     %uint_3 = OpConstant %uint 3
       %int_1 = OpConstant %int 1
 %_ptr_Function_uint = OpTypePointer Function %uint
+     %uint_1 = OpConstant %uint 1
 %_ptr_Function_bool = OpTypePointer Function %bool
        %true = OpConstantTrue %bool
-     %uint_2 = OpConstant %uint 2
-     %uint_3 = OpConstant %uint 3
+      %int_2 = OpConstant %int 2
        %main = OpFunction %void None %3
           %4 = OpLabel
         %v2f = OpVariable %_ptr_Function_v2float Function %9
@@ -95,86 +95,86 @@
         %i_0 = OpVariable %_ptr_Function_int Function
                OpBranch %57
          %57 = OpLabel
-               OpStore %i %int_0
+               OpStore %i_0 %int_0
                OpBranch %60
          %60 = OpLabel
                OpLoopMerge %61 %59 None
                OpBranch %58
          %58 = OpLabel
-         %65 = OpLoad %int %i None
-         %66 = OpSLessThan %bool %65 %int_2
-               OpSelectionMerge %68 None
-               OpBranchConditional %66 %68 %69
-         %69 = OpLabel
+        %108 = OpLoad %int %i_0 None
+        %109 = OpSLessThan %bool %108 %int_2
+               OpSelectionMerge %111 None
+               OpBranchConditional %109 %111 %112
+        %112 = OpLabel
                OpBranch %61
-         %68 = OpLabel
-         %70 = OpLoad %int %i None
-         %71 = OpBitcast %uint %70
-         %72 = OpExtInst %uint %73 UMin %71 %uint_1
-         %75 = OpAccessChain %_ptr_Function_float %v2f %72
-               OpStore %75 %float_1 None
+        %111 = OpLabel
+        %113 = OpLoad %int %i_0 None
+        %114 = OpBitcast %uint %113
+        %115 = OpExtInst %uint %68 UMin %114 %uint_1
+        %116 = OpAccessChain %_ptr_Function_float %v2f %115
+               OpStore %116 %float_1 None
+        %117 = OpLoad %int %i_0 None
+        %118 = OpBitcast %uint %117
+        %119 = OpExtInst %uint %68 UMin %118 %uint_1
+        %120 = OpAccessChain %_ptr_Function_int %v2i %119
+               OpStore %120 %int_1 None
+        %121 = OpLoad %int %i_0 None
+        %122 = OpBitcast %uint %121
+        %123 = OpExtInst %uint %68 UMin %122 %uint_1
+        %124 = OpAccessChain %_ptr_Function_uint %v2u %123
+               OpStore %124 %uint_1 None
+        %125 = OpLoad %int %i_0 None
+        %126 = OpBitcast %uint %125
+        %127 = OpExtInst %uint %68 UMin %126 %uint_1
+        %128 = OpAccessChain %_ptr_Function_bool %v2b %127
+               OpStore %128 %true None
+               OpBranch %59
+         %59 = OpLabel
+        %129 = OpLoad %int %i_0 None
+        %130 = OpIAdd %int %129 %int_1
+               OpStore %i_0 %130 None
+               OpBranch %60
+         %61 = OpLabel
+               OpStore %i %int_0
+         %65 = OpLoad %int %i None
+         %66 = OpBitcast %uint %65
+         %67 = OpExtInst %uint %68 UMin %66 %uint_2
+         %70 = OpAccessChain %_ptr_Function_float %v3f %67
+               OpStore %70 %float_1 None
+         %73 = OpLoad %int %i None
+         %74 = OpBitcast %uint %73
+         %75 = OpExtInst %uint %68 UMin %74 %uint_3
+         %77 = OpAccessChain %_ptr_Function_float %v4f %75
+               OpStore %77 %float_1 None
          %78 = OpLoad %int %i None
          %79 = OpBitcast %uint %78
-         %80 = OpExtInst %uint %73 UMin %79 %uint_1
-         %81 = OpAccessChain %_ptr_Function_int %v2i %80
+         %80 = OpExtInst %uint %68 UMin %79 %uint_2
+         %81 = OpAccessChain %_ptr_Function_int %v3i %80
                OpStore %81 %int_1 None
          %83 = OpLoad %int %i None
          %84 = OpBitcast %uint %83
-         %85 = OpExtInst %uint %73 UMin %84 %uint_1
-         %86 = OpAccessChain %_ptr_Function_uint %v2u %85
-               OpStore %86 %uint_1 None
-         %88 = OpLoad %int %i None
-         %89 = OpBitcast %uint %88
-         %90 = OpExtInst %uint %73 UMin %89 %uint_1
-         %91 = OpAccessChain %_ptr_Function_bool %v2b %90
-               OpStore %91 %true None
-               OpBranch %59
-         %59 = OpLabel
-         %94 = OpLoad %int %i None
-         %95 = OpIAdd %int %94 %int_1
-               OpStore %i %95 None
-               OpBranch %60
-         %61 = OpLabel
-               OpStore %i_0 %int_0
-         %97 = OpLoad %int %i_0 None
+         %85 = OpExtInst %uint %68 UMin %84 %uint_3
+         %86 = OpAccessChain %_ptr_Function_int %v4i %85
+               OpStore %86 %int_1 None
+         %87 = OpLoad %int %i None
+         %88 = OpBitcast %uint %87
+         %89 = OpExtInst %uint %68 UMin %88 %uint_2
+         %90 = OpAccessChain %_ptr_Function_uint %v3u %89
+               OpStore %90 %uint_1 None
+         %93 = OpLoad %int %i None
+         %94 = OpBitcast %uint %93
+         %95 = OpExtInst %uint %68 UMin %94 %uint_3
+         %96 = OpAccessChain %_ptr_Function_uint %v4u %95
+               OpStore %96 %uint_1 None
+         %97 = OpLoad %int %i None
          %98 = OpBitcast %uint %97
-         %99 = OpExtInst %uint %73 UMin %98 %uint_2
-        %101 = OpAccessChain %_ptr_Function_float %v3f %99
-               OpStore %101 %float_1 None
-        %102 = OpLoad %int %i_0 None
-        %103 = OpBitcast %uint %102
-        %104 = OpExtInst %uint %73 UMin %103 %uint_3
-        %106 = OpAccessChain %_ptr_Function_float %v4f %104
-               OpStore %106 %float_1 None
-        %107 = OpLoad %int %i_0 None
-        %108 = OpBitcast %uint %107
-        %109 = OpExtInst %uint %73 UMin %108 %uint_2
-        %110 = OpAccessChain %_ptr_Function_int %v3i %109
-               OpStore %110 %int_1 None
-        %111 = OpLoad %int %i_0 None
-        %112 = OpBitcast %uint %111
-        %113 = OpExtInst %uint %73 UMin %112 %uint_3
-        %114 = OpAccessChain %_ptr_Function_int %v4i %113
-               OpStore %114 %int_1 None
-        %115 = OpLoad %int %i_0 None
-        %116 = OpBitcast %uint %115
-        %117 = OpExtInst %uint %73 UMin %116 %uint_2
-        %118 = OpAccessChain %_ptr_Function_uint %v3u %117
-               OpStore %118 %uint_1 None
-        %119 = OpLoad %int %i_0 None
-        %120 = OpBitcast %uint %119
-        %121 = OpExtInst %uint %73 UMin %120 %uint_3
-        %122 = OpAccessChain %_ptr_Function_uint %v4u %121
-               OpStore %122 %uint_1 None
-        %123 = OpLoad %int %i_0 None
-        %124 = OpBitcast %uint %123
-        %125 = OpExtInst %uint %73 UMin %124 %uint_2
-        %126 = OpAccessChain %_ptr_Function_bool %v3b %125
-               OpStore %126 %true None
-        %127 = OpLoad %int %i_0 None
-        %128 = OpBitcast %uint %127
-        %129 = OpExtInst %uint %73 UMin %128 %uint_3
-        %130 = OpAccessChain %_ptr_Function_bool %v4b %129
-               OpStore %130 %true None
+         %99 = OpExtInst %uint %68 UMin %98 %uint_2
+        %100 = OpAccessChain %_ptr_Function_bool %v3b %99
+               OpStore %100 %true None
+        %103 = OpLoad %int %i None
+        %104 = OpBitcast %uint %103
+        %105 = OpExtInst %uint %68 UMin %104 %uint_3
+        %106 = OpAccessChain %_ptr_Function_bool %v4b %105
+               OpStore %106 %true None
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/bug/tint/1081.wgsl.expected.spvasm b/test/tint/bug/tint/1081.wgsl.expected.spvasm
index 2ba58bc..12e82bb 100644
--- a/test/tint/bug/tint/1081.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1081.wgsl.expected.spvasm
@@ -42,8 +42,8 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %36 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %40 = OpConstantNull %v2uint
+         %41 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %45 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_0 = OpConstant %int 0
 %_ptr_Function_uint = OpTypePointer Function %uint
@@ -72,53 +72,53 @@
                OpStore %y %24
                OpBranch %27
          %27 = OpLabel
-               OpStore %tint_loop_idx %36
+               OpStore %tint_loop_idx %41
                OpBranch %30
          %30 = OpLabel
                OpLoopMerge %31 %29 None
                OpBranch %28
          %28 = OpLabel
-         %38 = OpLoad %v2uint %tint_loop_idx None
-         %39 = OpIEqual %v2bool %38 %40
-         %42 = OpAll %bool %39
-               OpSelectionMerge %43 None
-               OpBranchConditional %42 %44 %43
-         %44 = OpLabel
-               OpBranch %31
-         %43 = OpLabel
-         %45 = OpLoad %int %y None
-          %r = OpFunctionCall %int %f %45
-         %47 = OpIEqual %bool %r %int_0
-               OpSelectionMerge %49 None
-               OpBranchConditional %47 %50 %49
-         %50 = OpLabel
-               OpBranch %31
+         %43 = OpLoad %v2uint %tint_loop_idx None
+         %44 = OpIEqual %v2bool %43 %45
+         %47 = OpAll %bool %44
+               OpSelectionMerge %48 None
+               OpBranchConditional %47 %49 %48
          %49 = OpLabel
+               OpBranch %31
+         %48 = OpLabel
+         %50 = OpLoad %int %y None
+          %r = OpFunctionCall %int %f %50
+         %52 = OpIEqual %bool %r %int_0
+               OpSelectionMerge %54 None
+               OpBranchConditional %52 %55 %54
+         %55 = OpLabel
+               OpBranch %31
+         %54 = OpLabel
                OpBranch %29
          %29 = OpLabel
-         %51 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %54 = OpLoad %uint %51 None
-%tint_low_inc = OpISub %uint %54 %uint_1
-         %57 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %57 %tint_low_inc None
-         %58 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %58 %uint_1 %uint_0
-         %60 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %61 = OpLoad %uint %60 None
-         %62 = OpISub %uint %61 %tint_carry
-         %63 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %63 %62 None
+         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %59 = OpLoad %uint %56 None
+%tint_low_inc = OpISub %uint %59 %uint_1
+         %62 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %62 %tint_low_inc None
+         %63 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %63 %uint_1 %uint_0
+         %65 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %66 = OpLoad %uint %65 None
+         %67 = OpISub %uint %66 %tint_carry
+         %68 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %68 %67 None
                OpBranch %30
          %31 = OpLabel
-         %64 = OpLoad %int %y None
-         %65 = OpLoad %bool %continue_execution None
-         %66 = OpLogicalNot %bool %65
-               OpSelectionMerge %67 None
-               OpBranchConditional %66 %68 %67
-         %68 = OpLabel
+         %32 = OpLoad %int %y None
+         %33 = OpLoad %bool %continue_execution None
+         %34 = OpLogicalNot %bool %33
+               OpSelectionMerge %35 None
+               OpBranchConditional %34 %36 %35
+         %36 = OpLabel
                OpKill
-         %67 = OpLabel
-               OpReturnValue %64
+         %35 = OpLabel
+               OpReturnValue %32
                OpFunctionEnd
        %main = OpFunction %void None %71
          %72 = OpLabel
diff --git a/test/tint/bug/tint/1113.wgsl.expected.spvasm b/test/tint/bug/tint/1113.wgsl.expected.spvasm
index 64169b0..c7977c4 100644
--- a/test/tint/bug/tint/1113.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1113.wgsl.expected.spvasm
@@ -789,21 +789,21 @@
                OpSelectionMerge %125 None
                OpBranchConditional %124 %126 %125
         %126 = OpLabel
-        %127 = OpAccessChain %_ptr_StorageBuffer_uint_0 %25 %uint_0 %uint_0
-        %128 = OpLoad %uint %numTriangles None
-        %129 = OpAtomicIAdd %uint %127 %uint_1 %uint_0 %128
-        %130 = OpBitcast %int %129
-               OpStore %offset %130 None
+        %135 = OpAccessChain %_ptr_StorageBuffer_uint_0 %25 %uint_0 %uint_0
+        %136 = OpLoad %uint %numTriangles None
+        %137 = OpAtomicIAdd %uint %135 %uint_1 %uint_0 %136
+        %138 = OpBitcast %int %137
+               OpStore %offset %138 None
                OpBranch %125
         %125 = OpLabel
-        %131 = OpLoad %uint %voxelIndex None
-        %132 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %LUT %uint_0
-        %133 = OpArrayLength %uint %LUT 0
-        %134 = OpISub %uint %133 %uint_1
-        %135 = OpExtInst %uint %55 UMin %131 %134
-        %136 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %135
-        %137 = OpLoad %int %offset None
-               OpAtomicStore %136 %uint_1 %uint_0 %137
+        %127 = OpLoad %uint %voxelIndex None
+        %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_int %LUT %uint_0
+        %129 = OpArrayLength %uint %LUT 0
+        %130 = OpISub %uint %129 %uint_1
+        %131 = OpExtInst %uint %55 UMin %127 %130
+        %132 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %131
+        %133 = OpLoad %int %offset None
+               OpAtomicStore %132 %uint_1 %uint_0 %133
                OpReturn
                OpFunctionEnd
 %main_create_lut = OpFunction %void None %34
diff --git a/test/tint/bug/tint/1118.wgsl.expected.spvasm b/test/tint/bug/tint/1118.wgsl.expected.spvasm
index 50b78ee..800714f 100644
--- a/test/tint/bug/tint/1118.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1118.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 191
 ; Schema: 0
                OpCapability Shader
-         %80 = OpExtInstImport "GLSL.std.450"
+         %79 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Fragment %main "main" %main_loc2_Input %main_loc3_Input %main_loc0_Output
                OpExecutionMode %main OriginUpperLeft
@@ -151,18 +151,18 @@
 %_ptr_Function_v2float = OpTypePointer Function %v2float
          %48 = OpConstantNull %v2float
     %float_0 = OpConstant %float 0
-      %false = OpConstantFalse %bool
 %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
        %uint = OpTypeInt 32 0
      %uint_0 = OpConstant %uint 0
     %float_1 = OpConstant %float 1
-         %81 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %80 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Uniform_float = OpTypePointer Uniform %float
      %uint_3 = OpConstant %uint 3
-        %110 = OpConstantComposite %v3float %float_1 %float_1 %float_1
-        %111 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
+        %109 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+        %110 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
      %uint_1 = OpConstant %uint 1
+      %false = OpConstantFalse %bool
    %main_out = OpTypeStruct %v4float
         %176 = OpTypeFunction %main_out %float %float
      %main_1 = OpFunction %void None %34
@@ -192,121 +192,121 @@
                OpBranch %62
          %62 = OpLabel
        %x_17 = OpLoad %float %fClipDistance4 None
-         %66 = OpFOrdGreaterThan %bool %x_17 %float_0
-               OpSelectionMerge %67 None
-               OpBranchConditional %66 %68 %67
-         %68 = OpLabel
-               OpStore %continue_execution %false None
-               OpBranch %67
+         %65 = OpFOrdGreaterThan %bool %x_17 %float_0
+               OpSelectionMerge %66 None
+               OpBranchConditional %65 %67 %66
          %67 = OpLabel
-         %69 = OpAccessChain %_ptr_Uniform_v4float %6 %uint_0 %uint_0
-       %x_34 = OpLoad %v4float %69 None
-         %74 = OpCompositeExtract %float %x_34 0
-         %75 = OpCompositeExtract %float %x_34 1
-         %76 = OpCompositeExtract %float %x_34 2
-         %77 = OpCompositeConstruct %v3float %74 %75 %76
-         %78 = OpFSub %v3float %77 %x_38
-         %79 = OpExtInst %v3float %80 Normalize %78
-               OpStore %viewDirectionW %79 None
-               OpStore %baseColor %81 None
-         %83 = OpAccessChain %_ptr_Uniform_v4float %11 %uint_0 %uint_0
-       %x_52 = OpLoad %v4float %83 None
-         %85 = OpCompositeExtract %float %x_52 0
-         %86 = OpCompositeExtract %float %x_52 1
-         %87 = OpCompositeExtract %float %x_52 2
-         %88 = OpCompositeConstruct %v3float %85 %86 %87
-               OpStore %diffuseColor %88 None
-         %89 = OpAccessChain %_ptr_Uniform_v4float %11 %uint_0 %uint_0
-         %90 = OpAccessChain %_ptr_Uniform_float %89 %uint_3
-       %x_60 = OpLoad %float %90 None
+               OpStore %continue_execution %false None
+               OpBranch %66
+         %66 = OpLabel
+         %68 = OpAccessChain %_ptr_Uniform_v4float %6 %uint_0 %uint_0
+       %x_34 = OpLoad %v4float %68 None
+         %73 = OpCompositeExtract %float %x_34 0
+         %74 = OpCompositeExtract %float %x_34 1
+         %75 = OpCompositeExtract %float %x_34 2
+         %76 = OpCompositeConstruct %v3float %73 %74 %75
+         %77 = OpFSub %v3float %76 %x_38
+         %78 = OpExtInst %v3float %79 Normalize %77
+               OpStore %viewDirectionW %78 None
+               OpStore %baseColor %80 None
+         %82 = OpAccessChain %_ptr_Uniform_v4float %11 %uint_0 %uint_0
+       %x_52 = OpLoad %v4float %82 None
+         %84 = OpCompositeExtract %float %x_52 0
+         %85 = OpCompositeExtract %float %x_52 1
+         %86 = OpCompositeExtract %float %x_52 2
+         %87 = OpCompositeConstruct %v3float %84 %85 %86
+               OpStore %diffuseColor %87 None
+         %88 = OpAccessChain %_ptr_Uniform_v4float %11 %uint_0 %uint_0
+         %89 = OpAccessChain %_ptr_Uniform_float %88 %uint_3
+       %x_60 = OpLoad %float %89 None
                OpStore %alpha %x_60 None
                OpStore %uvOffset %48 None
        %x_76 = OpLoad %v4float %baseColor None
-         %95 = OpCompositeExtract %float %x_76 0
-         %96 = OpCompositeExtract %float %x_76 1
-         %97 = OpCompositeExtract %float %x_76 2
-         %98 = OpCompositeConstruct %v3float %95 %96 %97
-         %99 = OpCompositeExtract %float %x_74 0
-        %100 = OpCompositeExtract %float %x_74 1
-        %101 = OpCompositeExtract %float %x_74 2
-        %102 = OpCompositeConstruct %v3float %99 %100 %101
-       %x_78 = OpFMul %v3float %98 %102
+         %94 = OpCompositeExtract %float %x_76 0
+         %95 = OpCompositeExtract %float %x_76 1
+         %96 = OpCompositeExtract %float %x_76 2
+         %97 = OpCompositeConstruct %v3float %94 %95 %96
+         %98 = OpCompositeExtract %float %x_74 0
+         %99 = OpCompositeExtract %float %x_74 1
+        %100 = OpCompositeExtract %float %x_74 2
+        %101 = OpCompositeConstruct %v3float %98 %99 %100
+       %x_78 = OpFMul %v3float %97 %101
        %x_79 = OpLoad %v4float %baseColor None
-        %105 = OpCompositeExtract %float %x_78 0
-        %106 = OpCompositeExtract %float %x_78 1
-        %107 = OpCompositeExtract %float %x_78 2
-        %108 = OpCompositeExtract %float %x_79 3
-        %109 = OpCompositeConstruct %v4float %105 %106 %107 %108
-               OpStore %baseColor %109 None
-               OpStore %baseAmbientColor %110 None
+        %104 = OpCompositeExtract %float %x_78 0
+        %105 = OpCompositeExtract %float %x_78 1
+        %106 = OpCompositeExtract %float %x_78 2
+        %107 = OpCompositeExtract %float %x_79 3
+        %108 = OpCompositeConstruct %v4float %104 %105 %106 %107
+               OpStore %baseColor %108 None
+               OpStore %baseAmbientColor %109 None
                OpStore %glossiness %float_0 None
                OpStore %diffuseBase %x_38 None
                OpStore %shadow %float_1 None
-               OpStore %refractionColor %111 None
-               OpStore %reflectionColor %111 None
-        %112 = OpAccessChain %_ptr_Uniform_v3float %11 %uint_0 %uint_3
-       %x_94 = OpLoad %v3float %112 None
+               OpStore %refractionColor %110 None
+               OpStore %reflectionColor %110 None
+        %111 = OpAccessChain %_ptr_Uniform_v3float %11 %uint_0 %uint_3
+       %x_94 = OpLoad %v3float %111 None
                OpStore %emissiveColor %x_94 None
        %x_96 = OpLoad %v3float %diffuseBase None
        %x_97 = OpLoad %v3float %diffuseColor None
        %x_99 = OpLoad %v3float %emissiveColor None
-        %118 = OpAccessChain %_ptr_Uniform_v3float %11 %uint_0 %uint_1
-      %x_103 = OpLoad %v3float %118 None
+        %117 = OpAccessChain %_ptr_Uniform_v3float %11 %uint_0 %uint_1
+      %x_103 = OpLoad %v3float %117 None
       %x_108 = OpLoad %v4float %baseColor None
-        %122 = OpFMul %v3float %x_96 %x_97
-        %123 = OpFAdd %v3float %122 %x_99
-        %124 = OpFAdd %v3float %123 %x_103
-        %125 = OpExtInst %v3float %80 NClamp %124 %x_38 %110
-        %126 = OpCompositeExtract %float %x_108 0
-        %127 = OpCompositeExtract %float %x_108 1
-        %128 = OpCompositeExtract %float %x_108 2
-        %129 = OpCompositeConstruct %v3float %126 %127 %128
-        %130 = OpFMul %v3float %125 %129
-               OpStore %finalDiffuse %130 None
+        %121 = OpFMul %v3float %x_96 %x_97
+        %122 = OpFAdd %v3float %121 %x_99
+        %123 = OpFAdd %v3float %122 %x_103
+        %124 = OpExtInst %v3float %79 NClamp %123 %x_38 %109
+        %125 = OpCompositeExtract %float %x_108 0
+        %126 = OpCompositeExtract %float %x_108 1
+        %127 = OpCompositeExtract %float %x_108 2
+        %128 = OpCompositeConstruct %v3float %125 %126 %127
+        %129 = OpFMul %v3float %124 %128
+               OpStore %finalDiffuse %129 None
                OpStore %finalSpecular %x_38 None
       %x_113 = OpLoad %v3float %finalDiffuse None
       %x_114 = OpLoad %v3float %baseAmbientColor None
       %x_116 = OpLoad %v3float %finalSpecular None
       %x_118 = OpLoad %v4float %reflectionColor None
       %x_121 = OpLoad %v4float %refractionColor None
-        %136 = OpFMul %v3float %x_113 %x_114
-        %137 = OpFAdd %v3float %136 %x_116
-        %138 = OpCompositeExtract %float %x_118 0
-        %139 = OpCompositeExtract %float %x_118 1
-        %140 = OpCompositeExtract %float %x_118 2
-        %141 = OpCompositeConstruct %v3float %138 %139 %140
-        %142 = OpFAdd %v3float %137 %141
-        %143 = OpCompositeExtract %float %x_121 0
-        %144 = OpCompositeExtract %float %x_121 1
-        %145 = OpCompositeExtract %float %x_121 2
-        %146 = OpCompositeConstruct %v3float %143 %144 %145
-      %x_123 = OpFAdd %v3float %142 %146
+        %135 = OpFMul %v3float %x_113 %x_114
+        %136 = OpFAdd %v3float %135 %x_116
+        %137 = OpCompositeExtract %float %x_118 0
+        %138 = OpCompositeExtract %float %x_118 1
+        %139 = OpCompositeExtract %float %x_118 2
+        %140 = OpCompositeConstruct %v3float %137 %138 %139
+        %141 = OpFAdd %v3float %136 %140
+        %142 = OpCompositeExtract %float %x_121 0
+        %143 = OpCompositeExtract %float %x_121 1
+        %144 = OpCompositeExtract %float %x_121 2
+        %145 = OpCompositeConstruct %v3float %142 %143 %144
+      %x_123 = OpFAdd %v3float %141 %145
       %x_124 = OpLoad %float %alpha None
-        %149 = OpCompositeExtract %float %x_123 0
-        %150 = OpCompositeExtract %float %x_123 1
-        %151 = OpCompositeExtract %float %x_123 2
-        %152 = OpCompositeConstruct %v4float %149 %150 %151 %x_124
-               OpStore %color %152 None
+        %148 = OpCompositeExtract %float %x_123 0
+        %149 = OpCompositeExtract %float %x_123 1
+        %150 = OpCompositeExtract %float %x_123 2
+        %151 = OpCompositeConstruct %v4float %148 %149 %150 %x_124
+               OpStore %color %151 None
       %x_129 = OpLoad %v4float %color None
-        %154 = OpCompositeExtract %float %x_129 0
-        %155 = OpCompositeExtract %float %x_129 1
-        %156 = OpCompositeExtract %float %x_129 2
-        %157 = OpCompositeConstruct %v3float %154 %155 %156
-      %x_132 = OpExtInst %v3float %80 FMax %157 %x_38
+        %153 = OpCompositeExtract %float %x_129 0
+        %154 = OpCompositeExtract %float %x_129 1
+        %155 = OpCompositeExtract %float %x_129 2
+        %156 = OpCompositeConstruct %v3float %153 %154 %155
+      %x_132 = OpExtInst %v3float %79 FMax %156 %x_38
       %x_133 = OpLoad %v4float %color None
-        %160 = OpCompositeExtract %float %x_132 0
-        %161 = OpCompositeExtract %float %x_132 1
-        %162 = OpCompositeExtract %float %x_132 2
-        %163 = OpCompositeExtract %float %x_133 3
-        %164 = OpCompositeConstruct %v4float %160 %161 %162 %163
-               OpStore %color %164 None
-        %165 = OpAccessChain %_ptr_Uniform_float %16 %uint_0 %uint_0
-      %x_140 = OpLoad %float %165 None
-        %167 = OpAccessChain %_ptr_Function_float %color %uint_3
-      %x_142 = OpLoad %float %167 None
-        %169 = OpFMul %float %x_142 %x_140
-        %170 = OpAccessChain %_ptr_Function_float %color %uint_3
-               OpStore %170 %169 None
+        %159 = OpCompositeExtract %float %x_132 0
+        %160 = OpCompositeExtract %float %x_132 1
+        %161 = OpCompositeExtract %float %x_132 2
+        %162 = OpCompositeExtract %float %x_133 3
+        %163 = OpCompositeConstruct %v4float %159 %160 %161 %162
+               OpStore %color %163 None
+        %164 = OpAccessChain %_ptr_Uniform_float %16 %uint_0 %uint_0
+      %x_140 = OpLoad %float %164 None
+        %166 = OpAccessChain %_ptr_Function_float %color %uint_3
+      %x_142 = OpLoad %float %166 None
+        %168 = OpFMul %float %x_142 %x_140
+        %169 = OpAccessChain %_ptr_Function_float %color %uint_3
+               OpStore %169 %168 None
       %x_147 = OpLoad %v4float %color None
                OpStore %glFragColor %x_147 None
                OpReturn
diff --git a/test/tint/bug/tint/1121.wgsl.expected.spvasm b/test/tint/bug/tint/1121.wgsl.expected.spvasm
index ea52607..08b7211 100644
--- a/test/tint/bug/tint/1121.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1121.wgsl.expected.spvasm
@@ -169,25 +169,25 @@
      %uint_6 = OpConstant %uint 6
 %_arr_v4float_uint_6 = OpTypeArray %v4float %uint_6
 %_ptr_Function__arr_v4float_uint_6 = OpTypePointer Function %_arr_v4float_uint_6
-        %181 = OpConstantNull %_arr_v4float_uint_6
+        %171 = OpConstantNull %_arr_v4float_uint_6
      %uint_5 = OpConstant %uint 5
         %int = OpTypeInt 32 1
   %TILE_SIZE = OpConstant %int 16
 %TILE_COUNT_X = OpConstant %int 2
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
+      %int_1 = OpConstant %int 1
       %v2int = OpTypeVector %int 2
 %_ptr_Function_v2int = OpTypePointer Function %v2int
     %v2float = OpTypeVector %float 2
     %float_2 = OpConstant %float 2
-        %233 = OpConstantComposite %v2float %float_1 %float_1
+        %236 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-        %349 = OpConstantNull %v4float
+        %358 = OpConstantNull %v4float
        %true = OpConstantTrue %bool
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
     %uint_63 = OpConstant %uint 63
 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
-      %int_1 = OpConstant %int 1
         %456 = OpTypeFunction %void
  %main_inner = OpFunction %void None %34
 %GlobalInvocationID = OpFunctionParameter %v3uint
@@ -200,7 +200,7 @@
 %lightRadius = OpVariable %_ptr_Function_float Function
      %boxMin = OpVariable %_ptr_Function_v4float Function
      %boxMax = OpVariable %_ptr_Function_v4float Function
-%frustumPlanes = OpVariable %_ptr_Function__arr_v4float_uint_6 Function %181
+%frustumPlanes = OpVariable %_ptr_Function__arr_v4float_uint_6 Function %171
           %y = OpVariable %_ptr_Function_int Function
           %x = OpVariable %_ptr_Function_int Function
 %tilePixel0Idx = OpVariable %_ptr_Function_v2int Function
@@ -210,7 +210,7 @@
 %viewCeilCoord = OpVariable %_ptr_Function_v2float Function
          %dp = OpVariable %_ptr_Function_float Function
           %i = OpVariable %_ptr_Function_uint Function
-          %p = OpVariable %_ptr_Function_v4float Function %349
+          %p = OpVariable %_ptr_Function_v4float Function %358
      %tileId = OpVariable %_ptr_Function_uint Function
      %offset = OpVariable %_ptr_Function_uint Function
          %36 = OpCompositeExtract %uint %GlobalInvocationID 0
@@ -266,104 +266,104 @@
                OpSelectionMerge %96 None
                OpBranchConditional %95 %97 %96
          %97 = OpLabel
-         %98 = OpLoad %uint %index None
-         %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
-        %100 = OpArrayLength %uint %lightsBuffer 0
-        %101 = OpISub %uint %100 %uint_1
-        %102 = OpExtInst %uint %55 UMin %98 %101
-        %103 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %102 %uint_0
-        %104 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_1
-        %105 = OpAccessChain %_ptr_Uniform_float %104 %uint_1
-        %106 = OpLoad %float %105 None
-        %107 = OpAccessChain %_ptr_StorageBuffer_float %103 %uint_1
-               OpStore %107 %106 None
+        %188 = OpLoad %uint %index None
+        %189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
+        %190 = OpArrayLength %uint %lightsBuffer 0
+        %191 = OpISub %uint %190 %uint_1
+        %192 = OpExtInst %uint %55 UMin %188 %191
+        %193 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %192 %uint_0
+        %194 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_1
+        %195 = OpAccessChain %_ptr_Uniform_float %194 %uint_1
+        %196 = OpLoad %float %195 None
+        %197 = OpAccessChain %_ptr_StorageBuffer_float %193 %uint_1
+               OpStore %197 %196 None
                OpBranch %96
          %96 = OpLabel
-        %108 = OpAccessChain %_ptr_Uniform_mat4v4float %23 %uint_0 %uint_3
-        %111 = OpLoad %mat4v4float %108 None
-               OpStore %M %111
-        %114 = OpAccessChain %_ptr_Function_v4float %M %uint_3
-        %116 = OpAccessChain %_ptr_Function_float %114 %uint_2
-        %119 = OpLoad %float %116 None
-        %120 = OpFNegate %float %119
-        %121 = OpAccessChain %_ptr_Function_v4float %M %uint_2
-        %122 = OpAccessChain %_ptr_Function_float %121 %uint_2
-        %123 = OpLoad %float %122 None
-        %124 = OpFAdd %float %float_n1 %123
-        %126 = OpFDiv %float %120 %124
-               OpStore %viewNear %126
-        %128 = OpAccessChain %_ptr_Function_v4float %M %uint_3
-        %129 = OpAccessChain %_ptr_Function_float %128 %uint_2
-        %130 = OpLoad %float %129 None
-        %131 = OpFNegate %float %130
-        %132 = OpAccessChain %_ptr_Function_v4float %M %uint_2
-        %133 = OpAccessChain %_ptr_Function_float %132 %uint_2
-        %134 = OpLoad %float %133 None
-        %135 = OpFAdd %float %float_1 %134
-        %137 = OpFDiv %float %131 %135
-               OpStore %viewFar %137
-        %139 = OpLoad %uint %index None
-        %140 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
-        %141 = OpArrayLength %uint %lightsBuffer 0
-        %142 = OpISub %uint %141 %uint_1
-        %143 = OpExtInst %uint %55 UMin %139 %142
-        %144 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %143 %uint_0
-        %145 = OpLoad %v4float %144 None
-               OpStore %lightPos %145
-        %147 = OpAccessChain %_ptr_Uniform_mat4v4float %23 %uint_0 %uint_2
-        %148 = OpLoad %mat4v4float %147 None
-        %149 = OpLoad %v4float %lightPos None
-        %150 = OpMatrixTimesVector %v4float %148 %149
-               OpStore %lightPos %150 None
-        %151 = OpLoad %v4float %lightPos None
-        %152 = OpAccessChain %_ptr_Function_float %lightPos %uint_3
-        %153 = OpLoad %float %152 None
-        %154 = OpCompositeConstruct %v4float %153 %153 %153 %153
-        %155 = OpFDiv %v4float %151 %154
-               OpStore %lightPos %155 None
-        %156 = OpLoad %uint %index None
-        %157 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
-        %158 = OpArrayLength %uint %lightsBuffer 0
-        %159 = OpISub %uint %158 %uint_1
-        %160 = OpExtInst %uint %55 UMin %156 %159
-        %161 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %160 %uint_2
-        %162 = OpLoad %float %161 None
-               OpStore %lightRadius %162
-        %164 = OpLoad %v4float %lightPos None
-        %165 = OpLoad %float %lightRadius None
-        %166 = OpCompositeConstruct %v3float %165 %165 %165
-        %167 = OpCompositeConstruct %v4float %166 %float_0
-        %169 = OpFSub %v4float %164 %167
-               OpStore %boxMin %169
-        %171 = OpLoad %v4float %lightPos None
-        %172 = OpLoad %float %lightRadius None
-        %173 = OpCompositeConstruct %v3float %172 %172 %172
-        %174 = OpCompositeConstruct %v4float %173 %float_0
-        %175 = OpFAdd %v4float %171 %174
-               OpStore %boxMax %175
-        %182 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_4
-        %183 = OpLoad %float %viewNear None
-        %184 = OpCompositeConstruct %v4float %float_0 %float_0 %float_n1 %183
-               OpStore %182 %184 None
-        %185 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_5
-        %187 = OpLoad %float %viewFar None
-        %188 = OpFNegate %float %187
-        %189 = OpCompositeConstruct %v4float %float_0 %float_0 %float_1 %188
-               OpStore %185 %189 None
-               OpBranch %193
-        %193 = OpLabel
+         %98 = OpAccessChain %_ptr_Uniform_mat4v4float %23 %uint_0 %uint_3
+        %101 = OpLoad %mat4v4float %98 None
+               OpStore %M %101
+        %104 = OpAccessChain %_ptr_Function_v4float %M %uint_3
+        %106 = OpAccessChain %_ptr_Function_float %104 %uint_2
+        %109 = OpLoad %float %106 None
+        %110 = OpFNegate %float %109
+        %111 = OpAccessChain %_ptr_Function_v4float %M %uint_2
+        %112 = OpAccessChain %_ptr_Function_float %111 %uint_2
+        %113 = OpLoad %float %112 None
+        %114 = OpFAdd %float %float_n1 %113
+        %116 = OpFDiv %float %110 %114
+               OpStore %viewNear %116
+        %118 = OpAccessChain %_ptr_Function_v4float %M %uint_3
+        %119 = OpAccessChain %_ptr_Function_float %118 %uint_2
+        %120 = OpLoad %float %119 None
+        %121 = OpFNegate %float %120
+        %122 = OpAccessChain %_ptr_Function_v4float %M %uint_2
+        %123 = OpAccessChain %_ptr_Function_float %122 %uint_2
+        %124 = OpLoad %float %123 None
+        %125 = OpFAdd %float %float_1 %124
+        %127 = OpFDiv %float %121 %125
+               OpStore %viewFar %127
+        %129 = OpLoad %uint %index None
+        %130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
+        %131 = OpArrayLength %uint %lightsBuffer 0
+        %132 = OpISub %uint %131 %uint_1
+        %133 = OpExtInst %uint %55 UMin %129 %132
+        %134 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %133 %uint_0
+        %135 = OpLoad %v4float %134 None
+               OpStore %lightPos %135
+        %137 = OpAccessChain %_ptr_Uniform_mat4v4float %23 %uint_0 %uint_2
+        %138 = OpLoad %mat4v4float %137 None
+        %139 = OpLoad %v4float %lightPos None
+        %140 = OpMatrixTimesVector %v4float %138 %139
+               OpStore %lightPos %140 None
+        %141 = OpLoad %v4float %lightPos None
+        %142 = OpAccessChain %_ptr_Function_float %lightPos %uint_3
+        %143 = OpLoad %float %142 None
+        %144 = OpCompositeConstruct %v4float %143 %143 %143 %143
+        %145 = OpFDiv %v4float %141 %144
+               OpStore %lightPos %145 None
+        %146 = OpLoad %uint %index None
+        %147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
+        %148 = OpArrayLength %uint %lightsBuffer 0
+        %149 = OpISub %uint %148 %uint_1
+        %150 = OpExtInst %uint %55 UMin %146 %149
+        %151 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %150 %uint_2
+        %152 = OpLoad %float %151 None
+               OpStore %lightRadius %152
+        %154 = OpLoad %v4float %lightPos None
+        %155 = OpLoad %float %lightRadius None
+        %156 = OpCompositeConstruct %v3float %155 %155 %155
+        %157 = OpCompositeConstruct %v4float %156 %float_0
+        %159 = OpFSub %v4float %154 %157
+               OpStore %boxMin %159
+        %161 = OpLoad %v4float %lightPos None
+        %162 = OpLoad %float %lightRadius None
+        %163 = OpCompositeConstruct %v3float %162 %162 %162
+        %164 = OpCompositeConstruct %v4float %163 %float_0
+        %165 = OpFAdd %v4float %161 %164
+               OpStore %boxMax %165
+        %172 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_4
+        %173 = OpLoad %float %viewNear None
+        %174 = OpCompositeConstruct %v4float %float_0 %float_0 %float_n1 %173
+               OpStore %172 %174 None
+        %175 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_5
+        %177 = OpLoad %float %viewFar None
+        %178 = OpFNegate %float %177
+        %179 = OpCompositeConstruct %v4float %float_0 %float_0 %float_1 %178
+               OpStore %175 %179 None
+               OpBranch %183
+        %183 = OpLabel
                OpStore %y %int_0
-               OpBranch %196
-        %196 = OpLabel
-               OpLoopMerge %197 %195 None
-               OpBranch %194
-        %194 = OpLabel
+               OpBranch %186
+        %186 = OpLabel
+               OpLoopMerge %187 %185 None
+               OpBranch %184
+        %184 = OpLabel
         %201 = OpLoad %int %y None
         %202 = OpSLessThan %bool %201 %TILE_COUNT_X
                OpSelectionMerge %203 None
                OpBranchConditional %202 %203 %204
         %204 = OpLabel
-               OpBranch %197
+               OpBranch %187
         %203 = OpLabel
                OpBranch %205
         %205 = OpLabel
@@ -373,298 +373,298 @@
                OpLoopMerge %209 %207 None
                OpBranch %206
         %206 = OpLabel
-        %211 = OpLoad %int %x None
-        %212 = OpSLessThan %bool %211 %TILE_COUNT_X
-               OpSelectionMerge %213 None
-               OpBranchConditional %212 %213 %214
-        %214 = OpLabel
+        %214 = OpLoad %int %x None
+        %215 = OpSLessThan %bool %214 %TILE_COUNT_X
+               OpSelectionMerge %216 None
+               OpBranchConditional %215 %216 %217
+        %217 = OpLabel
                OpBranch %209
-        %213 = OpLabel
-        %215 = OpLoad %int %x None
-        %216 = OpIMul %int %215 %TILE_SIZE
-        %217 = OpLoad %int %y None
-        %218 = OpIMul %int %217 %TILE_SIZE
-        %220 = OpCompositeConstruct %v2int %216 %218
-               OpStore %tilePixel0Idx %220
-        %223 = OpLoad %v2int %tilePixel0Idx None
-        %225 = OpConvertSToF %v2float %223
-        %226 = OpVectorTimesScalar %v2float %225 %float_2
-        %228 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_4
-        %229 = OpLoad %v4float %228 None
-        %230 = OpVectorShuffle %v2float %229 %229 0 1
-        %231 = OpFDiv %v2float %226 %230
-        %232 = OpFSub %v2float %231 %233
-               OpStore %floorCoord %232
-        %236 = OpLoad %v2int %tilePixel0Idx None
-        %237 = OpCompositeConstruct %v2int %TILE_SIZE %TILE_SIZE
-        %238 = OpIAdd %v2int %236 %237
-        %239 = OpConvertSToF %v2float %238
-        %240 = OpVectorTimesScalar %v2float %239 %float_2
-        %241 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_4
-        %242 = OpLoad %v4float %241 None
-        %243 = OpVectorShuffle %v2float %242 %242 0 1
-        %244 = OpFDiv %v2float %240 %243
-        %245 = OpFSub %v2float %244 %233
-               OpStore %ceilCoord %245
-        %247 = OpLoad %float %viewNear None
-        %248 = OpFNegate %float %247
-        %249 = OpAccessChain %_ptr_Function_float %floorCoord %uint_0
-        %250 = OpLoad %float %249 None
-        %251 = OpFMul %float %248 %250
-        %252 = OpAccessChain %_ptr_Function_v4float %M %uint_2
-        %253 = OpAccessChain %_ptr_Function_float %252 %uint_0
-        %254 = OpLoad %float %253 None
-        %255 = OpLoad %float %viewNear None
-        %256 = OpFMul %float %254 %255
-        %257 = OpFSub %float %251 %256
-        %258 = OpAccessChain %_ptr_Function_v4float %M %uint_0
-        %259 = OpAccessChain %_ptr_Function_float %258 %uint_0
-        %260 = OpLoad %float %259 None
-        %261 = OpFDiv %float %257 %260
-        %262 = OpLoad %float %viewNear None
-        %263 = OpFNegate %float %262
-        %264 = OpAccessChain %_ptr_Function_float %floorCoord %uint_1
-        %265 = OpLoad %float %264 None
-        %266 = OpFMul %float %263 %265
-        %267 = OpAccessChain %_ptr_Function_v4float %M %uint_2
-        %268 = OpAccessChain %_ptr_Function_float %267 %uint_1
-        %269 = OpLoad %float %268 None
-        %270 = OpLoad %float %viewNear None
-        %271 = OpFMul %float %269 %270
-        %272 = OpFSub %float %266 %271
-        %273 = OpAccessChain %_ptr_Function_v4float %M %uint_1
-        %274 = OpAccessChain %_ptr_Function_float %273 %uint_1
-        %275 = OpLoad %float %274 None
-        %276 = OpFDiv %float %272 %275
-        %277 = OpCompositeConstruct %v2float %261 %276
-               OpStore %viewFloorCoord %277
-        %279 = OpLoad %float %viewNear None
-        %280 = OpFNegate %float %279
-        %281 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_0
-        %282 = OpLoad %float %281 None
-        %283 = OpFMul %float %280 %282
-        %284 = OpAccessChain %_ptr_Function_v4float %M %uint_2
-        %285 = OpAccessChain %_ptr_Function_float %284 %uint_0
-        %286 = OpLoad %float %285 None
-        %287 = OpLoad %float %viewNear None
-        %288 = OpFMul %float %286 %287
-        %289 = OpFSub %float %283 %288
-        %290 = OpAccessChain %_ptr_Function_v4float %M %uint_0
-        %291 = OpAccessChain %_ptr_Function_float %290 %uint_0
-        %292 = OpLoad %float %291 None
-        %293 = OpFDiv %float %289 %292
-        %294 = OpLoad %float %viewNear None
-        %295 = OpFNegate %float %294
-        %296 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_1
-        %297 = OpLoad %float %296 None
-        %298 = OpFMul %float %295 %297
-        %299 = OpAccessChain %_ptr_Function_v4float %M %uint_2
-        %300 = OpAccessChain %_ptr_Function_float %299 %uint_1
-        %301 = OpLoad %float %300 None
-        %302 = OpLoad %float %viewNear None
-        %303 = OpFMul %float %301 %302
-        %304 = OpFSub %float %298 %303
-        %305 = OpAccessChain %_ptr_Function_v4float %M %uint_1
-        %306 = OpAccessChain %_ptr_Function_float %305 %uint_1
-        %307 = OpLoad %float %306 None
-        %308 = OpFDiv %float %304 %307
-        %309 = OpCompositeConstruct %v2float %293 %308
-               OpStore %viewCeilCoord %309
-        %311 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_0
-        %312 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_0
-        %313 = OpLoad %float %312 None
-        %314 = OpFNegate %float %313
-        %315 = OpLoad %float %viewNear None
-        %316 = OpFDiv %float %314 %315
-        %317 = OpCompositeConstruct %v4float %float_1 %float_0 %316 %float_0
-               OpStore %311 %317 None
-        %318 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_1
-        %319 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_0
-        %320 = OpLoad %float %319 None
-        %321 = OpLoad %float %viewNear None
-        %322 = OpFDiv %float %320 %321
-        %323 = OpCompositeConstruct %v4float %float_n1 %float_0 %322 %float_0
-               OpStore %318 %323 None
-        %324 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_2
-        %325 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_1
-        %326 = OpLoad %float %325 None
-        %327 = OpFNegate %float %326
-        %328 = OpLoad %float %viewNear None
-        %329 = OpFDiv %float %327 %328
-        %330 = OpCompositeConstruct %v4float %float_0 %float_1 %329 %float_0
-               OpStore %324 %330 None
-        %331 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_3
-        %332 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_1
-        %333 = OpLoad %float %332 None
-        %334 = OpLoad %float %viewNear None
-        %335 = OpFDiv %float %333 %334
-        %336 = OpCompositeConstruct %v4float %float_0 %float_n1 %335 %float_0
-               OpStore %331 %336 None
+        %216 = OpLabel
+        %218 = OpLoad %int %x None
+        %219 = OpIMul %int %218 %TILE_SIZE
+        %220 = OpLoad %int %y None
+        %221 = OpIMul %int %220 %TILE_SIZE
+        %223 = OpCompositeConstruct %v2int %219 %221
+               OpStore %tilePixel0Idx %223
+        %226 = OpLoad %v2int %tilePixel0Idx None
+        %228 = OpConvertSToF %v2float %226
+        %229 = OpVectorTimesScalar %v2float %228 %float_2
+        %231 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_4
+        %232 = OpLoad %v4float %231 None
+        %233 = OpVectorShuffle %v2float %232 %232 0 1
+        %234 = OpFDiv %v2float %229 %233
+        %235 = OpFSub %v2float %234 %236
+               OpStore %floorCoord %235
+        %239 = OpLoad %v2int %tilePixel0Idx None
+        %240 = OpCompositeConstruct %v2int %TILE_SIZE %TILE_SIZE
+        %241 = OpIAdd %v2int %239 %240
+        %242 = OpConvertSToF %v2float %241
+        %243 = OpVectorTimesScalar %v2float %242 %float_2
+        %244 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_4
+        %245 = OpLoad %v4float %244 None
+        %246 = OpVectorShuffle %v2float %245 %245 0 1
+        %247 = OpFDiv %v2float %243 %246
+        %248 = OpFSub %v2float %247 %236
+               OpStore %ceilCoord %248
+        %250 = OpLoad %float %viewNear None
+        %251 = OpFNegate %float %250
+        %252 = OpAccessChain %_ptr_Function_float %floorCoord %uint_0
+        %253 = OpLoad %float %252 None
+        %254 = OpFMul %float %251 %253
+        %255 = OpAccessChain %_ptr_Function_v4float %M %uint_2
+        %256 = OpAccessChain %_ptr_Function_float %255 %uint_0
+        %257 = OpLoad %float %256 None
+        %258 = OpLoad %float %viewNear None
+        %259 = OpFMul %float %257 %258
+        %260 = OpFSub %float %254 %259
+        %261 = OpAccessChain %_ptr_Function_v4float %M %uint_0
+        %262 = OpAccessChain %_ptr_Function_float %261 %uint_0
+        %263 = OpLoad %float %262 None
+        %264 = OpFDiv %float %260 %263
+        %265 = OpLoad %float %viewNear None
+        %266 = OpFNegate %float %265
+        %267 = OpAccessChain %_ptr_Function_float %floorCoord %uint_1
+        %268 = OpLoad %float %267 None
+        %269 = OpFMul %float %266 %268
+        %270 = OpAccessChain %_ptr_Function_v4float %M %uint_2
+        %271 = OpAccessChain %_ptr_Function_float %270 %uint_1
+        %272 = OpLoad %float %271 None
+        %273 = OpLoad %float %viewNear None
+        %274 = OpFMul %float %272 %273
+        %275 = OpFSub %float %269 %274
+        %276 = OpAccessChain %_ptr_Function_v4float %M %uint_1
+        %277 = OpAccessChain %_ptr_Function_float %276 %uint_1
+        %278 = OpLoad %float %277 None
+        %279 = OpFDiv %float %275 %278
+        %280 = OpCompositeConstruct %v2float %264 %279
+               OpStore %viewFloorCoord %280
+        %282 = OpLoad %float %viewNear None
+        %283 = OpFNegate %float %282
+        %284 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_0
+        %285 = OpLoad %float %284 None
+        %286 = OpFMul %float %283 %285
+        %287 = OpAccessChain %_ptr_Function_v4float %M %uint_2
+        %288 = OpAccessChain %_ptr_Function_float %287 %uint_0
+        %289 = OpLoad %float %288 None
+        %290 = OpLoad %float %viewNear None
+        %291 = OpFMul %float %289 %290
+        %292 = OpFSub %float %286 %291
+        %293 = OpAccessChain %_ptr_Function_v4float %M %uint_0
+        %294 = OpAccessChain %_ptr_Function_float %293 %uint_0
+        %295 = OpLoad %float %294 None
+        %296 = OpFDiv %float %292 %295
+        %297 = OpLoad %float %viewNear None
+        %298 = OpFNegate %float %297
+        %299 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_1
+        %300 = OpLoad %float %299 None
+        %301 = OpFMul %float %298 %300
+        %302 = OpAccessChain %_ptr_Function_v4float %M %uint_2
+        %303 = OpAccessChain %_ptr_Function_float %302 %uint_1
+        %304 = OpLoad %float %303 None
+        %305 = OpLoad %float %viewNear None
+        %306 = OpFMul %float %304 %305
+        %307 = OpFSub %float %301 %306
+        %308 = OpAccessChain %_ptr_Function_v4float %M %uint_1
+        %309 = OpAccessChain %_ptr_Function_float %308 %uint_1
+        %310 = OpLoad %float %309 None
+        %311 = OpFDiv %float %307 %310
+        %312 = OpCompositeConstruct %v2float %296 %311
+               OpStore %viewCeilCoord %312
+        %314 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_0
+        %315 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_0
+        %316 = OpLoad %float %315 None
+        %317 = OpFNegate %float %316
+        %318 = OpLoad %float %viewNear None
+        %319 = OpFDiv %float %317 %318
+        %320 = OpCompositeConstruct %v4float %float_1 %float_0 %319 %float_0
+               OpStore %314 %320 None
+        %321 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_1
+        %322 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_0
+        %323 = OpLoad %float %322 None
+        %324 = OpLoad %float %viewNear None
+        %325 = OpFDiv %float %323 %324
+        %326 = OpCompositeConstruct %v4float %float_n1 %float_0 %325 %float_0
+               OpStore %321 %326 None
+        %327 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_2
+        %328 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_1
+        %329 = OpLoad %float %328 None
+        %330 = OpFNegate %float %329
+        %331 = OpLoad %float %viewNear None
+        %332 = OpFDiv %float %330 %331
+        %333 = OpCompositeConstruct %v4float %float_0 %float_1 %332 %float_0
+               OpStore %327 %333 None
+        %334 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_3
+        %335 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_1
+        %336 = OpLoad %float %335 None
+        %337 = OpLoad %float %viewNear None
+        %338 = OpFDiv %float %336 %337
+        %339 = OpCompositeConstruct %v4float %float_0 %float_n1 %338 %float_0
+               OpStore %334 %339 None
                OpStore %dp %float_0
-               OpBranch %338
-        %338 = OpLabel
-               OpStore %i %uint_0
                OpBranch %341
         %341 = OpLabel
-               OpLoopMerge %342 %340 None
-               OpBranch %339
-        %339 = OpLabel
-        %344 = OpLoad %uint %i None
-        %345 = OpULessThan %bool %344 %uint_6
-               OpSelectionMerge %346 None
-               OpBranchConditional %345 %346 %347
-        %347 = OpLabel
+               OpStore %i %uint_0
+               OpBranch %344
+        %344 = OpLabel
+               OpLoopMerge %345 %343 None
                OpBranch %342
-        %346 = OpLabel
-        %350 = OpLoad %uint %i None
-        %351 = OpExtInst %uint %55 UMin %350 %uint_5
-        %352 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %351
-        %353 = OpAccessChain %_ptr_Function_float %352 %uint_0
-        %354 = OpLoad %float %353 None
-        %355 = OpFOrdGreaterThan %bool %354 %float_0
-               OpSelectionMerge %356 None
-               OpBranchConditional %355 %357 %358
-        %357 = OpLabel
-        %359 = OpAccessChain %_ptr_Function_float %boxMax %uint_0
-        %360 = OpLoad %float %359 None
-        %361 = OpAccessChain %_ptr_Function_float %p %uint_0
-               OpStore %361 %360 None
-               OpBranch %356
-        %358 = OpLabel
-        %362 = OpAccessChain %_ptr_Function_float %boxMin %uint_0
-        %363 = OpLoad %float %362 None
-        %364 = OpAccessChain %_ptr_Function_float %p %uint_0
-               OpStore %364 %363 None
-               OpBranch %356
-        %356 = OpLabel
-        %365 = OpLoad %uint %i None
-        %366 = OpExtInst %uint %55 UMin %365 %uint_5
-        %367 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %366
-        %368 = OpAccessChain %_ptr_Function_float %367 %uint_1
-        %369 = OpLoad %float %368 None
-        %370 = OpFOrdGreaterThan %bool %369 %float_0
-               OpSelectionMerge %371 None
-               OpBranchConditional %370 %372 %373
-        %372 = OpLabel
-        %374 = OpAccessChain %_ptr_Function_float %boxMax %uint_1
-        %375 = OpLoad %float %374 None
-        %376 = OpAccessChain %_ptr_Function_float %p %uint_1
-               OpStore %376 %375 None
-               OpBranch %371
-        %373 = OpLabel
-        %377 = OpAccessChain %_ptr_Function_float %boxMin %uint_1
-        %378 = OpLoad %float %377 None
-        %379 = OpAccessChain %_ptr_Function_float %p %uint_1
-               OpStore %379 %378 None
-               OpBranch %371
-        %371 = OpLabel
-        %380 = OpLoad %uint %i None
-        %381 = OpExtInst %uint %55 UMin %380 %uint_5
-        %382 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %381
-        %383 = OpAccessChain %_ptr_Function_float %382 %uint_2
-        %384 = OpLoad %float %383 None
-        %385 = OpFOrdGreaterThan %bool %384 %float_0
-               OpSelectionMerge %386 None
-               OpBranchConditional %385 %387 %388
-        %387 = OpLabel
-        %389 = OpAccessChain %_ptr_Function_float %boxMax %uint_2
-        %390 = OpLoad %float %389 None
-        %391 = OpAccessChain %_ptr_Function_float %p %uint_2
-               OpStore %391 %390 None
-               OpBranch %386
-        %388 = OpLabel
-        %392 = OpAccessChain %_ptr_Function_float %boxMin %uint_2
-        %393 = OpLoad %float %392 None
-        %394 = OpAccessChain %_ptr_Function_float %p %uint_2
-               OpStore %394 %393 None
-               OpBranch %386
-        %386 = OpLabel
-        %395 = OpAccessChain %_ptr_Function_float %p %uint_3
-               OpStore %395 %float_1 None
-        %396 = OpLoad %float %dp None
-        %397 = OpLoad %v4float %p None
-        %398 = OpLoad %uint %i None
-        %399 = OpExtInst %uint %55 UMin %398 %uint_5
-        %400 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %399
-        %401 = OpLoad %v4float %400 None
-        %402 = OpDot %float %397 %401
-        %403 = OpExtInst %float %55 FMin %float_0 %402
-        %404 = OpFAdd %float %396 %403
-               OpStore %dp %404 None
-               OpBranch %340
-        %340 = OpLabel
-        %405 = OpLoad %uint %i None
-        %406 = OpIAdd %uint %405 %uint_1
-               OpStore %i %406 None
-               OpBranch %341
         %342 = OpLabel
-        %407 = OpLoad %float %dp None
-        %408 = OpFOrdGreaterThanEqual %bool %407 %float_0
-               OpSelectionMerge %409 None
-               OpBranchConditional %408 %410 %409
-        %410 = OpLabel
-        %411 = OpLoad %int %x None
-        %412 = OpLoad %int %y None
-        %413 = OpIMul %int %412 %TILE_COUNT_X
-        %414 = OpIAdd %int %411 %413
-        %415 = OpBitcast %uint %414
-               OpStore %tileId %415
-        %417 = OpLoad %uint %tileId None
-        %418 = OpULessThan %bool %417 %uint_0
-               OpSelectionMerge %419 None
-               OpBranchConditional %418 %420 %421
-        %420 = OpLabel
-               OpBranch %419
-        %421 = OpLabel
-        %422 = OpLoad %uint %tileId None
-        %423 = OpAccessChain %_ptr_Uniform_uint %19 %uint_0 %uint_1
-        %424 = OpLoad %uint %423 None
-        %425 = OpUGreaterThanEqual %bool %422 %424
-               OpBranch %419
-        %419 = OpLabel
-        %426 = OpPhi %bool %true %420 %425 %421
-               OpSelectionMerge %428 None
-               OpBranchConditional %426 %429 %428
-        %429 = OpLabel
+        %353 = OpLoad %uint %i None
+        %354 = OpULessThan %bool %353 %uint_6
+               OpSelectionMerge %355 None
+               OpBranchConditional %354 %355 %356
+        %356 = OpLabel
+               OpBranch %345
+        %355 = OpLabel
+        %359 = OpLoad %uint %i None
+        %360 = OpExtInst %uint %55 UMin %359 %uint_5
+        %361 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %360
+        %362 = OpAccessChain %_ptr_Function_float %361 %uint_0
+        %363 = OpLoad %float %362 None
+        %364 = OpFOrdGreaterThan %bool %363 %float_0
+               OpSelectionMerge %365 None
+               OpBranchConditional %364 %366 %367
+        %366 = OpLabel
+        %434 = OpAccessChain %_ptr_Function_float %boxMax %uint_0
+        %435 = OpLoad %float %434 None
+        %436 = OpAccessChain %_ptr_Function_float %p %uint_0
+               OpStore %436 %435 None
+               OpBranch %365
+        %367 = OpLabel
+        %437 = OpAccessChain %_ptr_Function_float %boxMin %uint_0
+        %438 = OpLoad %float %437 None
+        %439 = OpAccessChain %_ptr_Function_float %p %uint_0
+               OpStore %439 %438 None
+               OpBranch %365
+        %365 = OpLabel
+        %368 = OpLoad %uint %i None
+        %369 = OpExtInst %uint %55 UMin %368 %uint_5
+        %370 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %369
+        %371 = OpAccessChain %_ptr_Function_float %370 %uint_1
+        %372 = OpLoad %float %371 None
+        %373 = OpFOrdGreaterThan %bool %372 %float_0
+               OpSelectionMerge %374 None
+               OpBranchConditional %373 %375 %376
+        %375 = OpLabel
+        %440 = OpAccessChain %_ptr_Function_float %boxMax %uint_1
+        %441 = OpLoad %float %440 None
+        %442 = OpAccessChain %_ptr_Function_float %p %uint_1
+               OpStore %442 %441 None
+               OpBranch %374
+        %376 = OpLabel
+        %443 = OpAccessChain %_ptr_Function_float %boxMin %uint_1
+        %444 = OpLoad %float %443 None
+        %445 = OpAccessChain %_ptr_Function_float %p %uint_1
+               OpStore %445 %444 None
+               OpBranch %374
+        %374 = OpLabel
+        %377 = OpLoad %uint %i None
+        %378 = OpExtInst %uint %55 UMin %377 %uint_5
+        %379 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %378
+        %380 = OpAccessChain %_ptr_Function_float %379 %uint_2
+        %381 = OpLoad %float %380 None
+        %382 = OpFOrdGreaterThan %bool %381 %float_0
+               OpSelectionMerge %383 None
+               OpBranchConditional %382 %384 %385
+        %384 = OpLabel
+        %446 = OpAccessChain %_ptr_Function_float %boxMax %uint_2
+        %447 = OpLoad %float %446 None
+        %448 = OpAccessChain %_ptr_Function_float %p %uint_2
+               OpStore %448 %447 None
+               OpBranch %383
+        %385 = OpLabel
+        %449 = OpAccessChain %_ptr_Function_float %boxMin %uint_2
+        %450 = OpLoad %float %449 None
+        %451 = OpAccessChain %_ptr_Function_float %p %uint_2
+               OpStore %451 %450 None
+               OpBranch %383
+        %383 = OpLabel
+        %386 = OpAccessChain %_ptr_Function_float %p %uint_3
+               OpStore %386 %float_1 None
+        %387 = OpLoad %float %dp None
+        %388 = OpLoad %v4float %p None
+        %389 = OpLoad %uint %i None
+        %390 = OpExtInst %uint %55 UMin %389 %uint_5
+        %391 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %390
+        %392 = OpLoad %v4float %391 None
+        %393 = OpDot %float %388 %392
+        %394 = OpExtInst %float %55 FMin %float_0 %393
+        %395 = OpFAdd %float %387 %394
+               OpStore %dp %395 None
+               OpBranch %343
+        %343 = OpLabel
+        %396 = OpLoad %uint %i None
+        %397 = OpIAdd %uint %396 %uint_1
+               OpStore %i %397 None
+               OpBranch %344
+        %345 = OpLabel
+        %346 = OpLoad %float %dp None
+        %347 = OpFOrdGreaterThanEqual %bool %346 %float_0
+               OpSelectionMerge %348 None
+               OpBranchConditional %347 %349 %348
+        %349 = OpLabel
+        %398 = OpLoad %int %x None
+        %399 = OpLoad %int %y None
+        %400 = OpIMul %int %399 %TILE_COUNT_X
+        %401 = OpIAdd %int %398 %400
+        %402 = OpBitcast %uint %401
+               OpStore %tileId %402
+        %404 = OpLoad %uint %tileId None
+        %405 = OpULessThan %bool %404 %uint_0
+               OpSelectionMerge %406 None
+               OpBranchConditional %405 %407 %408
+        %407 = OpLabel
+               OpBranch %406
+        %408 = OpLabel
+        %452 = OpLoad %uint %tileId None
+        %453 = OpAccessChain %_ptr_Uniform_uint %19 %uint_0 %uint_1
+        %454 = OpLoad %uint %453 None
+        %411 = OpUGreaterThanEqual %bool %452 %454
+               OpBranch %406
+        %406 = OpLabel
+        %409 = OpPhi %bool %true %407 %411 %408
+               OpSelectionMerge %412 None
+               OpBranchConditional %409 %413 %412
+        %413 = OpLabel
                OpBranch %207
-        %428 = OpLabel
-        %430 = OpLoad %uint %tileId None
-        %431 = OpExtInst %uint %55 UMin %430 %uint_3
-        %432 = OpAccessChain %_ptr_StorageBuffer_uint %9 %uint_0 %uint_0 %431 %uint_0
-        %434 = OpAtomicIAdd %uint %432 %uint_1 %uint_0 %uint_1
-               OpStore %offset %434
-        %436 = OpLoad %uint %offset None
-        %437 = OpAccessChain %_ptr_Uniform_uint %19 %uint_0 %uint_4
-        %438 = OpLoad %uint %437 None
-        %439 = OpUGreaterThanEqual %bool %436 %438
-               OpSelectionMerge %440 None
-               OpBranchConditional %439 %441 %440
-        %441 = OpLabel
+        %412 = OpLabel
+        %414 = OpLoad %uint %tileId None
+        %415 = OpExtInst %uint %55 UMin %414 %uint_3
+        %416 = OpAccessChain %_ptr_StorageBuffer_uint %9 %uint_0 %uint_0 %415 %uint_0
+        %418 = OpAtomicIAdd %uint %416 %uint_1 %uint_0 %uint_1
+               OpStore %offset %418
+        %420 = OpLoad %uint %offset None
+        %421 = OpAccessChain %_ptr_Uniform_uint %19 %uint_0 %uint_4
+        %422 = OpLoad %uint %421 None
+        %423 = OpUGreaterThanEqual %bool %420 %422
+               OpSelectionMerge %424 None
+               OpBranchConditional %423 %425 %424
+        %425 = OpLabel
                OpBranch %207
-        %440 = OpLabel
-        %442 = OpLoad %uint %tileId None
-        %443 = OpLoad %uint %offset None
-        %444 = OpExtInst %uint %55 UMin %442 %uint_3
-        %445 = OpExtInst %uint %55 UMin %443 %uint_63
-        %447 = OpAccessChain %_ptr_StorageBuffer_uint_0 %9 %uint_0 %uint_0 %444 %uint_1 %445
-        %449 = OpCompositeExtract %uint %GlobalInvocationID 0
-               OpStore %447 %449 None
-               OpBranch %409
-        %409 = OpLabel
+        %424 = OpLabel
+        %426 = OpLoad %uint %tileId None
+        %427 = OpLoad %uint %offset None
+        %428 = OpExtInst %uint %55 UMin %426 %uint_3
+        %429 = OpExtInst %uint %55 UMin %427 %uint_63
+        %431 = OpAccessChain %_ptr_StorageBuffer_uint_0 %9 %uint_0 %uint_0 %428 %uint_1 %429
+        %433 = OpCompositeExtract %uint %GlobalInvocationID 0
+               OpStore %431 %433 None
+               OpBranch %348
+        %348 = OpLabel
                OpBranch %207
         %207 = OpLabel
-        %450 = OpLoad %int %x None
-        %451 = OpIAdd %int %450 %int_1
-               OpStore %x %451 None
+        %350 = OpLoad %int %x None
+        %351 = OpIAdd %int %350 %int_1
+               OpStore %x %351 None
                OpBranch %208
         %209 = OpLabel
-               OpBranch %195
-        %195 = OpLabel
-        %453 = OpLoad %int %y None
-        %454 = OpIAdd %int %453 %int_1
-               OpStore %y %454 None
-               OpBranch %196
-        %197 = OpLabel
+               OpBranch %185
+        %185 = OpLabel
+        %210 = OpLoad %int %y None
+        %211 = OpIAdd %int %210 %int_1
+               OpStore %y %211 None
+               OpBranch %186
+        %187 = OpLabel
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %456
diff --git a/test/tint/bug/tint/1474-a.wgsl.expected.spvasm b/test/tint/bug/tint/1474-a.wgsl.expected.spvasm
index 865f618..4d745b4 100644
--- a/test/tint/bug/tint/1474-a.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1474-a.wgsl.expected.spvasm
@@ -8,71 +8,71 @@
                OpEntryPoint GLCompute %main "main"
                OpExecutionMode %main LocalSize 1 1 1
                OpName %main "main"
+               OpName %x "x"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %tint_low_inc "tint_low_inc"
                OpName %tint_carry "tint_carry"
-               OpName %x "x"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
+        %int = OpTypeInt 32 1
+          %x = OpConstant %int 5
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %14 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %18 = OpConstantNull %v2uint
+         %16 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %20 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
        %true = OpConstantTrue %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
-        %int = OpTypeInt 32 1
-          %x = OpConstant %int 5
        %main = OpFunction %void None %3
           %4 = OpLabel
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
                OpBranch %5
           %5 = OpLabel
-               OpStore %tint_loop_idx %14
+               OpStore %tint_loop_idx %16
                OpBranch %8
           %8 = OpLabel
                OpLoopMerge %9 %7 None
                OpBranch %6
           %6 = OpLabel
-         %16 = OpLoad %v2uint %tint_loop_idx None
-         %17 = OpIEqual %v2bool %16 %18
-         %21 = OpAll %bool %17
-               OpSelectionMerge %22 None
-               OpBranchConditional %21 %23 %22
-         %23 = OpLabel
-               OpBranch %9
-         %22 = OpLabel
+         %18 = OpLoad %v2uint %tint_loop_idx None
+         %19 = OpIEqual %v2bool %18 %20
+         %23 = OpAll %bool %19
                OpSelectionMerge %24 None
-               OpBranchConditional %true %24 %25
+               OpBranchConditional %23 %25 %24
          %25 = OpLabel
                OpBranch %9
          %24 = OpLabel
-               OpSelectionMerge %27 None
-               OpBranchConditional %true %28 %29
-         %28 = OpLabel
-               OpBranch %9
-         %29 = OpLabel
-               OpReturn
+               OpSelectionMerge %26 None
+               OpBranchConditional %true %26 %27
          %27 = OpLabel
+               OpBranch %9
+         %26 = OpLabel
+               OpSelectionMerge %29 None
+               OpBranchConditional %true %30 %31
+         %30 = OpLabel
+               OpBranch %9
+         %31 = OpLabel
+               OpReturn
+         %29 = OpLabel
                OpBranch %7
           %7 = OpLabel
-         %30 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %33 = OpLoad %uint %30 None
-%tint_low_inc = OpISub %uint %33 %uint_1
-         %36 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %36 %tint_low_inc None
-         %37 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %37 %uint_1 %uint_0
-         %39 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %40 = OpLoad %uint %39 None
-         %41 = OpISub %uint %40 %tint_carry
-         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %42 %41 None
+         %32 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %35 = OpLoad %uint %32 None
+%tint_low_inc = OpISub %uint %35 %uint_1
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %38 %tint_low_inc None
+         %39 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %39 %uint_1 %uint_0
+         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %42 = OpLoad %uint %41 None
+         %43 = OpISub %uint %42 %tint_carry
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %44 %43 None
                OpBranch %8
           %9 = OpLabel
                OpReturn
diff --git a/test/tint/bug/tint/1538.wgsl.expected.spvasm b/test/tint/bug/tint/1538.wgsl.expected.spvasm
index 5cbb56a..6bed458 100644
--- a/test/tint/bug/tint/1538.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1538.wgsl.expected.spvasm
@@ -11,10 +11,10 @@
                OpName %buf_block_tint_explicit_layout "buf_block_tint_explicit_layout"
                OpName %g "g"
                OpName %f "f"
+               OpName %o "o"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %tint_low_inc "tint_low_inc"
                OpName %tint_carry "tint_carry"
-               OpName %o "o"
                OpName %main "main"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %s "s"
@@ -38,8 +38,8 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %22 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %26 = OpConstantNull %v2uint
+         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %27 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_uint = OpTypePointer Function %uint
@@ -57,35 +57,35 @@
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
                OpBranch %14
          %14 = OpLabel
-               OpStore %tint_loop_idx %22
+               OpStore %tint_loop_idx %23
                OpBranch %17
          %17 = OpLabel
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %24 = OpLoad %v2uint %tint_loop_idx None
-         %25 = OpIEqual %v2bool %24 %26
-         %29 = OpAll %bool %25
-               OpSelectionMerge %30 None
-               OpBranchConditional %29 %31 %30
-         %31 = OpLabel
+         %25 = OpLoad %v2uint %tint_loop_idx None
+         %26 = OpIEqual %v2bool %25 %27
+         %30 = OpAll %bool %26
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
+         %32 = OpLabel
                OpBranch %18
-         %30 = OpLabel
-         %32 = OpFunctionCall %int %g
+         %31 = OpLabel
+         %33 = OpFunctionCall %int %g
                OpBranch %18
          %16 = OpLabel
-         %33 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %36 = OpLoad %uint %33 None
-%tint_low_inc = OpISub %uint %36 %uint_1
-         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %38 %tint_low_inc None
-         %39 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %39 %uint_1 %uint_0
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %42 = OpLoad %uint %41 None
-         %43 = OpISub %uint %42 %tint_carry
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %44 %43 None
+         %34 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %37 = OpLoad %uint %34 None
+%tint_low_inc = OpISub %uint %37 %uint_1
+         %39 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %39 %tint_low_inc None
+         %40 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %40 %uint_1 %uint_0
+         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %43 = OpLoad %uint %42 None
+         %44 = OpISub %uint %43 %tint_carry
+         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %45 %44 None
                OpBranch %17
          %18 = OpLabel
           %o = OpFunctionCall %int %g
@@ -97,14 +97,14 @@
           %s = OpVariable %_ptr_Function_int Function
                OpBranch %50
          %50 = OpLabel
-               OpStore %tint_loop_idx_0 %22
+               OpStore %tint_loop_idx_0 %23
                OpBranch %53
          %53 = OpLabel
                OpLoopMerge %54 %52 None
                OpBranch %51
          %51 = OpLabel
          %56 = OpLoad %v2uint %tint_loop_idx_0 None
-         %57 = OpIEqual %v2bool %56 %26
+         %57 = OpIEqual %v2bool %56 %27
          %58 = OpAll %bool %57
                OpSelectionMerge %59 None
                OpBranchConditional %58 %60 %59
diff --git a/test/tint/bug/tint/1557.wgsl.expected.spvasm b/test/tint/bug/tint/1557.wgsl.expected.spvasm
index 77dc52ef..4fde7bb 100644
--- a/test/tint/bug/tint/1557.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1557.wgsl.expected.spvasm
@@ -106,20 +106,20 @@
          %60 = OpLoad %int %58 None
                OpSelectionMerge %63 None
                OpSwitch %60 %61 0 %62
+         %61 = OpLabel
+               OpBranch %63
          %62 = OpLabel
          %64 = OpAccessChain %_ptr_Uniform_int %1 %uint_0
          %65 = OpLoad %int %64 None
                OpSelectionMerge %68 None
                OpSwitch %65 %66 0 %67
-         %67 = OpLabel
-               OpBranch %68
          %66 = OpLabel
          %69 = OpFunctionCall %void %g
                OpBranch %68
+         %67 = OpLabel
+               OpBranch %68
          %68 = OpLabel
                OpBranch %63
-         %61 = OpLabel
-               OpBranch %63
          %63 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/bug/tint/1574.wgsl.expected.spvasm b/test/tint/bug/tint/1574.wgsl.expected.spvasm
index b3a3086..ad89efe 100644
--- a/test/tint/bug/tint/1574.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1574.wgsl.expected.spvasm
@@ -69,16 +69,16 @@
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_Function_uint = OpTypePointer Function %uint
     %uint_42 = OpConstant %uint 42
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+     %uint_0 = OpConstant %uint 0
 %__atomic_compare_exchange_result_u32 = OpTypeStruct %uint %bool
 %_ptr_Function_int = OpTypePointer Function %int
      %int_42 = OpConstant %int 42
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
 %__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool
          %99 = OpTypeFunction %void
  %main_inner = OpFunction %void None %18
@@ -98,63 +98,63 @@
          %23 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
                OpStore %value %uint_42
-         %35 = OpLoad %uint %value None
-         %36 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-         %38 = OpAtomicCompareExchange %uint %36 %uint_1 %uint_0 %uint_0 %35 %uint_0
-         %39 = OpIEqual %bool %38 %uint_0
-         %r1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %38 %39
-         %42 = OpLoad %uint %value None
-         %43 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-         %44 = OpAtomicCompareExchange %uint %43 %uint_1 %uint_0 %uint_0 %42 %uint_0
-         %45 = OpIEqual %bool %44 %uint_0
-         %r2 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %44 %45
-         %47 = OpLoad %uint %value None
-         %48 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-         %49 = OpAtomicCompareExchange %uint %48 %uint_1 %uint_0 %uint_0 %47 %uint_0
-         %50 = OpIEqual %bool %49 %uint_0
-         %r3 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %49 %50
+         %31 = OpLoad %uint %value None
+         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+         %35 = OpAtomicCompareExchange %uint %32 %uint_1 %uint_0 %uint_0 %31 %uint_0
+         %36 = OpIEqual %bool %35 %uint_0
+         %r1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %35 %36
+         %39 = OpLoad %uint %value None
+         %40 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+         %41 = OpAtomicCompareExchange %uint %40 %uint_1 %uint_0 %uint_0 %39 %uint_0
+         %42 = OpIEqual %bool %41 %uint_0
+         %r2 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %41 %42
+         %44 = OpLoad %uint %value None
+         %45 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+         %46 = OpAtomicCompareExchange %uint %45 %uint_1 %uint_0 %uint_0 %44 %uint_0
+         %47 = OpIEqual %bool %46 %uint_0
+         %r3 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %46 %47
                OpStore %value_0 %int_42
-         %55 = OpLoad %int %value_0 None
-         %56 = OpAccessChain %_ptr_StorageBuffer_int %5 %uint_0
-         %58 = OpAtomicCompareExchange %int %56 %uint_1 %uint_0 %uint_0 %55 %int_0
-         %59 = OpIEqual %bool %58 %int_0
-       %r1_0 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %58 %59
-         %62 = OpLoad %int %value_0 None
-         %63 = OpAccessChain %_ptr_StorageBuffer_int %5 %uint_0
-         %64 = OpAtomicCompareExchange %int %63 %uint_1 %uint_0 %uint_0 %62 %int_0
-         %65 = OpIEqual %bool %64 %int_0
-       %r2_0 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %64 %65
-         %67 = OpLoad %int %value_0 None
-         %68 = OpAccessChain %_ptr_StorageBuffer_int %5 %uint_0
-         %69 = OpAtomicCompareExchange %int %68 %uint_1 %uint_0 %uint_0 %67 %int_0
-         %70 = OpIEqual %bool %69 %int_0
-       %r3_0 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %69 %70
+         %52 = OpLoad %int %value_0 None
+         %53 = OpAccessChain %_ptr_StorageBuffer_int %5 %uint_0
+         %55 = OpAtomicCompareExchange %int %53 %uint_1 %uint_0 %uint_0 %52 %int_0
+         %57 = OpIEqual %bool %55 %int_0
+       %r1_0 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %55 %57
+         %60 = OpLoad %int %value_0 None
+         %61 = OpAccessChain %_ptr_StorageBuffer_int %5 %uint_0
+         %62 = OpAtomicCompareExchange %int %61 %uint_1 %uint_0 %uint_0 %60 %int_0
+         %63 = OpIEqual %bool %62 %int_0
+       %r2_0 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %62 %63
+         %65 = OpLoad %int %value_0 None
+         %66 = OpAccessChain %_ptr_StorageBuffer_int %5 %uint_0
+         %67 = OpAtomicCompareExchange %int %66 %uint_1 %uint_0 %uint_0 %65 %int_0
+         %68 = OpIEqual %bool %67 %int_0
+       %r3_0 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %67 %68
                OpStore %value_1 %uint_42
-         %73 = OpLoad %uint %value_1 None
-         %74 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %73 %uint_0
-         %75 = OpIEqual %bool %74 %uint_0
-       %r1_1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %74 %75
-         %77 = OpLoad %uint %value_1 None
-         %78 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %77 %uint_0
-         %79 = OpIEqual %bool %78 %uint_0
-       %r2_1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %78 %79
-         %81 = OpLoad %uint %value_1 None
-         %82 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %81 %uint_0
-         %83 = OpIEqual %bool %82 %uint_0
-       %r3_1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %82 %83
+         %71 = OpLoad %uint %value_1 None
+         %72 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %71 %uint_0
+         %73 = OpIEqual %bool %72 %uint_0
+       %r1_1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %72 %73
+         %75 = OpLoad %uint %value_1 None
+         %76 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %75 %uint_0
+         %77 = OpIEqual %bool %76 %uint_0
+       %r2_1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %76 %77
+         %79 = OpLoad %uint %value_1 None
+         %80 = OpAtomicCompareExchange %uint %b_u32 %uint_2 %uint_0 %uint_0 %79 %uint_0
+         %81 = OpIEqual %bool %80 %uint_0
+       %r3_1 = OpCompositeConstruct %__atomic_compare_exchange_result_u32 %80 %81
                OpStore %value_2 %int_42
-         %86 = OpLoad %int %value_2 None
-         %87 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %86 %int_0
-         %88 = OpIEqual %bool %87 %int_0
-       %r1_2 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %87 %88
-         %90 = OpLoad %int %value_2 None
-         %91 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %90 %int_0
-         %92 = OpIEqual %bool %91 %int_0
-       %r2_2 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %91 %92
-         %94 = OpLoad %int %value_2 None
-         %95 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %94 %int_0
-         %96 = OpIEqual %bool %95 %int_0
-       %r3_2 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %95 %96
+         %84 = OpLoad %int %value_2 None
+         %85 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %84 %int_0
+         %86 = OpIEqual %bool %85 %int_0
+       %r1_2 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %85 %86
+         %88 = OpLoad %int %value_2 None
+         %89 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %88 %int_0
+         %90 = OpIEqual %bool %89 %int_0
+       %r2_2 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %89 %90
+         %92 = OpLoad %int %value_2 None
+         %93 = OpAtomicCompareExchange %int %b_i32 %uint_2 %uint_0 %uint_0 %92 %int_0
+         %94 = OpIEqual %bool %93 %int_0
+       %r3_2 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %93 %94
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %99
diff --git a/test/tint/bug/tint/1604.wgsl.expected.spvasm b/test/tint/bug/tint/1604.wgsl.expected.spvasm
index 0fc8772..b2ec575 100644
--- a/test/tint/bug/tint/1604.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1604.wgsl.expected.spvasm
@@ -43,6 +43,8 @@
          %13 = OpLoad %int %9 None
                OpSelectionMerge %16 None
                OpSwitch %13 %14 0 %15
+         %14 = OpLabel
+               OpBranch %16
          %15 = OpLabel
                OpBranch %17
          %17 = OpLabel
@@ -77,8 +79,6 @@
                OpBranch %20
          %21 = OpLabel
                OpBranch %16
-         %14 = OpLabel
-               OpBranch %16
          %16 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/bug/tint/1605.wgsl.expected.spvasm b/test/tint/bug/tint/1605.wgsl.expected.spvasm
index 58999e3..612a195 100644
--- a/test/tint/bug/tint/1605.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1605.wgsl.expected.spvasm
@@ -14,12 +14,12 @@
                OpName %continue_execution "continue_execution"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %j "j"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
                OpName %main "main"
                OpMemberDecorate %b_block 0 Offset 0
                OpDecorate %b_block Block
@@ -39,18 +39,18 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %27 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
-         %30 = OpConstantNull %v2uint
+         %34 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
 %_ptr_Uniform_int = OpTypePointer Uniform %int
      %uint_0 = OpConstant %uint 0
-     %int_n1 = OpConstant %int -1
-      %int_1 = OpConstant %int 1
-      %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_1 = OpConstant %uint 1
+      %int_1 = OpConstant %int 1
+      %false = OpConstantFalse %bool
+     %int_n1 = OpConstant %int -1
        %void = OpTypeVoid
          %97 = OpTypeFunction %void
      %func_3 = OpFunction %bool None %7
@@ -64,109 +64,109 @@
                OpStore %continue_execution %true
                OpBranch %14
          %14 = OpLabel
-               OpStore %tint_loop_idx %23
+               OpStore %tint_loop_idx %27
                OpStore %i %int_0
                OpBranch %17
          %17 = OpLabel
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %28 = OpLoad %v2uint %tint_loop_idx None
-         %29 = OpIEqual %v2bool %28 %30
-         %32 = OpAll %bool %29
-               OpSelectionMerge %33 None
-               OpBranchConditional %32 %34 %33
-         %34 = OpLabel
+         %32 = OpLoad %v2uint %tint_loop_idx None
+         %33 = OpIEqual %v2bool %32 %34
+         %36 = OpAll %bool %33
+               OpSelectionMerge %37 None
+               OpBranchConditional %36 %38 %37
+         %38 = OpLabel
                OpBranch %18
-         %33 = OpLabel
-         %35 = OpLoad %int %i None
-         %36 = OpAccessChain %_ptr_Uniform_int %1 %uint_0
-         %39 = OpLoad %int %36 None
-         %40 = OpSLessThan %bool %35 %39
-               OpSelectionMerge %41 None
-               OpBranchConditional %40 %41 %42
-         %42 = OpLabel
-               OpBranch %18
-         %41 = OpLabel
-               OpBranch %43
-         %43 = OpLabel
-               OpStore %tint_loop_idx_0 %23
-               OpStore %j %int_n1
-               OpBranch %46
+         %37 = OpLabel
+         %39 = OpLoad %int %i None
+         %40 = OpAccessChain %_ptr_Uniform_int %1 %uint_0
+         %43 = OpLoad %int %40 None
+         %44 = OpSLessThan %bool %39 %43
+               OpSelectionMerge %45 None
+               OpBranchConditional %44 %45 %46
          %46 = OpLabel
-               OpLoopMerge %47 %45 None
-               OpBranch %44
-         %44 = OpLabel
-         %51 = OpLoad %v2uint %tint_loop_idx_0 None
-         %52 = OpIEqual %v2bool %51 %30
-         %53 = OpAll %bool %52
-               OpSelectionMerge %54 None
-               OpBranchConditional %53 %55 %54
-         %55 = OpLabel
-               OpBranch %47
-         %54 = OpLabel
-         %56 = OpLoad %int %j None
-         %57 = OpIEqual %bool %56 %int_1
-               OpSelectionMerge %59 None
-               OpBranchConditional %57 %59 %60
-         %60 = OpLabel
-               OpBranch %47
-         %59 = OpLabel
-               OpStore %continue_execution %false None
-               OpStore %return_value %false None
-               OpBranch %47
+               OpBranch %18
          %45 = OpLabel
-         %62 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %64 = OpLoad %uint %62 None
-%tint_low_inc_1 = OpISub %uint %64 %uint_1
-         %67 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %67 %tint_low_inc_1 None
-         %68 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %68 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %71 = OpLoad %uint %70 None
-         %72 = OpISub %uint %71 %tint_carry_1
-         %73 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %73 %72 None
-         %74 = OpLoad %int %j None
-         %75 = OpIAdd %int %74 %int_1
-               OpStore %j %75 None
-               OpBranch %46
+               OpBranch %47
          %47 = OpLabel
-         %76 = OpLoad %bool %continue_execution None
+               OpStore %tint_loop_idx_0 %27
+               OpStore %j %int_n1
+               OpBranch %50
+         %50 = OpLabel
+               OpLoopMerge %51 %49 None
+               OpBranch %48
+         %48 = OpLabel
+         %74 = OpLoad %v2uint %tint_loop_idx_0 None
+         %75 = OpIEqual %v2bool %74 %34
+         %76 = OpAll %bool %75
                OpSelectionMerge %77 None
                OpBranchConditional %76 %78 %77
          %78 = OpLabel
-               OpBranch %16
+               OpBranch %51
          %77 = OpLabel
+         %79 = OpLoad %int %j None
+         %80 = OpIEqual %bool %79 %int_1
+               OpSelectionMerge %81 None
+               OpBranchConditional %80 %81 %82
+         %82 = OpLabel
+               OpBranch %51
+         %81 = OpLabel
+               OpStore %continue_execution %false None
+               OpStore %return_value %false None
+               OpBranch %51
+         %49 = OpLabel
+         %83 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %84 = OpLoad %uint %83 None
+%tint_low_inc_1 = OpISub %uint %84 %uint_1
+         %86 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %86 %tint_low_inc_1 None
+         %87 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %87 %uint_1 %uint_0
+         %89 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %90 = OpLoad %uint %89 None
+         %91 = OpISub %uint %90 %tint_carry_1
+         %92 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %92 %91 None
+         %93 = OpLoad %int %j None
+         %94 = OpIAdd %int %93 %int_1
+               OpStore %j %94 None
+               OpBranch %50
+         %51 = OpLabel
+         %52 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %53 None
+               OpBranchConditional %52 %54 %53
+         %54 = OpLabel
+               OpBranch %16
+         %53 = OpLabel
                OpBranch %18
          %16 = OpLabel
-         %79 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %80 = OpLoad %uint %79 None
-%tint_low_inc = OpISub %uint %80 %uint_1
-         %82 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %82 %tint_low_inc None
-         %83 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %83 %uint_1 %uint_0
-         %85 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %86 = OpLoad %uint %85 None
-         %87 = OpISub %uint %86 %tint_carry
-         %88 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %88 %87 None
-         %89 = OpLoad %int %i None
-         %90 = OpIAdd %int %89 %int_1
-               OpStore %i %90 None
+         %55 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %57 = OpLoad %uint %55 None
+%tint_low_inc = OpISub %uint %57 %uint_1
+         %60 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %60 %tint_low_inc None
+         %61 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %61 %uint_1 %uint_0
+         %63 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %64 = OpLoad %uint %63 None
+         %65 = OpISub %uint %64 %tint_carry
+         %66 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %66 %65 None
+         %67 = OpLoad %int %i None
+         %68 = OpIAdd %int %67 %int_1
+               OpStore %i %68 None
                OpBranch %17
          %18 = OpLabel
-         %91 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %92 None
-               OpBranchConditional %91 %93 %92
-         %93 = OpLabel
+         %19 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %20 None
+               OpBranchConditional %19 %21 %20
+         %21 = OpLabel
                OpStore %return_value %false None
-               OpBranch %92
-         %92 = OpLabel
-         %94 = OpLoad %bool %return_value None
-               OpReturnValue %94
+               OpBranch %20
+         %20 = OpLabel
+         %22 = OpLoad %bool %return_value None
+               OpReturnValue %22
                OpFunctionEnd
        %main = OpFunction %void None %97
          %98 = OpLabel
diff --git a/test/tint/bug/tint/1739.wgsl.expected.spvasm b/test/tint/bug/tint/1739.wgsl.expected.spvasm
index 0f60961..380de17 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1739.wgsl.expected.spvasm
@@ -217,40 +217,40 @@
                OpSelectionMerge %97 None
                OpBranchConditional %95 %98 %99
          %98 = OpLabel
-        %100 = OpImageFetch %v4float %plane_0 %93 Lod %uint_0
-        %101 = OpVectorShuffle %v3float %100 %100 0 1 2
-        %102 = OpCompositeExtract %float %100 3
+        %112 = OpImageFetch %v4float %plane_0 %93 Lod %uint_0
+        %101 = OpVectorShuffle %v3float %112 %112 0 1 2
+        %104 = OpCompositeExtract %float %112 3
                OpBranch %97
          %99 = OpLabel
-        %103 = OpImageFetch %v4float %plane_0 %93 Lod %uint_0
-        %104 = OpCompositeExtract %float %103 0
-        %105 = OpFMul %v2float %92 %86
-        %106 = OpConvertFToU %v2uint %105
-        %107 = OpImageFetch %v4float %plane_1 %106 Lod %uint_0
-        %108 = OpVectorShuffle %v2float %107 %107 0 1
-        %109 = OpCompositeConstruct %v4float %104 %108 %float_1
-        %110 = OpVectorTimesMatrix %v3float %109 %83
+        %113 = OpImageFetch %v4float %plane_0 %93 Lod %uint_0
+        %114 = OpCompositeExtract %float %113 0
+        %115 = OpFMul %v2float %92 %86
+        %116 = OpConvertFToU %v2uint %115
+        %117 = OpImageFetch %v4float %plane_1 %116 Lod %uint_0
+        %118 = OpVectorShuffle %v2float %117 %117 0 1
+        %119 = OpCompositeConstruct %v4float %114 %118 %float_1
+        %102 = OpVectorTimesMatrix %v3float %119 %83
                OpBranch %97
          %97 = OpLabel
-        %111 = OpPhi %v3float %101 %98 %110 %99
-        %112 = OpPhi %float %102 %98 %float_1 %99
-        %113 = OpIEqual %bool %82 %uint_0
-               OpSelectionMerge %114 None
-               OpBranchConditional %113 %115 %116
-        %115 = OpLabel
-        %117 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %118 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %119 = OpCompositeExtract %mat3v3float %params 5
-        %120 = OpFunctionCall %v3float %tint_GammaCorrection %111 %117
-        %122 = OpMatrixTimesVector %v3float %119 %120
-        %123 = OpFunctionCall %v3float %tint_GammaCorrection %122 %118
-               OpBranch %114
-        %116 = OpLabel
-               OpBranch %114
-        %114 = OpLabel
-        %124 = OpPhi %v3float %123 %115 %111 %116
-        %125 = OpCompositeConstruct %v4float %124 %112
-               OpReturnValue %125
+        %100 = OpPhi %v3float %101 %98 %102 %99
+        %103 = OpPhi %float %104 %98 %float_1 %99
+        %105 = OpIEqual %bool %82 %uint_0
+               OpSelectionMerge %106 None
+               OpBranchConditional %105 %107 %108
+        %107 = OpLabel
+        %120 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %121 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %122 = OpCompositeExtract %mat3v3float %params 5
+        %123 = OpFunctionCall %v3float %tint_GammaCorrection %100 %120
+        %125 = OpMatrixTimesVector %v3float %122 %123
+        %110 = OpFunctionCall %v3float %tint_GammaCorrection %125 %121
+               OpBranch %106
+        %108 = OpLabel
+               OpBranch %106
+        %106 = OpLabel
+        %109 = OpPhi %v3float %110 %107 %100 %108
+        %111 = OpCompositeConstruct %v4float %109 %103
+               OpReturnValue %111
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %128
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/bug/tint/1764.wgsl.expected.spvasm b/test/tint/bug/tint/1764.wgsl.expected.spvasm
index 3651f63..c9a3f6e 100644
--- a/test/tint/bug/tint/1764.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1764.wgsl.expected.spvasm
@@ -24,14 +24,14 @@
 %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %12 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-      %int_0 = OpConstant %int 0
-     %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
      %uint_0 = OpConstant %uint 0
      %int_42 = OpConstant %int 42
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
+     %uint_1 = OpConstant %uint 1
          %36 = OpTypeFunction %void
  %main_inner = OpFunction %void None %12
 %tint_local_index = OpFunctionParameter %uint
@@ -44,22 +44,22 @@
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %21 = OpUGreaterThanEqual %bool %19 %uint_246
-               OpSelectionMerge %23 None
-               OpBranchConditional %21 %24 %23
-         %24 = OpLabel
+         %28 = OpUGreaterThanEqual %bool %19 %uint_246
+               OpSelectionMerge %30 None
+               OpBranchConditional %28 %31 %30
+         %31 = OpLabel
                OpBranch %18
-         %23 = OpLabel
-         %25 = OpAccessChain %_ptr_Workgroup_int %W %19
-               OpStore %25 %int_0 None
+         %30 = OpLabel
+         %32 = OpAccessChain %_ptr_Workgroup_int %W %19
+               OpStore %32 %int_0 None
                OpBranch %16
          %16 = OpLabel
          %20 = OpIAdd %uint %19 %uint_1
                OpBranch %17
          %18 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpAccessChain %_ptr_Workgroup_int %W %uint_0
-               OpStore %32 %int_42 None
+         %24 = OpAccessChain %_ptr_Workgroup_int %W %uint_0
+               OpStore %24 %int_42 None
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %36
diff --git a/test/tint/bug/tint/1926.wgsl.expected.spvasm b/test/tint/bug/tint/1926.wgsl.expected.spvasm
index 91814b3..759ca7f 100644
--- a/test/tint/bug/tint/1926.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/1926.wgsl.expected.spvasm
@@ -43,9 +43,9 @@
          %18 = OpTypeFunction %void %v3uint %v3uint %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-     %uint_0 = OpConstant %uint 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
          %39 = OpTypeFunction %void
  %main_inner = OpFunction %void None %18
@@ -64,10 +64,10 @@
                OpControlBarrier %uint_2 %uint_2 %uint_264
      %failed = OpLoad %uint %sh_atomic_failed None
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpCompositeExtract %uint %local_id 0
-         %33 = OpIEqual %bool %32 %uint_0
+         %31 = OpCompositeExtract %uint %local_id 0
+         %32 = OpIEqual %bool %31 %uint_0
                OpSelectionMerge %34 None
-               OpBranchConditional %33 %35 %34
+               OpBranchConditional %32 %35 %34
          %35 = OpLabel
          %36 = OpAccessChain %_ptr_StorageBuffer_uint %4 %uint_0
                OpStore %36 %failed None
diff --git a/test/tint/bug/tint/2038.wgsl.expected.spvasm b/test/tint/bug/tint/2038.wgsl.expected.spvasm
index 9bba12d..246e8de 100644
--- a/test/tint/bug/tint/2038.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2038.wgsl.expected.spvasm
@@ -34,16 +34,16 @@
                OpSelectionMerge %11 None
                OpBranchConditional %false %12 %11
          %12 = OpLabel
-         %15 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %uint_0
-               OpStore %15 %uint_1 None
+         %17 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %uint_0
+               OpStore %17 %uint_1 None
                OpBranch %11
          %11 = OpLabel
-               OpSelectionMerge %19 None
-               OpBranchConditional %false %20 %19
-         %20 = OpLabel
+               OpSelectionMerge %15 None
+               OpBranchConditional %false %16 %15
+         %16 = OpLabel
          %21 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %uint_1
                OpStore %21 %uint_1 None
-               OpBranch %19
-         %19 = OpLabel
+               OpBranch %15
+         %15 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/bug/tint/2039.wgsl.expected.spvasm b/test/tint/bug/tint/2039.wgsl.expected.spvasm
index a3ee1f9..a9e290c1 100644
--- a/test/tint/bug/tint/2039.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2039.wgsl.expected.spvasm
@@ -51,10 +51,10 @@
          %25 = OpLabel
                OpSelectionMerge %31 None
                OpSwitch %int_2 %27 1 %30
-         %30 = OpLabel
-               OpBranch %11
          %27 = OpLabel
                OpBranch %31
+         %30 = OpLabel
+               OpBranch %11
          %31 = OpLabel
          %32 = OpLoad %uint %out None
          %33 = OpIAdd %uint %32 %uint_1
diff --git a/test/tint/bug/tint/2054.wgsl.expected.spvasm b/test/tint/bug/tint/2054.wgsl.expected.spvasm
index 81b02d1..a4e36f1 100644
--- a/test/tint/bug/tint/2054.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2054.wgsl.expected.spvasm
@@ -45,12 +45,12 @@
                OpSelectionMerge %16 None
                OpBranchConditional %13 %17 %18
          %17 = OpLabel
-         %19 = OpFOrdGreaterThanEqual %bool %b %float_0
+         %20 = OpFOrdGreaterThanEqual %bool %b %float_0
                OpBranch %16
          %18 = OpLabel
                OpBranch %16
          %16 = OpLabel
-       %cond = OpPhi %bool %19 %17 %false %18
+       %cond = OpPhi %bool %20 %17 %false %18
          %22 = OpSelect %float %cond %b %a
                OpStore %p_root %22 None
                OpReturn
diff --git a/test/tint/bug/tint/2059.wgsl.expected.spvasm b/test/tint/bug/tint/2059.wgsl.expected.spvasm
index a377ef1..883c764 100644
--- a/test/tint/bug/tint/2059.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2059.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 377
 ; Schema: 0
                OpCapability Shader
-         %60 = OpExtInstImport "GLSL.std.450"
+        %103 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %main "main"
                OpExecutionMode %main LocalSize 1 1 1
@@ -34,7 +34,6 @@
                OpName %buffer7_block_tint_explicit_layout "buffer7_block_tint_explicit_layout"
                OpName %main "main"
                OpName %m "m"
-               OpName %c "c"
                OpName %a "a"
                OpName %a_0 "a"
                OpMemberName %S2 0 "m"
@@ -47,6 +46,7 @@
                OpName %a_4 "a"
                OpName %a_5 "a"
                OpName %a_6 "a"
+               OpName %c "c"
                OpName %tint_store_and_preserve_padding "tint_store_and_preserve_padding"
                OpName %value_param "value_param"
                OpName %tint_store_and_preserve_padding_0 "tint_store_and_preserve_padding"
@@ -195,17 +195,17 @@
          %39 = OpTypeFunction %void
 %_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
          %43 = OpConstantNull %mat3v3float
+%_arr_mat3v3float_uint_1_0 = OpTypeArray %mat3v3float %uint_1
+         %S2 = OpTypeStruct %_arr_mat3v3float_uint_1_0
+%_arr_S_uint_1_0 = OpTypeArray %S %uint_1
+         %S4 = OpTypeStruct %_arr_S_uint_1_0
+%_arr_S2_uint_1 = OpTypeArray %S2 %uint_1
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_3 = OpConstant %uint 3
        %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-%_arr_mat3v3float_uint_1_0 = OpTypeArray %mat3v3float %uint_1
-         %S2 = OpTypeStruct %_arr_mat3v3float_uint_1_0
-%_arr_S_uint_1_0 = OpTypeArray %S %uint_1
-         %S4 = OpTypeStruct %_arr_S_uint_1_0
-%_arr_S2_uint_1 = OpTypeArray %S2 %uint_1
         %123 = OpTypeFunction %void %mat3v3float
 %_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
 %_arr_uint_uint_2 = OpTypeArray %uint %uint_2
@@ -239,67 +239,67 @@
                OpLoopMerge %48 %46 None
                OpBranch %45
          %45 = OpLabel
-         %52 = OpLoad %uint %c None
-         %53 = OpULessThan %bool %52 %uint_3
-               OpSelectionMerge %56 None
-               OpBranchConditional %53 %56 %57
-         %57 = OpLabel
+         %95 = OpLoad %uint %c None
+         %96 = OpULessThan %bool %95 %uint_3
+               OpSelectionMerge %99 None
+               OpBranchConditional %96 %99 %100
+        %100 = OpLabel
                OpBranch %48
-         %56 = OpLabel
-         %58 = OpLoad %uint %c None
-         %59 = OpExtInst %uint %60 UMin %58 %uint_2
-         %62 = OpAccessChain %_ptr_Function_v3float %m %59
-         %64 = OpLoad %uint %c None
-         %65 = OpIMul %uint %64 %uint_3
-         %66 = OpIAdd %uint %65 %uint_1
-         %67 = OpConvertUToF %float %66
-         %68 = OpLoad %uint %c None
-         %69 = OpIMul %uint %68 %uint_3
-         %70 = OpIAdd %uint %69 %uint_2
-         %71 = OpConvertUToF %float %70
-         %72 = OpLoad %uint %c None
-         %73 = OpIMul %uint %72 %uint_3
-         %74 = OpIAdd %uint %73 %uint_3
-         %75 = OpConvertUToF %float %74
-         %76 = OpCompositeConstruct %v3float %67 %71 %75
-               OpStore %62 %76 None
+         %99 = OpLabel
+        %101 = OpLoad %uint %c None
+        %102 = OpExtInst %uint %103 UMin %101 %uint_2
+        %105 = OpAccessChain %_ptr_Function_v3float %m %102
+        %107 = OpLoad %uint %c None
+        %108 = OpIMul %uint %107 %uint_3
+        %109 = OpIAdd %uint %108 %uint_1
+        %110 = OpConvertUToF %float %109
+        %111 = OpLoad %uint %c None
+        %112 = OpIMul %uint %111 %uint_3
+        %113 = OpIAdd %uint %112 %uint_2
+        %114 = OpConvertUToF %float %113
+        %115 = OpLoad %uint %c None
+        %116 = OpIMul %uint %115 %uint_3
+        %117 = OpIAdd %uint %116 %uint_3
+        %118 = OpConvertUToF %float %117
+        %119 = OpCompositeConstruct %v3float %110 %114 %118
+               OpStore %105 %119 None
                OpBranch %46
          %46 = OpLabel
-         %77 = OpLoad %uint %c None
-         %78 = OpIAdd %uint %77 %uint_1
-               OpStore %c %78 None
+        %120 = OpLoad %uint %c None
+        %121 = OpIAdd %uint %120 %uint_1
+               OpStore %c %121 None
                OpBranch %47
          %48 = OpLabel
           %a = OpLoad %mat3v3float %m None
-         %80 = OpFunctionCall %void %tint_store_and_preserve_padding %a
-         %82 = OpLoad %mat3v3float %m None
-        %a_0 = OpCompositeConstruct %S %82
-         %84 = OpFunctionCall %void %tint_store_and_preserve_padding_7 %a_0
-         %86 = OpLoad %mat3v3float %m None
-         %88 = OpCompositeConstruct %_arr_mat3v3float_uint_1_0 %86
-        %a_1 = OpCompositeConstruct %S2 %88
-         %91 = OpFunctionCall %void %tint_store_and_preserve_padding_11 %a_1
-         %93 = OpLoad %mat3v3float %m None
-         %94 = OpCompositeConstruct %S %93
-        %a_2 = OpCompositeConstruct %S3 %94
-         %96 = OpFunctionCall %void %tint_store_and_preserve_padding_16 %a_2
-         %98 = OpLoad %mat3v3float %m None
-         %99 = OpCompositeConstruct %S %98
-        %101 = OpCompositeConstruct %_arr_S_uint_1_0 %99
-        %a_3 = OpCompositeConstruct %S4 %101
-        %104 = OpFunctionCall %void %tint_store_and_preserve_padding_17 %a_3
-        %106 = OpLoad %mat3v3float %m None
-        %a_4 = OpCompositeConstruct %_arr_mat3v3float_uint_1_0 %106
-        %108 = OpFunctionCall %void %tint_store_and_preserve_padding_13 %a_4
-        %110 = OpLoad %mat3v3float %m None
-        %111 = OpCompositeConstruct %S %110
-        %a_5 = OpCompositeConstruct %_arr_S_uint_1_0 %111
-        %113 = OpFunctionCall %void %tint_store_and_preserve_padding_18 %a_5
-        %115 = OpLoad %mat3v3float %m None
-        %116 = OpCompositeConstruct %_arr_mat3v3float_uint_1_0 %115
-        %117 = OpCompositeConstruct %S2 %116
-        %a_6 = OpCompositeConstruct %_arr_S2_uint_1 %117
-        %120 = OpFunctionCall %void %tint_store_and_preserve_padding_20 %a_6
+         %50 = OpFunctionCall %void %tint_store_and_preserve_padding %a
+         %52 = OpLoad %mat3v3float %m None
+        %a_0 = OpCompositeConstruct %S %52
+         %54 = OpFunctionCall %void %tint_store_and_preserve_padding_7 %a_0
+         %56 = OpLoad %mat3v3float %m None
+         %58 = OpCompositeConstruct %_arr_mat3v3float_uint_1_0 %56
+        %a_1 = OpCompositeConstruct %S2 %58
+         %61 = OpFunctionCall %void %tint_store_and_preserve_padding_11 %a_1
+         %63 = OpLoad %mat3v3float %m None
+         %64 = OpCompositeConstruct %S %63
+        %a_2 = OpCompositeConstruct %S3 %64
+         %66 = OpFunctionCall %void %tint_store_and_preserve_padding_16 %a_2
+         %68 = OpLoad %mat3v3float %m None
+         %69 = OpCompositeConstruct %S %68
+         %71 = OpCompositeConstruct %_arr_S_uint_1_0 %69
+        %a_3 = OpCompositeConstruct %S4 %71
+         %74 = OpFunctionCall %void %tint_store_and_preserve_padding_17 %a_3
+         %76 = OpLoad %mat3v3float %m None
+        %a_4 = OpCompositeConstruct %_arr_mat3v3float_uint_1_0 %76
+         %78 = OpFunctionCall %void %tint_store_and_preserve_padding_13 %a_4
+         %80 = OpLoad %mat3v3float %m None
+         %81 = OpCompositeConstruct %S %80
+        %a_5 = OpCompositeConstruct %_arr_S_uint_1_0 %81
+         %83 = OpFunctionCall %void %tint_store_and_preserve_padding_18 %a_5
+         %85 = OpLoad %mat3v3float %m None
+         %86 = OpCompositeConstruct %_arr_mat3v3float_uint_1_0 %85
+         %87 = OpCompositeConstruct %S2 %86
+        %a_6 = OpCompositeConstruct %_arr_S2_uint_1 %87
+         %90 = OpFunctionCall %void %tint_store_and_preserve_padding_20 %a_6
                OpReturn
                OpFunctionEnd
 %tint_store_and_preserve_padding = OpFunction %void None %123
diff --git a/test/tint/bug/tint/2063.wgsl.expected.spvasm b/test/tint/bug/tint/2063.wgsl.expected.spvasm
index 69355b5..c4bff0d 100644
--- a/test/tint/bug/tint/2063.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2063.wgsl.expected.spvasm
@@ -25,11 +25,11 @@
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
+     %uint_0 = OpConstant %uint 0
      %int_n1 = OpConstant %int -1
 %_ptr_Function_int = OpTypePointer Function %int
+      %int_0 = OpConstant %int 0
          %28 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %10
 %tint_local_index = OpFunctionParameter %uint
@@ -43,8 +43,8 @@
                OpBranch %15
          %15 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %23 = OpAtomicISub %int %arg_0 %uint_2 %uint_0 %int_n1
-               OpStore %res %23
+         %20 = OpAtomicISub %int %arg_0 %uint_2 %uint_0 %int_n1
+               OpStore %res %20
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %28
diff --git a/test/tint/bug/tint/2147.wgsl.expected.spvasm b/test/tint/bug/tint/2147.wgsl.expected.spvasm
index fb6c06c..0ca63fc 100644
--- a/test/tint/bug/tint/2147.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2147.wgsl.expected.spvasm
@@ -40,11 +40,11 @@
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
        %uint = OpTypeInt 32 0
      %uint_0 = OpConstant %uint 0
+%__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool
+         %30 = OpUndef %__atomic_compare_exchange_result_i32
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
       %int_0 = OpConstant %int 0
-%__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool
-         %35 = OpUndef %__atomic_compare_exchange_result_i32
        %void = OpTypeVoid
          %45 = OpTypeFunction %void
  %main_inner = OpFunction %v4float None %14
@@ -60,25 +60,25 @@
                OpSelectionMerge %24 None
                OpBranchConditional %23 %25 %26
          %25 = OpLabel
-         %27 = OpAtomicCompareExchange %int %19 %uint_1 %uint_0 %uint_0 %int_1 %int_0
-         %31 = OpIEqual %bool %27 %int_0
-         %33 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %27 %31
+         %38 = OpAtomicCompareExchange %int %19 %uint_1 %uint_0 %uint_0 %int_1 %int_0
+         %42 = OpIEqual %bool %38 %int_0
+         %29 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %38 %42
                OpBranch %24
          %26 = OpLabel
                OpBranch %24
          %24 = OpLabel
-         %34 = OpPhi %__atomic_compare_exchange_result_i32 %33 %25 %35 %26
-  %old_value = OpCompositeExtract %int %34 0
-         %37 = OpConvertSToF %float %old_value
-         %38 = OpCompositeConstruct %v4float %37 %37 %37 %37
-         %39 = OpLoad %bool %continue_execution None
-         %40 = OpLogicalNot %bool %39
-               OpSelectionMerge %41 None
-               OpBranchConditional %40 %42 %41
-         %42 = OpLabel
+         %28 = OpPhi %__atomic_compare_exchange_result_i32 %29 %25 %30 %26
+  %old_value = OpCompositeExtract %int %28 0
+         %32 = OpConvertSToF %float %old_value
+         %33 = OpCompositeConstruct %v4float %32 %32 %32 %32
+         %34 = OpLoad %bool %continue_execution None
+         %35 = OpLogicalNot %bool %34
+               OpSelectionMerge %36 None
+               OpBranchConditional %35 %37 %36
+         %37 = OpLabel
                OpKill
-         %41 = OpLabel
-               OpReturnValue %38
+         %36 = OpLabel
+               OpReturnValue %33
                OpFunctionEnd
        %main = OpFunction %void None %45
          %46 = OpLabel
diff --git a/test/tint/bug/tint/2202.wgsl.expected.spvasm b/test/tint/bug/tint/2202.wgsl.expected.spvasm
index 1ea4ac0..8e97891 100644
--- a/test/tint/bug/tint/2202.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/2202.wgsl.expected.spvasm
@@ -13,11 +13,11 @@
                OpExecutionMode %main LocalSize 1 1 1
                OpName %main "main"
                OpName %tint_loop_idx "tint_loop_idx"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
@@ -59,44 +59,44 @@
                OpLoopMerge %28 %26 None
                OpBranch %25
          %25 = OpLabel
-         %30 = OpLoad %v2uint %tint_loop_idx_0 None
-         %31 = OpIEqual %v2bool %30 %18
-         %32 = OpAll %bool %31
-               OpSelectionMerge %33 None
-               OpBranchConditional %32 %34 %33
-         %34 = OpLabel
+         %43 = OpLoad %v2uint %tint_loop_idx_0 None
+         %44 = OpIEqual %v2bool %43 %18
+         %45 = OpAll %bool %44
+               OpSelectionMerge %46 None
+               OpBranchConditional %45 %47 %46
+         %47 = OpLabel
                OpBranch %28
-         %33 = OpLabel
+         %46 = OpLabel
                OpReturn
          %26 = OpLabel
-         %35 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %38 = OpLoad %uint %35 None
-%tint_low_inc_1 = OpISub %uint %38 %uint_1
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %41 %tint_low_inc_1 None
-         %42 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %42 %uint_1 %uint_0
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %45 = OpLoad %uint %44 None
-         %46 = OpISub %uint %45 %tint_carry_1
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %47 %46 None
+         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %49 = OpLoad %uint %48 None
+%tint_low_inc_1 = OpISub %uint %49 %uint_1
+         %51 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %51 %tint_low_inc_1 None
+         %52 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %52 %uint_1 %uint_0
+         %54 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %55 = OpLoad %uint %54 None
+         %56 = OpISub %uint %55 %tint_carry_1
+         %57 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %57 %56 None
                OpBranch %27
          %28 = OpLabel
                OpUnreachable
           %7 = OpLabel
-         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %49 = OpLoad %uint %48 None
-%tint_low_inc = OpISub %uint %49 %uint_1
-         %51 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %51 %tint_low_inc None
-         %52 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %52 %uint_1 %uint_0
-         %54 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %55 = OpLoad %uint %54 None
-         %56 = OpISub %uint %55 %tint_carry
-         %57 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %57 %56 None
+         %29 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %32 = OpLoad %uint %29 None
+%tint_low_inc = OpISub %uint %32 %uint_1
+         %35 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %35 %tint_low_inc None
+         %36 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %36 %uint_1 %uint_0
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %39 = OpLoad %uint %38 None
+         %40 = OpISub %uint %39 %tint_carry
+         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %41 %40 None
                OpBranch %8
           %9 = OpLabel
                OpReturn
diff --git a/test/tint/bug/tint/349310442.wgsl.expected.spvasm b/test/tint/bug/tint/349310442.wgsl.expected.spvasm
index ef0ba3d..3bb856c 100644
--- a/test/tint/bug/tint/349310442.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/349310442.wgsl.expected.spvasm
@@ -182,40 +182,40 @@
                OpSelectionMerge %68 None
                OpBranchConditional %66 %69 %70
          %69 = OpLabel
-         %71 = OpImageFetch %v4float %plane_0 %64 Lod %uint_0
-         %72 = OpVectorShuffle %v3float %71 %71 0 1 2
-         %73 = OpCompositeExtract %float %71 3
+         %83 = OpImageFetch %v4float %plane_0 %64 Lod %uint_0
+         %72 = OpVectorShuffle %v3float %83 %83 0 1 2
+         %75 = OpCompositeExtract %float %83 3
                OpBranch %68
          %70 = OpLabel
-         %74 = OpImageFetch %v4float %plane_0 %64 Lod %uint_0
-         %75 = OpCompositeExtract %float %74 0
-         %76 = OpFMul %v2float %63 %57
-         %77 = OpConvertFToU %v2uint %76
-         %78 = OpImageFetch %v4float %plane_1 %77 Lod %uint_0
-         %79 = OpVectorShuffle %v2float %78 %78 0 1
-         %80 = OpCompositeConstruct %v4float %75 %79 %float_1
-         %81 = OpVectorTimesMatrix %v3float %80 %54
+         %84 = OpImageFetch %v4float %plane_0 %64 Lod %uint_0
+         %85 = OpCompositeExtract %float %84 0
+         %86 = OpFMul %v2float %63 %57
+         %87 = OpConvertFToU %v2uint %86
+         %88 = OpImageFetch %v4float %plane_1 %87 Lod %uint_0
+         %89 = OpVectorShuffle %v2float %88 %88 0 1
+         %90 = OpCompositeConstruct %v4float %85 %89 %float_1
+         %73 = OpVectorTimesMatrix %v3float %90 %54
                OpBranch %68
          %68 = OpLabel
-         %82 = OpPhi %v3float %72 %69 %81 %70
-         %83 = OpPhi %float %73 %69 %float_1 %70
-         %84 = OpIEqual %bool %53 %uint_0
-               OpSelectionMerge %85 None
-               OpBranchConditional %84 %86 %87
-         %86 = OpLabel
-         %88 = OpCompositeExtract %tint_GammaTransferParams %params 3
-         %89 = OpCompositeExtract %tint_GammaTransferParams %params 4
-         %90 = OpCompositeExtract %mat3v3float %params 5
-         %91 = OpFunctionCall %v3float %tint_GammaCorrection %82 %88
-         %93 = OpMatrixTimesVector %v3float %90 %91
-         %94 = OpFunctionCall %v3float %tint_GammaCorrection %93 %89
-               OpBranch %85
-         %87 = OpLabel
-               OpBranch %85
-         %85 = OpLabel
-         %95 = OpPhi %v3float %94 %86 %82 %87
-         %96 = OpCompositeConstruct %v4float %95 %83
-               OpReturnValue %96
+         %71 = OpPhi %v3float %72 %69 %73 %70
+         %74 = OpPhi %float %75 %69 %float_1 %70
+         %76 = OpIEqual %bool %53 %uint_0
+               OpSelectionMerge %77 None
+               OpBranchConditional %76 %78 %79
+         %78 = OpLabel
+         %91 = OpCompositeExtract %tint_GammaTransferParams %params 3
+         %92 = OpCompositeExtract %tint_GammaTransferParams %params 4
+         %93 = OpCompositeExtract %mat3v3float %params 5
+         %94 = OpFunctionCall %v3float %tint_GammaCorrection %71 %91
+         %96 = OpMatrixTimesVector %v3float %93 %94
+         %81 = OpFunctionCall %v3float %tint_GammaCorrection %96 %92
+               OpBranch %77
+         %79 = OpLabel
+               OpBranch %77
+         %77 = OpLabel
+         %80 = OpPhi %v3float %81 %78 %71 %79
+         %82 = OpCompositeConstruct %v4float %80 %74
+               OpReturnValue %82
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %99
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/bug/tint/354627692.wgsl.expected.spvasm b/test/tint/bug/tint/354627692.wgsl.expected.spvasm
index db1773d..25006b3 100644
--- a/test/tint/bug/tint/354627692.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/354627692.wgsl.expected.spvasm
@@ -35,15 +35,15 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %24 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %28 = OpConstantNull %v2uint
+         %26 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %30 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_1 = OpConstant %uint 1
+     %int_10 = OpConstant %int 10
       %int_5 = OpConstant %int 5
       %int_2 = OpConstant %int 2
-     %int_10 = OpConstant %int 10
        %main = OpFunction %void None %7
           %8 = OpLabel
           %i = OpVariable %_ptr_Function_int Function
@@ -54,67 +54,67 @@
                OpStore %i %13
                OpBranch %16
          %16 = OpLabel
-               OpStore %tint_loop_idx %24
+               OpStore %tint_loop_idx %26
                OpBranch %19
          %19 = OpLabel
                OpLoopMerge %20 %18 None
                OpBranch %17
          %17 = OpLabel
-         %26 = OpLoad %v2uint %tint_loop_idx None
-         %27 = OpIEqual %v2bool %26 %28
-         %31 = OpAll %bool %27
-               OpSelectionMerge %32 None
-               OpBranchConditional %31 %33 %32
-         %33 = OpLabel
+         %28 = OpLoad %v2uint %tint_loop_idx None
+         %29 = OpIEqual %v2bool %28 %30
+         %33 = OpAll %bool %29
+               OpSelectionMerge %34 None
+               OpBranchConditional %33 %35 %34
+         %35 = OpLabel
                OpBranch %20
-         %32 = OpLabel
+         %34 = OpLabel
                OpBranch %18
          %18 = OpLabel
-         %34 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %36 = OpLoad %uint %34 None
-%tint_low_inc = OpISub %uint %36 %uint_1
-         %39 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %39 %tint_low_inc None
-         %40 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %40 %uint_1 %uint_0
-         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %43 = OpLoad %uint %42 None
-         %44 = OpISub %uint %43 %tint_carry
-         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %45 %44 None
-               OpBranch %46
-         %46 = OpLabel
-               OpStore %tint_loop_idx_0 %24
+         %36 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %38 = OpLoad %uint %36 None
+%tint_low_inc = OpISub %uint %38 %uint_1
+         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %41 %tint_low_inc None
+         %42 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %42 %uint_1 %uint_0
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %45 = OpLoad %uint %44 None
+         %46 = OpISub %uint %45 %tint_carry
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %47 %46 None
+               OpBranch %48
+         %48 = OpLabel
+               OpStore %tint_loop_idx_0 %26
+               OpBranch %51
+         %51 = OpLabel
+               OpLoopMerge %52 %50 None
                OpBranch %49
          %49 = OpLabel
-               OpLoopMerge %50 %48 None
-               OpBranch %47
-         %47 = OpLabel
-         %52 = OpLoad %v2uint %tint_loop_idx_0 None
-         %53 = OpIEqual %v2bool %52 %28
-         %54 = OpAll %bool %53
-               OpSelectionMerge %55 None
-               OpBranchConditional %54 %56 %55
-         %56 = OpLabel
-               OpBranch %50
-         %55 = OpLabel
-         %57 = OpLoad %int %i None
-         %58 = OpSGreaterThan %bool %57 %int_5
+         %57 = OpLoad %v2uint %tint_loop_idx_0 None
+         %58 = OpIEqual %v2bool %57 %30
+         %59 = OpAll %bool %58
                OpSelectionMerge %60 None
-               OpBranchConditional %58 %61 %62
+               OpBranchConditional %59 %61 %60
          %61 = OpLabel
-         %63 = OpLoad %int %i None
-         %64 = OpIMul %int %63 %int_2
-               OpStore %i %64 None
-               OpBranch %50
-         %62 = OpLabel
-         %66 = OpLoad %int %i None
-         %67 = OpIMul %int %66 %int_2
-               OpStore %i %67 None
-               OpBranch %50
+               OpBranch %52
          %60 = OpLabel
-               OpBranch %50
-         %48 = OpLabel
+         %62 = OpLoad %int %i None
+         %63 = OpSGreaterThan %bool %62 %int_5
+               OpSelectionMerge %65 None
+               OpBranchConditional %63 %66 %67
+         %66 = OpLabel
+         %78 = OpLoad %int %i None
+         %79 = OpIMul %int %78 %int_2
+               OpStore %i %79 None
+               OpBranch %52
+         %67 = OpLabel
+         %81 = OpLoad %int %i None
+         %82 = OpIMul %int %81 %int_2
+               OpStore %i %82 None
+               OpBranch %52
+         %65 = OpLabel
+               OpBranch %52
+         %50 = OpLabel
          %68 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
          %69 = OpLoad %uint %68 None
 %tint_low_inc_1 = OpISub %uint %69 %uint_1
@@ -127,14 +127,14 @@
          %76 = OpISub %uint %75 %tint_carry_1
          %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
                OpStore %77 %76 None
-               OpBranch %49
-         %50 = OpLabel
-         %78 = OpLoad %int %i None
-         %79 = OpSGreaterThan %bool %78 %int_10
-               OpBranchConditional %79 %20 %19
+               OpBranch %51
+         %52 = OpLabel
+         %53 = OpLoad %int %i None
+         %54 = OpSGreaterThan %bool %53 %int_10
+               OpBranchConditional %54 %20 %19
          %20 = OpLabel
-         %81 = OpLoad %int %i None
-         %82 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %82 %81 None
+         %21 = OpLoad %int %i None
+         %22 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %22 %21 None
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/bug/tint/366037039.wgsl.expected.spvasm b/test/tint/bug/tint/366037039.wgsl.expected.spvasm
index 9e6ec20..8ddd53b 100644
--- a/test/tint/bug/tint/366037039.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/366037039.wgsl.expected.spvasm
@@ -167,21 +167,21 @@
                OpLoopMerge %92 %90 None
                OpBranch %89
          %89 = OpLabel
-         %95 = OpUGreaterThanEqual %bool %93 %uint_4
-               OpSelectionMerge %96 None
-               OpBranchConditional %95 %97 %96
-         %97 = OpLabel
+         %96 = OpUGreaterThanEqual %bool %93 %uint_4
+               OpSelectionMerge %97 None
+               OpBranchConditional %96 %98 %97
+         %98 = OpLabel
                OpBranch %92
-         %96 = OpLabel
-         %98 = OpAccessChain %_ptr_Function_v3uint %84 %93
-         %99 = OpLoad %v3uint %98 None
-        %100 = OpAccessChain %_ptr_Function_v3uint %86 %93
-               OpStore %100 %99 None
+         %97 = OpLabel
+         %99 = OpAccessChain %_ptr_Function_v3uint %84 %93
+        %100 = OpLoad %v3uint %99 None
+        %101 = OpAccessChain %_ptr_Function_v3uint %86 %93
+               OpStore %101 %100 None
                OpBranch %90
          %90 = OpLabel
          %94 = OpIAdd %uint %93 %uint_1
                OpBranch %91
          %92 = OpLabel
-        %101 = OpLoad %_arr_v3uint_uint_4_0 %86 None
-               OpReturnValue %101
+         %95 = OpLoad %_arr_v3uint_uint_4_0 %86 None
+               OpReturnValue %95
                OpFunctionEnd
diff --git a/test/tint/bug/tint/366314931.wgsl.expected.spvasm b/test/tint/bug/tint/366314931.wgsl.expected.spvasm
index 67e9d5e..4a1c236 100644
--- a/test/tint/bug/tint/366314931.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/366314931.wgsl.expected.spvasm
@@ -44,13 +44,13 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%_ptr_Workgroup_v3uint = OpTypePointer Workgroup %v3uint
-     %uint_0 = OpConstant %uint 0
-         %25 = OpConstantNull %v3uint
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
+     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%_ptr_Workgroup_v3uint = OpTypePointer Workgroup %v3uint
+         %34 = OpConstantNull %v3uint
          %38 = OpTypeFunction %void
  %main_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -59,17 +59,17 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-         %22 = OpAccessChain %_ptr_Workgroup_v3uint %wgvar %uint_0
-               OpStore %22 %25 None
-         %26 = OpAccessChain %_ptr_Workgroup_uint %wgvar %uint_1
-               OpAtomicStore %26 %uint_2 %uint_0 %uint_0
+         %32 = OpAccessChain %_ptr_Workgroup_v3uint %wgvar %uint_0
+               OpStore %32 %34 None
+         %35 = OpAccessChain %_ptr_Workgroup_uint %wgvar %uint_1
+               OpAtomicStore %35 %uint_2 %uint_0 %uint_0
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpAccessChain %_ptr_Workgroup_uint %wgvar %uint_1
-          %x = OpAtomicLoad %uint %32 %uint_2 %uint_0
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %6 %uint_0 %uint_1
-               OpAtomicStore %34 %uint_1 %uint_0 %x
+         %25 = OpAccessChain %_ptr_Workgroup_uint %wgvar %uint_1
+          %x = OpAtomicLoad %uint %25 %uint_2 %uint_0
+         %29 = OpAccessChain %_ptr_StorageBuffer_uint %6 %uint_0 %uint_1
+               OpAtomicStore %29 %uint_1 %uint_0 %x
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %38
diff --git a/test/tint/bug/tint/379127084.wgsl.expected.spvasm b/test/tint/bug/tint/379127084.wgsl.expected.spvasm
index 4da2c07..ca49b14 100644
--- a/test/tint/bug/tint/379127084.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/379127084.wgsl.expected.spvasm
@@ -43,14 +43,41 @@
                OpName %_59_m "_59_m"
                OpName %_60_n "_60_n"
                OpName %_61_o "_61_o"
+               OpName %_skTemp15 "_skTemp15"
+               OpName %_skTemp16 "_skTemp16"
+               OpName %_skTemp17 "_skTemp17"
+               OpName %_84_a "_84_a"
+               OpName %_85_d "_85_d"
+               OpName %_94_f "_94_f"
+               OpName %outColor_0 "outColor_0"
                OpName %tint_loop_idx "tint_loop_idx"
+               OpName %_skTemp18 "_skTemp18"
+               OpName %_86_e "_86_e"
+               OpName %_skTemp19 "_skTemp19"
+               OpName %_87_f "_87_f"
+               OpName %_88_h "_88_h"
+               OpName %_skTemp20 "_skTemp20"
+               OpName %_89_i "_89_i"
+               OpName %_90_j "_90_j"
+               OpName %_skTemp21 "_skTemp21"
+               OpName %_skTemp21 "_91_k"
+               OpName %_skTemp22 "_skTemp22"
+               OpName %_92_l "_92_l"
+               OpName %_93_m "_93_m"
+               OpName %_skTemp23 "_skTemp23"
+               OpName %_skTemp24 "_skTemp24"
+               OpName %_95_b "_95_b"
+               OpName %_96_c "_96_c"
+               OpName %_skTemp25 "_skTemp25"
+               OpName %_skTemp26 "_skTemp26"
+               OpName %_skTemp27 "_skTemp27"
+               OpName %_skTemp27 "_97_d"
+               OpName %_skTemp28 "_skTemp28"
                OpName %_62_f "_62_f"
                OpName %_skTemp2 "_skTemp2"
-               OpName %_skTemp3 "_skTemp3"
                OpName %_63_g "_63_g"
                OpName %_64_h "_64_h"
                OpName %_65_i "_65_i"
-               OpName %_skTemp4 "_skTemp4"
                OpName %_66_j "_66_j"
                OpName %_67_p "_67_p"
                OpName %_skTemp5 "_skTemp5"
@@ -59,6 +86,11 @@
                OpName %_skTemp6 "_69_e"
                OpName %_71_g "_71_g"
                OpName %_72_h "_72_h"
+               OpName %_83_q "_83_q"
+               OpName %_skTemp29 "_skTemp29"
+               OpName %_skTemp30 "_skTemp30"
+               OpName %_skTemp3 "_skTemp3"
+               OpName %_skTemp4 "_skTemp4"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %_73_i "_73_i"
                OpName %_74_j "_74_j"
@@ -77,39 +109,7 @@
                OpName %_skTemp12 "_skTemp12"
                OpName %_skTemp12 "_82_r"
                OpName %_skTemp13 "_skTemp13"
-               OpName %_83_q "_83_q"
                OpName %_skTemp14 "_skTemp14"
-               OpName %_skTemp15 "_skTemp15"
-               OpName %_skTemp16 "_skTemp16"
-               OpName %_skTemp17 "_skTemp17"
-               OpName %_84_a "_84_a"
-               OpName %_85_d "_85_d"
-               OpName %_skTemp18 "_skTemp18"
-               OpName %_86_e "_86_e"
-               OpName %_skTemp19 "_skTemp19"
-               OpName %_87_f "_87_f"
-               OpName %_88_h "_88_h"
-               OpName %_skTemp20 "_skTemp20"
-               OpName %_89_i "_89_i"
-               OpName %_90_j "_90_j"
-               OpName %_skTemp21 "_skTemp21"
-               OpName %_skTemp21 "_91_k"
-               OpName %_skTemp22 "_skTemp22"
-               OpName %_92_l "_92_l"
-               OpName %_93_m "_93_m"
-               OpName %_skTemp23 "_skTemp23"
-               OpName %_94_f "_94_f"
-               OpName %_skTemp24 "_skTemp24"
-               OpName %_95_b "_95_b"
-               OpName %_96_c "_96_c"
-               OpName %_skTemp25 "_skTemp25"
-               OpName %_skTemp26 "_skTemp26"
-               OpName %_skTemp27 "_skTemp27"
-               OpName %_skTemp27 "_97_d"
-               OpName %_skTemp28 "_skTemp28"
-               OpName %_skTemp29 "_skTemp29"
-               OpName %_skTemp30 "_skTemp30"
-               OpName %outColor_0 "outColor_0"
                OpName %main_inner "main_inner"
                OpName %_stageIn_0 "_stageIn"
                OpName %_stageOut "_stageOut"
@@ -191,61 +191,61 @@
     %float_1 = OpConstant %float 1
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
-%_ptr_Function_v2uint = OpTypePointer Function %v2uint
-%uint_4294967295 = OpConstant %uint 4294967295
-         %92 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %96 = OpConstantNull %v2uint
        %bool = OpTypeBool
-     %v2bool = OpTypeVector %bool 2
-     %uint_3 = OpConstant %uint 3
-        %126 = OpConstantComposite %v2float %float_1 %float_1
-     %uint_4 = OpConstant %uint 4
-        %137 = OpConstantNull %int
-%float_0_00390625 = OpConstant %float 0.00390625
-%float_n0_474999994 = OpConstant %float -0.474999994
-  %float_n16 = OpConstant %float -16
-%float_15_9899998 = OpConstant %float 15.9899998
-        %162 = OpTypeSampledImage %20
-      %false = OpConstantFalse %bool
-  %float_255 = OpConstant %float 255
-        %183 = OpConstantComposite %v2float %float_255 %float_255
-        %186 = OpConstantComposite %v2float %float_0_5 %float_0_5
-%float_0_00392156886 = OpConstant %float 0.00392156886
-        %189 = OpConstantComposite %v2float %float_0_00392156886 %float_0_00392156886
-  %float_256 = OpConstant %float 256
-        %201 = OpConstantComposite %v4float %float_0_00390625 %float_0_00390625 %float_0_00390625 %float_0_00390625
-        %206 = OpConstantNull %v2float
-    %float_2 = OpConstant %float 2
-        %211 = OpConstantComposite %v2float %float_2 %float_2
-    %float_3 = OpConstant %float 3
-        %214 = OpConstantComposite %v2float %float_3 %float_3
- %float_0_25 = OpConstant %float 0.25
-%_ptr_Function_uint = OpTypePointer Function %uint
-      %int_1 = OpConstant %int 1
-      %int_4 = OpConstant %int 4
-        %381 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
-        %385 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %96 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
     %v3float = OpTypeVector %float 3
+     %uint_3 = OpConstant %uint 3
 %float_0_212599993 = OpConstant %float 0.212599993
 %float_0_715200007 = OpConstant %float 0.715200007
 %float_0_0722000003 = OpConstant %float 0.0722000003
-        %397 = OpConstantComposite %v3float %float_0_212599993 %float_0_715200007 %float_0_0722000003
+        %109 = OpConstantComposite %v3float %float_0_212599993 %float_0_715200007 %float_0_0722000003
     %float_0 = OpConstant %float 0
      %uint_7 = OpConstant %uint 7
-   %float_n1 = OpConstant %float -1
-%float_0_666666687 = OpConstant %float 0.666666687
-%float_n0_333333343 = OpConstant %float -0.333333343
-    %float_6 = OpConstant %float 6
-%float_9_99999975en05 = OpConstant %float 9.99999975e-05
+        %126 = OpConstantNull %int
 %_ptr_StorageBuffer_mat4v4float = OpTypePointer StorageBuffer %mat4v4float
      %uint_5 = OpConstant %uint 5
 %_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
      %uint_6 = OpConstant %uint 6
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+%uint_4294967295 = OpConstant %uint 4294967295
+        %160 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+        %164 = OpConstantNull %v2uint
+     %v2bool = OpTypeVector %bool 2
+%_ptr_Function_uint = OpTypePointer Function %uint
+      %int_1 = OpConstant %int 1
+        %197 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+    %float_6 = OpConstant %float 6
+%float_9_99999975en05 = OpConstant %float 9.99999975e-05
+    %float_2 = OpConstant %float 2
+%float_0_666666687 = OpConstant %float 0.666666687
 %float_0_333333343 = OpConstant %float 0.333333343
-        %538 = OpConstantComposite %v3float %float_0 %float_0_666666687 %float_0_333333343
-        %548 = OpConstantNull %v3float
-        %549 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+        %276 = OpConstantComposite %v3float %float_0 %float_0_666666687 %float_0_333333343
+    %float_3 = OpConstant %float 3
+        %288 = OpConstantNull %v3float
+        %289 = OpConstantComposite %v3float %float_1 %float_1 %float_1
      %uint_8 = OpConstant %uint 8
+        %335 = OpConstantComposite %v2float %float_1 %float_1
+     %uint_4 = OpConstant %uint 4
+%float_0_00390625 = OpConstant %float 0.00390625
+%float_n0_474999994 = OpConstant %float -0.474999994
+  %float_n16 = OpConstant %float -16
+%float_15_9899998 = OpConstant %float 15.9899998
+        %361 = OpTypeSampledImage %20
+      %false = OpConstantFalse %bool
+  %float_256 = OpConstant %float 256
+        %390 = OpConstantComposite %v4float %float_0_00390625 %float_0_00390625 %float_0_00390625 %float_0_00390625
+        %395 = OpConstantNull %v2float
+        %400 = OpConstantComposite %v2float %float_2 %float_2
+        %402 = OpConstantComposite %v2float %float_3 %float_3
+   %float_n1 = OpConstant %float -1
+%float_n0_333333343 = OpConstant %float -0.333333343
+  %float_255 = OpConstant %float 255
+        %463 = OpConstantComposite %v2float %float_255 %float_255
+        %466 = OpConstantComposite %v2float %float_0_5 %float_0_5
+%float_0_00392156886 = OpConstant %float 0.00392156886
+        %469 = OpConstantComposite %v2float %float_0_00392156886 %float_0_00392156886
+ %float_0_25 = OpConstant %float 0.25
+      %int_4 = OpConstant %int 4
         %594 = OpTypeFunction %FSOut %FSIn
         %597 = OpConstantNull %FSOut
         %601 = OpTypeFunction %void
@@ -258,21 +258,21 @@
       %_59_m = OpVariable %_ptr_Function_v2float Function
       %_60_n = OpVariable %_ptr_Function_float Function
       %_61_o = OpVariable %_ptr_Function_int Function
+      %_84_a = OpVariable %_ptr_Function_v4float Function
+      %_94_f = OpVariable %_ptr_Function_v4float Function
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
+  %_skTemp18 = OpVariable %_ptr_Function_v4float Function %70
+  %_skTemp19 = OpVariable %_ptr_Function_v4float Function %70
       %_62_f = OpVariable %_ptr_Function_v4float Function %70
       %_65_i = OpVariable %_ptr_Function_v2float Function
       %_66_j = OpVariable %_ptr_Function_v4float Function
       %_71_g = OpVariable %_ptr_Function_v4float Function %70
       %_72_h = OpVariable %_ptr_Function_int Function
+      %_83_q = OpVariable %_ptr_Function_v4float Function
 %tint_loop_idx_0 = OpVariable %_ptr_Function_v2uint Function
       %_78_n = OpVariable %_ptr_Function_v2float Function
       %_79_o = OpVariable %_ptr_Function_float Function
       %_80_p = OpVariable %_ptr_Function_float Function
-      %_83_q = OpVariable %_ptr_Function_v4float Function
-      %_84_a = OpVariable %_ptr_Function_v4float Function
-  %_skTemp18 = OpVariable %_ptr_Function_v4float Function %70
-  %_skTemp19 = OpVariable %_ptr_Function_v4float Function %70
-      %_94_f = OpVariable %_ptr_Function_v4float Function
          %39 = OpCompositeExtract %uint %_stageIn 0 1
                OpStore %shadingSsboIndex %39 None
          %40 = OpLoad %uint %shadingSsboIndex None
@@ -307,541 +307,541 @@
                OpStore %_61_o %int_0
                OpBranch %85
          %85 = OpLabel
-               OpStore %tint_loop_idx %92
+               OpStore %tint_loop_idx %160
                OpBranch %88
          %88 = OpLabel
                OpLoopMerge %89 %87 None
                OpBranch %86
          %86 = OpLabel
-         %94 = OpLoad %v2uint %tint_loop_idx None
-         %95 = OpIEqual %v2bool %94 %96
-         %99 = OpAll %bool %95
-               OpSelectionMerge %100 None
-               OpBranchConditional %99 %101 %100
-        %101 = OpLabel
+        %162 = OpLoad %v2uint %tint_loop_idx None
+        %163 = OpIEqual %v2bool %162 %164
+        %166 = OpAll %bool %163
+               OpSelectionMerge %167 None
+               OpBranchConditional %166 %168 %167
+        %168 = OpLabel
                OpBranch %89
-        %100 = OpLabel
-        %102 = OpLoad %int %_61_o None
-        %103 = OpLoad %uint %shadingSsboIndex None
-        %104 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
-        %105 = OpArrayLength %uint %_storage1 0
-        %106 = OpISub %uint %105 %uint_1
-        %107 = OpExtInst %uint %48 UMin %103 %106
-        %108 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %107 %uint_3
-        %110 = OpLoad %int %108 None
-        %111 = OpSLessThan %bool %102 %110
-               OpSelectionMerge %112 None
-               OpBranchConditional %111 %113 %114
-        %113 = OpLabel
-        %116 = OpLoad %v2float %_57_k None
-   %_skTemp2 = OpExtInst %v2float %48 Floor %116
-        %118 = OpLoad %v4float %_62_f None
-        %119 = OpVectorShuffle %v2float %118 %118 2 3
-        %120 = OpCompositeConstruct %v4float %_skTemp2 %119
-               OpStore %_62_f %120 None
-        %121 = OpLoad %v4float %_62_f None
-        %122 = OpVectorShuffle %v2float %121 %121 0 1
-        %123 = OpLoad %v4float %_62_f None
-        %124 = OpVectorShuffle %v2float %123 %123 0 1
-        %125 = OpFAdd %v2float %124 %126
-        %127 = OpCompositeConstruct %v4float %122 %125
-               OpStore %_62_f %127 None
-        %128 = OpLoad %uint %shadingSsboIndex None
-        %129 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
-        %130 = OpArrayLength %uint %_storage1 0
-        %131 = OpISub %uint %130 %uint_1
-        %132 = OpExtInst %uint %48 UMin %128 %131
-        %133 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %132 %uint_4
-        %135 = OpLoad %int %133 None
-        %136 = OpINotEqual %bool %135 %137
-               OpSelectionMerge %138 None
-               OpBranchConditional %136 %139 %138
-        %139 = OpLabel
-        %140 = OpLoad %v2float %_59_m None
-        %141 = OpVectorShuffle %v4float %140 %140 0 1 0 1
-        %142 = OpLoad %v4float %_62_f None
-   %_skTemp3 = OpExtInst %v4float %48 Step %141 %142
-        %144 = OpLoad %v4float %_62_f None
-        %145 = OpLoad %v2float %_59_m None
-        %146 = OpVectorShuffle %v4float %145 %145 0 1 0 1
-        %147 = OpFMul %v4float %_skTemp3 %146
-        %148 = OpFSub %v4float %144 %147
-               OpStore %_62_f %148 None
-               OpBranch %138
-        %138 = OpLabel
-        %149 = OpLoad %20 %permutationsSampler_1_Texture None
-        %150 = OpLoad %17 %permutationsSampler_1_Sampler None
-        %151 = OpAccessChain %_ptr_Function_float %_62_f %uint_0
-        %152 = OpLoad %float %151 None
-        %153 = OpFAdd %float %152 %float_0_5
-        %154 = OpFMul %float %153 %float_0_00390625
-        %156 = OpCompositeConstruct %v2float %154 %float_0_5
-        %157 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
-        %161 = OpSampledImage %162 %149 %150
-        %163 = OpImageSampleImplicitLod %v4float %161 %156 Bias %157
-      %_63_g = OpCompositeExtract %float %163 0
-        %165 = OpLoad %20 %permutationsSampler_1_Texture None
-        %166 = OpLoad %17 %permutationsSampler_1_Sampler None
-        %167 = OpAccessChain %_ptr_Function_float %_62_f %uint_2
-        %168 = OpLoad %float %167 None
-        %169 = OpFAdd %float %168 %float_0_5
-        %170 = OpFMul %float %169 %float_0_00390625
-        %171 = OpCompositeConstruct %v2float %170 %float_0_5
-        %172 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
-        %173 = OpSampledImage %162 %165 %166
-        %174 = OpImageSampleImplicitLod %v4float %173 %171 Bias %172
-      %_64_h = OpCompositeExtract %float %174 0
-        %176 = OpCompositeConstruct %v2float %_63_g %_64_h
-               OpStore %_65_i %176
+        %167 = OpLabel
+        %169 = OpLoad %int %_61_o None
+        %170 = OpLoad %uint %shadingSsboIndex None
+        %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
+        %172 = OpArrayLength %uint %_storage1 0
+        %173 = OpISub %uint %172 %uint_1
+        %174 = OpExtInst %uint %48 UMin %170 %173
+        %175 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %174 %uint_3
+        %176 = OpLoad %int %175 None
+        %177 = OpSLessThan %bool %169 %176
                OpSelectionMerge %178 None
-               OpBranchConditional %false %179 %178
+               OpBranchConditional %177 %179 %180
         %179 = OpLabel
-        %181 = OpLoad %v2float %_65_i None
-        %182 = OpFMul %v2float %181 %183
-        %185 = OpFAdd %v2float %182 %186
-   %_skTemp4 = OpExtInst %v2float %48 Floor %185
-        %188 = OpFMul %v2float %_skTemp4 %189
-               OpStore %_65_i %188 None
-               OpBranch %178
-        %178 = OpLabel
-        %191 = OpLoad %v2float %_65_i None
-        %192 = OpVectorShuffle %v4float %191 %191 0 1 0 1
-        %193 = OpVectorTimesScalar %v4float %192 %float_256
-        %195 = OpLoad %v4float %_62_f None
-        %196 = OpVectorShuffle %v4float %195 %195 1 1 3 3
-        %197 = OpFAdd %v4float %193 %196
-               OpStore %_66_j %197
-        %199 = OpLoad %v4float %_66_j None
-        %200 = OpFMul %v4float %199 %201
-               OpStore %_66_j %200 None
-      %_67_p = OpLoad %v4float %_66_j None
-        %203 = OpLoad %v2float %_57_k None
-   %_skTemp5 = OpExtInst %v2float %48 Fract %203
-        %205 = OpFSub %v2float %_skTemp5 %206
-        %207 = OpFSub %v2float %126 %206
-        %208 = OpFDiv %v2float %205 %207
-        %209 = OpExtInst %v2float %48 NClamp %208 %206 %126
-        %210 = OpFMul %v2float %211 %209
-        %213 = OpFSub %v2float %214 %210
-        %216 = OpFMul %v2float %209 %213
-   %_skTemp6 = OpFMul %v2float %209 %216
-               OpStore %_72_h %int_0
-               OpBranch %220
-        %220 = OpLabel
-               OpStore %tint_loop_idx_0 %92
-               OpBranch %223
-        %223 = OpLabel
-               OpLoopMerge %224 %222 None
-               OpBranch %221
-        %221 = OpLabel
-        %226 = OpLoad %v2uint %tint_loop_idx_0 None
-        %227 = OpIEqual %v2bool %226 %96
-        %228 = OpAll %bool %227
-               OpSelectionMerge %229 None
-               OpBranchConditional %228 %230 %229
-        %230 = OpLabel
-               OpBranch %224
-        %229 = OpLabel
-        %231 = OpLoad %int %_72_h None
-        %232 = OpConvertSToF %float %231
-        %233 = OpFAdd %float %232 %float_0_5
-      %_73_i = OpFMul %float %233 %float_0_25
-        %236 = OpLoad %20 %noiseSampler_1_Texture None
-        %237 = OpLoad %17 %noiseSampler_1_Sampler None
-        %238 = OpCompositeExtract %float %_67_p 0
-        %239 = OpCompositeConstruct %v2float %238 %_73_i
-        %240 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
-        %241 = OpSampledImage %162 %236 %237
-      %_74_j = OpImageSampleImplicitLod %v4float %241 %239 Bias %240
-        %243 = OpLoad %20 %noiseSampler_1_Texture None
-        %244 = OpLoad %17 %noiseSampler_1_Sampler None
-        %245 = OpCompositeExtract %float %_67_p 1
-        %246 = OpCompositeConstruct %v2float %245 %_73_i
-        %247 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
-        %248 = OpSampledImage %162 %243 %244
-      %_75_k = OpImageSampleImplicitLod %v4float %248 %246 Bias %247
-        %250 = OpLoad %20 %noiseSampler_1_Texture None
-        %251 = OpLoad %17 %noiseSampler_1_Sampler None
-        %252 = OpCompositeExtract %float %_67_p 3
-        %253 = OpCompositeConstruct %v2float %252 %_73_i
-        %254 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
-        %255 = OpSampledImage %162 %250 %251
-      %_76_l = OpImageSampleImplicitLod %v4float %255 %253 Bias %254
-        %257 = OpLoad %20 %noiseSampler_1_Texture None
-        %258 = OpLoad %17 %noiseSampler_1_Sampler None
-        %259 = OpCompositeExtract %float %_67_p 2
-        %260 = OpCompositeConstruct %v2float %259 %_73_i
-        %261 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
-        %262 = OpSampledImage %162 %257 %258
-      %_77_m = OpImageSampleImplicitLod %v4float %262 %260 Bias %261
-               OpStore %_78_n %_skTemp5
-        %265 = OpVectorShuffle %v2float %_74_j %_74_j 1 3
-        %266 = OpVectorShuffle %v2float %_74_j %_74_j 0 2
-        %267 = OpVectorTimesScalar %v2float %266 %float_0_00390625
-        %268 = OpFAdd %v2float %265 %267
-        %269 = OpVectorTimesScalar %v2float %268 %float_2
-        %270 = OpCompositeConstruct %v2float %float_1 %float_1
-        %271 = OpFSub %v2float %269 %270
-        %272 = OpLoad %v2float %_78_n None
-   %_skTemp7 = OpDot %float %271 %272
-               OpStore %_79_o %_skTemp7
-        %275 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
-        %276 = OpLoad %float %275 None
-        %277 = OpFSub %float %276 %float_1
-        %278 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
-               OpStore %278 %277 None
-        %279 = OpVectorShuffle %v2float %_75_k %_75_k 1 3
-        %280 = OpVectorShuffle %v2float %_75_k %_75_k 0 2
-        %281 = OpVectorTimesScalar %v2float %280 %float_0_00390625
-        %282 = OpFAdd %v2float %279 %281
-        %283 = OpVectorTimesScalar %v2float %282 %float_2
-        %284 = OpCompositeConstruct %v2float %float_1 %float_1
-        %285 = OpFSub %v2float %283 %284
-        %286 = OpLoad %v2float %_78_n None
-   %_skTemp8 = OpDot %float %285 %286
-               OpStore %_80_p %_skTemp8
-        %289 = OpLoad %float %_79_o None
-        %290 = OpLoad %float %_80_p None
-        %291 = OpCompositeExtract %float %_skTemp6 0
-   %_skTemp9 = OpExtInst %float %48 FMix %289 %290 %291
-        %293 = OpAccessChain %_ptr_Function_float %_78_n %uint_1
-        %294 = OpLoad %float %293 None
-        %295 = OpFSub %float %294 %float_1
-        %296 = OpAccessChain %_ptr_Function_float %_78_n %uint_1
-               OpStore %296 %295 None
-        %297 = OpVectorShuffle %v2float %_76_l %_76_l 1 3
-        %298 = OpVectorShuffle %v2float %_76_l %_76_l 0 2
-        %299 = OpVectorTimesScalar %v2float %298 %float_0_00390625
-        %300 = OpFAdd %v2float %297 %299
-        %301 = OpVectorTimesScalar %v2float %300 %float_2
-        %302 = OpCompositeConstruct %v2float %float_1 %float_1
-        %303 = OpFSub %v2float %301 %302
-        %304 = OpLoad %v2float %_78_n None
-  %_skTemp10 = OpDot %float %303 %304
-               OpStore %_80_p %_skTemp10 None
-        %306 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
-        %307 = OpLoad %float %306 None
-        %308 = OpFAdd %float %307 %float_1
-        %309 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
-               OpStore %309 %308 None
-        %310 = OpVectorShuffle %v2float %_77_m %_77_m 1 3
-        %311 = OpVectorShuffle %v2float %_77_m %_77_m 0 2
-        %312 = OpVectorTimesScalar %v2float %311 %float_0_00390625
-        %313 = OpFAdd %v2float %310 %312
-        %314 = OpVectorTimesScalar %v2float %313 %float_2
-        %315 = OpCompositeConstruct %v2float %float_1 %float_1
-        %316 = OpFSub %v2float %314 %315
-        %317 = OpLoad %v2float %_78_n None
-  %_skTemp11 = OpDot %float %316 %317
-               OpStore %_79_o %_skTemp11 None
-        %319 = OpLoad %float %_79_o None
-        %320 = OpLoad %float %_80_p None
-        %321 = OpCompositeExtract %float %_skTemp6 0
-  %_skTemp12 = OpExtInst %float %48 FMix %319 %320 %321
-        %323 = OpCompositeExtract %float %_skTemp6 1
-  %_skTemp13 = OpExtInst %float %48 FMix %_skTemp9 %_skTemp12 %323
-        %325 = OpLoad %int %_72_h None
-        %326 = OpBitcast %uint %325
-        %327 = OpExtInst %uint %48 UMin %326 %uint_3
-        %328 = OpAccessChain %_ptr_Function_float %_71_g %327
-               OpStore %328 %_skTemp13 None
-               OpBranch %222
-        %222 = OpLabel
-        %329 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-        %331 = OpLoad %uint %329 None
-        %332 = OpISub %uint %331 %uint_1
-        %333 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %333 %332 None
-        %334 = OpIEqual %bool %332 %uint_4294967295
-        %335 = OpSelect %uint %334 %uint_1 %uint_0
-        %336 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-        %337 = OpLoad %uint %336 None
-        %338 = OpISub %uint %337 %335
-        %339 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %339 %338 None
-        %340 = OpLoad %int %_72_h None
-        %341 = OpIAdd %int %340 %int_1
-               OpStore %_72_h %341 None
-        %343 = OpLoad %int %_72_h None
-        %344 = OpSGreaterThanEqual %bool %343 %int_4
-               OpBranchConditional %344 %224 %223
-        %224 = OpLabel
-        %346 = OpLoad %v4float %_71_g None
-               OpStore %_83_q %346
-        %348 = OpINotEqual %bool %_56_d %int_0
-               OpSelectionMerge %349 None
-               OpBranchConditional %348 %350 %349
-        %350 = OpLabel
-        %351 = OpLoad %v4float %_83_q None
-  %_skTemp14 = OpExtInst %v4float %48 FAbs %351
-               OpStore %_83_q %_skTemp14 None
-               OpBranch %349
-        %349 = OpLabel
-        %353 = OpLoad %v4float %_58_l None
-        %354 = OpLoad %v4float %_83_q None
-        %355 = OpLoad %float %_60_n None
-        %356 = OpVectorTimesScalar %v4float %354 %355
-        %357 = OpFAdd %v4float %353 %356
-               OpStore %_58_l %357 None
-        %358 = OpLoad %v2float %_57_k None
-        %359 = OpFMul %v2float %358 %211
-               OpStore %_57_k %359 None
-        %360 = OpLoad %float %_60_n None
-        %361 = OpFMul %float %360 %float_0_5
-               OpStore %_60_n %361 None
-        %362 = OpLoad %v2float %_59_m None
-        %363 = OpFMul %v2float %362 %211
-               OpStore %_59_m %363 None
-               OpBranch %112
-        %114 = OpLabel
-               OpBranch %89
-        %112 = OpLabel
-               OpBranch %87
-         %87 = OpLabel
-        %364 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-        %365 = OpLoad %uint %364 None
-        %366 = OpISub %uint %365 %uint_1
-        %367 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %367 %366 None
-        %368 = OpIEqual %bool %366 %uint_4294967295
-        %369 = OpSelect %uint %368 %uint_1 %uint_0
-        %370 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-        %371 = OpLoad %uint %370 None
-        %372 = OpISub %uint %371 %369
-        %373 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %373 %372 None
-        %374 = OpLoad %int %_61_o None
-        %375 = OpIAdd %int %374 %int_1
-               OpStore %_61_o %375 None
-               OpBranch %88
-         %89 = OpLabel
-        %376 = OpIEqual %bool %_56_d %int_0
+        %325 = OpLoad %v2float %_57_k None
+   %_skTemp2 = OpExtInst %v2float %48 Floor %325
+        %327 = OpLoad %v4float %_62_f None
+        %328 = OpVectorShuffle %v2float %327 %327 2 3
+        %329 = OpCompositeConstruct %v4float %_skTemp2 %328
+               OpStore %_62_f %329 None
+        %330 = OpLoad %v4float %_62_f None
+        %331 = OpVectorShuffle %v2float %330 %330 0 1
+        %332 = OpLoad %v4float %_62_f None
+        %333 = OpVectorShuffle %v2float %332 %332 0 1
+        %334 = OpFAdd %v2float %333 %335
+        %336 = OpCompositeConstruct %v4float %331 %334
+               OpStore %_62_f %336 None
+        %337 = OpLoad %uint %shadingSsboIndex None
+        %338 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
+        %339 = OpArrayLength %uint %_storage1 0
+        %340 = OpISub %uint %339 %uint_1
+        %341 = OpExtInst %uint %48 UMin %337 %340
+        %342 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %341 %uint_4
+        %344 = OpLoad %int %342 None
+        %345 = OpINotEqual %bool %344 %126
+               OpSelectionMerge %346 None
+               OpBranchConditional %345 %347 %346
+        %347 = OpLabel
+        %452 = OpLoad %v2float %_59_m None
+        %453 = OpVectorShuffle %v4float %452 %452 0 1 0 1
+        %454 = OpLoad %v4float %_62_f None
+   %_skTemp3 = OpExtInst %v4float %48 Step %453 %454
+        %456 = OpLoad %v4float %_62_f None
+        %457 = OpLoad %v2float %_59_m None
+        %458 = OpVectorShuffle %v4float %457 %457 0 1 0 1
+        %459 = OpFMul %v4float %_skTemp3 %458
+        %460 = OpFSub %v4float %456 %459
+               OpStore %_62_f %460 None
+               OpBranch %346
+        %346 = OpLabel
+        %348 = OpLoad %20 %permutationsSampler_1_Texture None
+        %349 = OpLoad %17 %permutationsSampler_1_Sampler None
+        %350 = OpAccessChain %_ptr_Function_float %_62_f %uint_0
+        %351 = OpLoad %float %350 None
+        %352 = OpFAdd %float %351 %float_0_5
+        %353 = OpFMul %float %352 %float_0_00390625
+        %355 = OpCompositeConstruct %v2float %353 %float_0_5
+        %356 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
+        %360 = OpSampledImage %361 %348 %349
+        %362 = OpImageSampleImplicitLod %v4float %360 %355 Bias %356
+      %_63_g = OpCompositeExtract %float %362 0
+        %364 = OpLoad %20 %permutationsSampler_1_Texture None
+        %365 = OpLoad %17 %permutationsSampler_1_Sampler None
+        %366 = OpAccessChain %_ptr_Function_float %_62_f %uint_2
+        %367 = OpLoad %float %366 None
+        %368 = OpFAdd %float %367 %float_0_5
+        %369 = OpFMul %float %368 %float_0_00390625
+        %370 = OpCompositeConstruct %v2float %369 %float_0_5
+        %371 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
+        %372 = OpSampledImage %361 %364 %365
+        %373 = OpImageSampleImplicitLod %v4float %372 %370 Bias %371
+      %_64_h = OpCompositeExtract %float %373 0
+        %375 = OpCompositeConstruct %v2float %_63_g %_64_h
+               OpStore %_65_i %375
                OpSelectionMerge %377 None
-               OpBranchConditional %376 %378 %377
+               OpBranchConditional %false %378 %377
         %378 = OpLabel
-        %379 = OpLoad %v4float %_58_l None
-        %380 = OpFMul %v4float %379 %381
-        %382 = OpFAdd %v4float %380 %381
-               OpStore %_58_l %382 None
+        %461 = OpLoad %v2float %_65_i None
+        %462 = OpFMul %v2float %461 %463
+        %465 = OpFAdd %v2float %462 %466
+   %_skTemp4 = OpExtInst %v2float %48 Floor %465
+        %468 = OpFMul %v2float %_skTemp4 %469
+               OpStore %_65_i %468 None
                OpBranch %377
         %377 = OpLabel
-        %383 = OpLoad %v4float %_58_l None
-  %_skTemp15 = OpExtInst %v4float %48 NClamp %383 %70 %385
-               OpStore %_58_l %_skTemp15 None
-        %386 = OpLoad %v4float %_58_l None
-        %387 = OpVectorShuffle %v3float %386 %386 0 1 2
-        %389 = OpAccessChain %_ptr_Function_float %_58_l %uint_3
-        %390 = OpLoad %float %389 None
-        %391 = OpVectorTimesScalar %v3float %387 %390
-        %392 = OpAccessChain %_ptr_Function_float %_58_l %uint_3
-        %393 = OpLoad %float %392 None
-        %394 = OpCompositeConstruct %v4float %391 %393
-        %395 = OpVectorShuffle %v3float %394 %394 0 1 2
-  %_skTemp16 = OpDot %float %397 %395
-  %_skTemp17 = OpExtInst %float %48 NClamp %_skTemp16 %float_0 %float_1
-        %403 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %_skTemp17
-               OpStore %_84_a %403
-        %405 = OpLoad %uint %shadingSsboIndex None
-        %406 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
-        %407 = OpArrayLength %uint %_storage1 0
-        %408 = OpISub %uint %407 %uint_1
-        %409 = OpExtInst %uint %48 UMin %405 %408
-        %410 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %409 %uint_7
-      %_85_d = OpLoad %int %410 None
-        %413 = OpINotEqual %bool %_85_d %137
-               OpSelectionMerge %414 None
-               OpBranchConditional %413 %415 %416
+        %380 = OpLoad %v2float %_65_i None
+        %381 = OpVectorShuffle %v4float %380 %380 0 1 0 1
+        %382 = OpVectorTimesScalar %v4float %381 %float_256
+        %384 = OpLoad %v4float %_62_f None
+        %385 = OpVectorShuffle %v4float %384 %384 1 1 3 3
+        %386 = OpFAdd %v4float %382 %385
+               OpStore %_66_j %386
+        %388 = OpLoad %v4float %_66_j None
+        %389 = OpFMul %v4float %388 %390
+               OpStore %_66_j %389 None
+      %_67_p = OpLoad %v4float %_66_j None
+        %392 = OpLoad %v2float %_57_k None
+   %_skTemp5 = OpExtInst %v2float %48 Fract %392
+        %394 = OpFSub %v2float %_skTemp5 %395
+        %396 = OpFSub %v2float %335 %395
+        %397 = OpFDiv %v2float %394 %396
+        %398 = OpExtInst %v2float %48 NClamp %397 %395 %335
+        %399 = OpFMul %v2float %400 %398
+        %401 = OpFSub %v2float %402 %399
+        %403 = OpFMul %v2float %398 %401
+   %_skTemp6 = OpFMul %v2float %398 %403
+               OpStore %_72_h %int_0
+               OpBranch %407
+        %407 = OpLabel
+               OpStore %tint_loop_idx_0 %160
+               OpBranch %410
+        %410 = OpLabel
+               OpLoopMerge %411 %409 None
+               OpBranch %408
+        %408 = OpLabel
+        %472 = OpLoad %v2uint %tint_loop_idx_0 None
+        %473 = OpIEqual %v2bool %472 %164
+        %474 = OpAll %bool %473
+               OpSelectionMerge %475 None
+               OpBranchConditional %474 %476 %475
+        %476 = OpLabel
+               OpBranch %411
+        %475 = OpLabel
+        %477 = OpLoad %int %_72_h None
+        %478 = OpConvertSToF %float %477
+        %479 = OpFAdd %float %478 %float_0_5
+      %_73_i = OpFMul %float %479 %float_0_25
+        %482 = OpLoad %20 %noiseSampler_1_Texture None
+        %483 = OpLoad %17 %noiseSampler_1_Sampler None
+        %484 = OpCompositeExtract %float %_67_p 0
+        %485 = OpCompositeConstruct %v2float %484 %_73_i
+        %486 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
+        %487 = OpSampledImage %361 %482 %483
+      %_74_j = OpImageSampleImplicitLod %v4float %487 %485 Bias %486
+        %489 = OpLoad %20 %noiseSampler_1_Texture None
+        %490 = OpLoad %17 %noiseSampler_1_Sampler None
+        %491 = OpCompositeExtract %float %_67_p 1
+        %492 = OpCompositeConstruct %v2float %491 %_73_i
+        %493 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
+        %494 = OpSampledImage %361 %489 %490
+      %_75_k = OpImageSampleImplicitLod %v4float %494 %492 Bias %493
+        %496 = OpLoad %20 %noiseSampler_1_Texture None
+        %497 = OpLoad %17 %noiseSampler_1_Sampler None
+        %498 = OpCompositeExtract %float %_67_p 3
+        %499 = OpCompositeConstruct %v2float %498 %_73_i
+        %500 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
+        %501 = OpSampledImage %361 %496 %497
+      %_76_l = OpImageSampleImplicitLod %v4float %501 %499 Bias %500
+        %503 = OpLoad %20 %noiseSampler_1_Texture None
+        %504 = OpLoad %17 %noiseSampler_1_Sampler None
+        %505 = OpCompositeExtract %float %_67_p 2
+        %506 = OpCompositeConstruct %v2float %505 %_73_i
+        %507 = OpExtInst %float %48 NClamp %float_n0_474999994 %float_n16 %float_15_9899998
+        %508 = OpSampledImage %361 %503 %504
+      %_77_m = OpImageSampleImplicitLod %v4float %508 %506 Bias %507
+               OpStore %_78_n %_skTemp5
+        %511 = OpVectorShuffle %v2float %_74_j %_74_j 1 3
+        %512 = OpVectorShuffle %v2float %_74_j %_74_j 0 2
+        %513 = OpVectorTimesScalar %v2float %512 %float_0_00390625
+        %514 = OpFAdd %v2float %511 %513
+        %515 = OpVectorTimesScalar %v2float %514 %float_2
+        %516 = OpCompositeConstruct %v2float %float_1 %float_1
+        %517 = OpFSub %v2float %515 %516
+        %518 = OpLoad %v2float %_78_n None
+   %_skTemp7 = OpDot %float %517 %518
+               OpStore %_79_o %_skTemp7
+        %521 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
+        %522 = OpLoad %float %521 None
+        %523 = OpFSub %float %522 %float_1
+        %524 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
+               OpStore %524 %523 None
+        %525 = OpVectorShuffle %v2float %_75_k %_75_k 1 3
+        %526 = OpVectorShuffle %v2float %_75_k %_75_k 0 2
+        %527 = OpVectorTimesScalar %v2float %526 %float_0_00390625
+        %528 = OpFAdd %v2float %525 %527
+        %529 = OpVectorTimesScalar %v2float %528 %float_2
+        %530 = OpCompositeConstruct %v2float %float_1 %float_1
+        %531 = OpFSub %v2float %529 %530
+        %532 = OpLoad %v2float %_78_n None
+   %_skTemp8 = OpDot %float %531 %532
+               OpStore %_80_p %_skTemp8
+        %535 = OpLoad %float %_79_o None
+        %536 = OpLoad %float %_80_p None
+        %537 = OpCompositeExtract %float %_skTemp6 0
+   %_skTemp9 = OpExtInst %float %48 FMix %535 %536 %537
+        %539 = OpAccessChain %_ptr_Function_float %_78_n %uint_1
+        %540 = OpLoad %float %539 None
+        %541 = OpFSub %float %540 %float_1
+        %542 = OpAccessChain %_ptr_Function_float %_78_n %uint_1
+               OpStore %542 %541 None
+        %543 = OpVectorShuffle %v2float %_76_l %_76_l 1 3
+        %544 = OpVectorShuffle %v2float %_76_l %_76_l 0 2
+        %545 = OpVectorTimesScalar %v2float %544 %float_0_00390625
+        %546 = OpFAdd %v2float %543 %545
+        %547 = OpVectorTimesScalar %v2float %546 %float_2
+        %548 = OpCompositeConstruct %v2float %float_1 %float_1
+        %549 = OpFSub %v2float %547 %548
+        %550 = OpLoad %v2float %_78_n None
+  %_skTemp10 = OpDot %float %549 %550
+               OpStore %_80_p %_skTemp10 None
+        %552 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
+        %553 = OpLoad %float %552 None
+        %554 = OpFAdd %float %553 %float_1
+        %555 = OpAccessChain %_ptr_Function_float %_78_n %uint_0
+               OpStore %555 %554 None
+        %556 = OpVectorShuffle %v2float %_77_m %_77_m 1 3
+        %557 = OpVectorShuffle %v2float %_77_m %_77_m 0 2
+        %558 = OpVectorTimesScalar %v2float %557 %float_0_00390625
+        %559 = OpFAdd %v2float %556 %558
+        %560 = OpVectorTimesScalar %v2float %559 %float_2
+        %561 = OpCompositeConstruct %v2float %float_1 %float_1
+        %562 = OpFSub %v2float %560 %561
+        %563 = OpLoad %v2float %_78_n None
+  %_skTemp11 = OpDot %float %562 %563
+               OpStore %_79_o %_skTemp11 None
+        %565 = OpLoad %float %_79_o None
+        %566 = OpLoad %float %_80_p None
+        %567 = OpCompositeExtract %float %_skTemp6 0
+  %_skTemp12 = OpExtInst %float %48 FMix %565 %566 %567
+        %569 = OpCompositeExtract %float %_skTemp6 1
+  %_skTemp13 = OpExtInst %float %48 FMix %_skTemp9 %_skTemp12 %569
+        %571 = OpLoad %int %_72_h None
+        %572 = OpBitcast %uint %571
+        %573 = OpExtInst %uint %48 UMin %572 %uint_3
+        %574 = OpAccessChain %_ptr_Function_float %_71_g %573
+               OpStore %574 %_skTemp13 None
+               OpBranch %409
+        %409 = OpLabel
+        %575 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+        %576 = OpLoad %uint %575 None
+        %577 = OpISub %uint %576 %uint_1
+        %578 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %578 %577 None
+        %579 = OpIEqual %bool %577 %uint_4294967295
+        %580 = OpSelect %uint %579 %uint_1 %uint_0
+        %581 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+        %582 = OpLoad %uint %581 None
+        %583 = OpISub %uint %582 %580
+        %584 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %584 %583 None
+        %585 = OpLoad %int %_72_h None
+        %586 = OpIAdd %int %585 %int_1
+               OpStore %_72_h %586 None
+        %587 = OpLoad %int %_72_h None
+        %588 = OpSGreaterThanEqual %bool %587 %int_4
+               OpBranchConditional %588 %411 %410
+        %411 = OpLabel
+        %412 = OpLoad %v4float %_71_g None
+               OpStore %_83_q %412
+        %414 = OpINotEqual %bool %_56_d %int_0
+               OpSelectionMerge %415 None
+               OpBranchConditional %414 %416 %415
+        %416 = OpLabel
+        %590 = OpLoad %v4float %_83_q None
+  %_skTemp14 = OpExtInst %v4float %48 FAbs %590
+               OpStore %_83_q %_skTemp14 None
+               OpBranch %415
         %415 = OpLabel
-        %418 = OpAccessChain %_ptr_Function_float %_84_a %uint_1
-        %419 = OpLoad %float %418 None
-        %420 = OpAccessChain %_ptr_Function_float %_84_a %uint_2
-        %421 = OpLoad %float %420 None
-        %422 = OpFOrdLessThan %bool %419 %421
-               OpSelectionMerge %423 None
-               OpBranchConditional %422 %424 %425
-        %424 = OpLabel
-        %426 = OpLoad %v4float %_84_a None
-        %427 = OpVectorShuffle %v2float %426 %426 2 1
-        %428 = OpCompositeConstruct %v4float %427 %float_n1 %float_0_666666687
-               OpStore %_skTemp18 %428 None
-               OpBranch %423
-        %425 = OpLabel
-        %431 = OpLoad %v4float %_84_a None
-        %432 = OpVectorShuffle %v2float %431 %431 1 2
-        %433 = OpCompositeConstruct %v4float %432 %float_0 %float_n0_333333343
-               OpStore %_skTemp18 %433 None
-               OpBranch %423
-        %423 = OpLabel
+        %417 = OpLoad %v4float %_58_l None
+        %418 = OpLoad %v4float %_83_q None
+        %419 = OpLoad %float %_60_n None
+        %420 = OpVectorTimesScalar %v4float %418 %419
+        %421 = OpFAdd %v4float %417 %420
+               OpStore %_58_l %421 None
+        %422 = OpLoad %v2float %_57_k None
+        %423 = OpFMul %v2float %422 %400
+               OpStore %_57_k %423 None
+        %424 = OpLoad %float %_60_n None
+        %425 = OpFMul %float %424 %float_0_5
+               OpStore %_60_n %425 None
+        %426 = OpLoad %v2float %_59_m None
+        %427 = OpFMul %v2float %426 %400
+               OpStore %_59_m %427 None
+               OpBranch %178
+        %180 = OpLabel
+               OpBranch %89
+        %178 = OpLabel
+               OpBranch %87
+         %87 = OpLabel
+        %181 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+        %183 = OpLoad %uint %181 None
+        %184 = OpISub %uint %183 %uint_1
+        %185 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %185 %184 None
+        %186 = OpIEqual %bool %184 %uint_4294967295
+        %187 = OpSelect %uint %186 %uint_1 %uint_0
+        %188 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+        %189 = OpLoad %uint %188 None
+        %190 = OpISub %uint %189 %187
+        %191 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %191 %190 None
+        %192 = OpLoad %int %_61_o None
+        %193 = OpIAdd %int %192 %int_1
+               OpStore %_61_o %193 None
+               OpBranch %88
+         %89 = OpLabel
+         %90 = OpIEqual %bool %_56_d %int_0
+               OpSelectionMerge %92 None
+               OpBranchConditional %90 %93 %92
+         %93 = OpLabel
+        %195 = OpLoad %v4float %_58_l None
+        %196 = OpFMul %v4float %195 %197
+        %198 = OpFAdd %v4float %196 %197
+               OpStore %_58_l %198 None
+               OpBranch %92
+         %92 = OpLabel
+         %94 = OpLoad %v4float %_58_l None
+  %_skTemp15 = OpExtInst %v4float %48 NClamp %94 %70 %96
+               OpStore %_58_l %_skTemp15 None
+         %97 = OpLoad %v4float %_58_l None
+         %98 = OpVectorShuffle %v3float %97 %97 0 1 2
+        %100 = OpAccessChain %_ptr_Function_float %_58_l %uint_3
+        %102 = OpLoad %float %100 None
+        %103 = OpVectorTimesScalar %v3float %98 %102
+        %104 = OpAccessChain %_ptr_Function_float %_58_l %uint_3
+        %105 = OpLoad %float %104 None
+        %106 = OpCompositeConstruct %v4float %103 %105
+        %107 = OpVectorShuffle %v3float %106 %106 0 1 2
+  %_skTemp16 = OpDot %float %109 %107
+  %_skTemp17 = OpExtInst %float %48 NClamp %_skTemp16 %float_0 %float_1
+        %115 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %_skTemp17
+               OpStore %_84_a %115
+        %117 = OpLoad %uint %shadingSsboIndex None
+        %118 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
+        %119 = OpArrayLength %uint %_storage1 0
+        %120 = OpISub %uint %119 %uint_1
+        %121 = OpExtInst %uint %48 UMin %117 %120
+        %122 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %121 %uint_7
+      %_85_d = OpLoad %int %122 None
+        %125 = OpINotEqual %bool %_85_d %126
+               OpSelectionMerge %127 None
+               OpBranchConditional %125 %128 %129
+        %128 = OpLabel
+        %200 = OpAccessChain %_ptr_Function_float %_84_a %uint_1
+        %201 = OpLoad %float %200 None
+        %202 = OpAccessChain %_ptr_Function_float %_84_a %uint_2
+        %203 = OpLoad %float %202 None
+        %204 = OpFOrdLessThan %bool %201 %203
+               OpSelectionMerge %205 None
+               OpBranchConditional %204 %206 %207
+        %206 = OpLabel
+        %428 = OpLoad %v4float %_84_a None
+        %429 = OpVectorShuffle %v2float %428 %428 2 1
+        %430 = OpCompositeConstruct %v4float %429 %float_n1 %float_0_666666687
+               OpStore %_skTemp18 %430 None
+               OpBranch %205
+        %207 = OpLabel
+        %432 = OpLoad %v4float %_84_a None
+        %433 = OpVectorShuffle %v2float %432 %432 1 2
+        %434 = OpCompositeConstruct %v4float %433 %float_0 %float_n0_333333343
+               OpStore %_skTemp18 %434 None
+               OpBranch %205
+        %205 = OpLabel
       %_86_e = OpLoad %v4float %_skTemp18 None
+        %210 = OpAccessChain %_ptr_Function_float %_84_a %uint_0
+        %211 = OpLoad %float %210 None
+        %212 = OpCompositeExtract %float %_86_e 0
+        %213 = OpFOrdLessThan %bool %211 %212
+               OpSelectionMerge %214 None
+               OpBranchConditional %213 %215 %216
+        %215 = OpLabel
+        %436 = OpCompositeExtract %float %_86_e 0
         %437 = OpAccessChain %_ptr_Function_float %_84_a %uint_0
         %438 = OpLoad %float %437 None
-        %439 = OpCompositeExtract %float %_86_e 0
-        %440 = OpFOrdLessThan %bool %438 %439
-               OpSelectionMerge %441 None
-               OpBranchConditional %440 %442 %443
-        %442 = OpLabel
-        %444 = OpCompositeExtract %float %_86_e 0
-        %445 = OpAccessChain %_ptr_Function_float %_84_a %uint_0
-        %446 = OpLoad %float %445 None
-        %447 = OpVectorShuffle %v2float %_86_e %_86_e 1 3
-        %448 = OpCompositeConstruct %v4float %444 %446 %447
-               OpStore %_skTemp19 %448 None
-               OpBranch %441
-        %443 = OpLabel
-        %449 = OpAccessChain %_ptr_Function_float %_84_a %uint_0
-        %450 = OpLoad %float %449 None
-        %451 = OpCompositeExtract %float %_86_e 0
-        %452 = OpVectorShuffle %v2float %_86_e %_86_e 1 2
-        %453 = OpCompositeConstruct %v4float %450 %451 %452
-               OpStore %_skTemp19 %453 None
-               OpBranch %441
-        %441 = OpLabel
+        %439 = OpVectorShuffle %v2float %_86_e %_86_e 1 3
+        %440 = OpCompositeConstruct %v4float %436 %438 %439
+               OpStore %_skTemp19 %440 None
+               OpBranch %214
+        %216 = OpLabel
+        %441 = OpAccessChain %_ptr_Function_float %_84_a %uint_0
+        %442 = OpLoad %float %441 None
+        %443 = OpCompositeExtract %float %_86_e 0
+        %444 = OpVectorShuffle %v2float %_86_e %_86_e 1 2
+        %445 = OpCompositeConstruct %v4float %442 %443 %444
+               OpStore %_skTemp19 %445 None
+               OpBranch %214
+        %214 = OpLabel
       %_87_f = OpLoad %v4float %_skTemp19 None
       %_88_h = OpCompositeExtract %float %_87_f 0
-        %456 = OpCompositeExtract %float %_87_f 1
-        %457 = OpCompositeExtract %float %_87_f 2
-  %_skTemp20 = OpExtInst %float %48 FMin %456 %457
+        %219 = OpCompositeExtract %float %_87_f 1
+        %220 = OpCompositeExtract %float %_87_f 2
+  %_skTemp20 = OpExtInst %float %48 FMin %219 %220
       %_89_i = OpFSub %float %_88_h %_skTemp20
-        %460 = OpFMul %float %_89_i %float_0_5
-      %_90_j = OpFSub %float %_88_h %460
-        %462 = OpCompositeExtract %float %_87_f 3
-        %463 = OpCompositeExtract %float %_87_f 1
-        %464 = OpCompositeExtract %float %_87_f 2
-        %465 = OpFSub %float %463 %464
-        %466 = OpFMul %float %_89_i %float_6
-        %468 = OpFAdd %float %466 %float_9_99999975en05
-        %470 = OpFDiv %float %465 %468
-        %471 = OpFAdd %float %462 %470
-  %_skTemp21 = OpExtInst %float %48 FAbs %471
-        %473 = OpFMul %float %_90_j %float_2
-        %474 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
-        %475 = OpLoad %float %474 None
-        %476 = OpFSub %float %473 %475
-  %_skTemp22 = OpExtInst %float %48 FAbs %476
-        %478 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
-        %479 = OpLoad %float %478 None
-        %480 = OpFAdd %float %479 %float_9_99999975en05
-        %481 = OpFSub %float %480 %_skTemp22
-      %_92_l = OpFDiv %float %_89_i %481
-        %483 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
-        %484 = OpLoad %float %483 None
-        %485 = OpFAdd %float %484 %float_9_99999975en05
-      %_93_m = OpFDiv %float %_90_j %485
-        %487 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
-        %488 = OpLoad %float %487 None
-        %489 = OpCompositeConstruct %v4float %_skTemp21 %_92_l %_93_m %488
-               OpStore %_84_a %489 None
-               OpBranch %414
-        %416 = OpLabel
-        %490 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
-        %491 = OpLoad %float %490 None
-  %_skTemp23 = OpExtInst %float %48 FMax %491 %float_9_99999975en05
-        %493 = OpLoad %v4float %_84_a None
-        %494 = OpVectorShuffle %v3float %493 %493 0 1 2
-        %495 = OpCompositeConstruct %v3float %_skTemp23 %_skTemp23 %_skTemp23
-        %496 = OpFDiv %v3float %494 %495
-        %497 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
-        %498 = OpLoad %float %497 None
-        %499 = OpCompositeConstruct %v4float %496 %498
-               OpStore %_84_a %499 None
-               OpBranch %414
-        %414 = OpLabel
-        %500 = OpLoad %uint %shadingSsboIndex None
-        %501 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
-        %502 = OpArrayLength %uint %_storage1 0
-        %503 = OpISub %uint %502 %uint_1
-        %504 = OpExtInst %uint %48 UMin %500 %503
-        %505 = OpAccessChain %_ptr_StorageBuffer_mat4v4float %_storage1 %uint_0 %504 %uint_5
-        %508 = OpLoad %mat4v4float %505 None
-        %509 = OpLoad %v4float %_84_a None
-        %510 = OpMatrixTimesVector %v4float %508 %509
-        %511 = OpLoad %uint %shadingSsboIndex None
-        %512 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
-        %513 = OpArrayLength %uint %_storage1 0
-        %514 = OpISub %uint %513 %uint_1
-        %515 = OpExtInst %uint %48 UMin %511 %514
-        %516 = OpAccessChain %_ptr_StorageBuffer_v4float %_storage1 %uint_0 %515 %uint_6
-        %519 = OpLoad %v4float %516 None
-        %520 = OpFAdd %v4float %510 %519
-               OpStore %_94_f %520
-        %522 = OpINotEqual %bool %_85_d %137
-               OpSelectionMerge %523 None
-               OpBranchConditional %522 %524 %525
-        %524 = OpLabel
-        %526 = OpAccessChain %_ptr_Function_float %_94_f %uint_2
-        %527 = OpLoad %float %526 None
-        %528 = OpFMul %float %float_2 %527
-        %529 = OpFSub %float %528 %float_1
-  %_skTemp24 = OpExtInst %float %48 FAbs %529
-        %531 = OpFSub %float %float_1 %_skTemp24
-        %532 = OpAccessChain %_ptr_Function_float %_94_f %uint_1
-        %533 = OpLoad %float %532 None
-      %_95_b = OpFMul %float %531 %533
-        %535 = OpLoad %v4float %_94_f None
-        %536 = OpVectorShuffle %v3float %535 %535 0 0 0
-      %_96_c = OpFAdd %v3float %536 %538
+        %223 = OpFMul %float %_89_i %float_0_5
+      %_90_j = OpFSub %float %_88_h %223
+        %225 = OpCompositeExtract %float %_87_f 3
+        %226 = OpCompositeExtract %float %_87_f 1
+        %227 = OpCompositeExtract %float %_87_f 2
+        %228 = OpFSub %float %226 %227
+        %229 = OpFMul %float %_89_i %float_6
+        %231 = OpFAdd %float %229 %float_9_99999975en05
+        %233 = OpFDiv %float %228 %231
+        %234 = OpFAdd %float %225 %233
+  %_skTemp21 = OpExtInst %float %48 FAbs %234
+        %236 = OpFMul %float %_90_j %float_2
+        %238 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
+        %239 = OpLoad %float %238 None
+        %240 = OpFSub %float %236 %239
+  %_skTemp22 = OpExtInst %float %48 FAbs %240
+        %242 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
+        %243 = OpLoad %float %242 None
+        %244 = OpFAdd %float %243 %float_9_99999975en05
+        %245 = OpFSub %float %244 %_skTemp22
+      %_92_l = OpFDiv %float %_89_i %245
+        %247 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
+        %248 = OpLoad %float %247 None
+        %249 = OpFAdd %float %248 %float_9_99999975en05
+      %_93_m = OpFDiv %float %_90_j %249
+        %251 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
+        %252 = OpLoad %float %251 None
+        %253 = OpCompositeConstruct %v4float %_skTemp21 %_92_l %_93_m %252
+               OpStore %_84_a %253 None
+               OpBranch %127
+        %129 = OpLabel
+        %254 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
+        %255 = OpLoad %float %254 None
+  %_skTemp23 = OpExtInst %float %48 FMax %255 %float_9_99999975en05
+        %257 = OpLoad %v4float %_84_a None
+        %258 = OpVectorShuffle %v3float %257 %257 0 1 2
+        %259 = OpCompositeConstruct %v3float %_skTemp23 %_skTemp23 %_skTemp23
+        %260 = OpFDiv %v3float %258 %259
+        %261 = OpAccessChain %_ptr_Function_float %_84_a %uint_3
+        %262 = OpLoad %float %261 None
+        %263 = OpCompositeConstruct %v4float %260 %262
+               OpStore %_84_a %263 None
+               OpBranch %127
+        %127 = OpLabel
+        %130 = OpLoad %uint %shadingSsboIndex None
+        %131 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
+        %132 = OpArrayLength %uint %_storage1 0
+        %133 = OpISub %uint %132 %uint_1
+        %134 = OpExtInst %uint %48 UMin %130 %133
+        %135 = OpAccessChain %_ptr_StorageBuffer_mat4v4float %_storage1 %uint_0 %134 %uint_5
+        %138 = OpLoad %mat4v4float %135 None
+        %139 = OpLoad %v4float %_84_a None
+        %140 = OpMatrixTimesVector %v4float %138 %139
+        %141 = OpLoad %uint %shadingSsboIndex None
+        %142 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
+        %143 = OpArrayLength %uint %_storage1 0
+        %144 = OpISub %uint %143 %uint_1
+        %145 = OpExtInst %uint %48 UMin %141 %144
+        %146 = OpAccessChain %_ptr_StorageBuffer_v4float %_storage1 %uint_0 %145 %uint_6
+        %149 = OpLoad %v4float %146 None
+        %150 = OpFAdd %v4float %140 %149
+               OpStore %_94_f %150
+        %152 = OpINotEqual %bool %_85_d %126
+               OpSelectionMerge %153 None
+               OpBranchConditional %152 %154 %155
+        %154 = OpLabel
+        %264 = OpAccessChain %_ptr_Function_float %_94_f %uint_2
+        %265 = OpLoad %float %264 None
+        %266 = OpFMul %float %float_2 %265
+        %267 = OpFSub %float %266 %float_1
+  %_skTemp24 = OpExtInst %float %48 FAbs %267
+        %269 = OpFSub %float %float_1 %_skTemp24
+        %270 = OpAccessChain %_ptr_Function_float %_94_f %uint_1
+        %271 = OpLoad %float %270 None
+      %_95_b = OpFMul %float %269 %271
+        %273 = OpLoad %v4float %_94_f None
+        %274 = OpVectorShuffle %v3float %273 %273 0 0 0
+      %_96_c = OpFAdd %v3float %274 %276
   %_skTemp25 = OpExtInst %v3float %48 Fract %_96_c
-        %541 = OpVectorTimesScalar %v3float %_skTemp25 %float_6
-        %542 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
-        %543 = OpFSub %v3float %541 %542
-  %_skTemp26 = OpExtInst %v3float %48 FAbs %543
-        %545 = OpCompositeConstruct %v3float %float_1 %float_1 %float_1
-        %546 = OpFSub %v3float %_skTemp26 %545
-  %_skTemp27 = OpExtInst %v3float %48 NClamp %546 %548 %549
-        %550 = OpCompositeConstruct %v3float %float_0_5 %float_0_5 %float_0_5
-        %551 = OpFSub %v3float %_skTemp27 %550
-        %552 = OpVectorTimesScalar %v3float %551 %_95_b
-        %553 = OpAccessChain %_ptr_Function_float %_94_f %uint_2
-        %554 = OpLoad %float %553 None
-        %555 = OpCompositeConstruct %v3float %554 %554 %554
-        %556 = OpFAdd %v3float %552 %555
-        %557 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
-        %558 = OpLoad %float %557 None
-        %559 = OpVectorTimesScalar %v3float %556 %558
-        %560 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
-        %561 = OpLoad %float %560 None
-        %562 = OpCompositeConstruct %v4float %559 %561
-  %_skTemp28 = OpExtInst %v4float %48 NClamp %562 %70 %385
+        %280 = OpVectorTimesScalar %v3float %_skTemp25 %float_6
+        %281 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3
+        %283 = OpFSub %v3float %280 %281
+  %_skTemp26 = OpExtInst %v3float %48 FAbs %283
+        %285 = OpCompositeConstruct %v3float %float_1 %float_1 %float_1
+        %286 = OpFSub %v3float %_skTemp26 %285
+  %_skTemp27 = OpExtInst %v3float %48 NClamp %286 %288 %289
+        %290 = OpCompositeConstruct %v3float %float_0_5 %float_0_5 %float_0_5
+        %291 = OpFSub %v3float %_skTemp27 %290
+        %292 = OpVectorTimesScalar %v3float %291 %_95_b
+        %293 = OpAccessChain %_ptr_Function_float %_94_f %uint_2
+        %294 = OpLoad %float %293 None
+        %295 = OpCompositeConstruct %v3float %294 %294 %294
+        %296 = OpFAdd %v3float %292 %295
+        %297 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
+        %298 = OpLoad %float %297 None
+        %299 = OpVectorTimesScalar %v3float %296 %298
+        %300 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
+        %301 = OpLoad %float %300 None
+        %302 = OpCompositeConstruct %v4float %299 %301
+  %_skTemp28 = OpExtInst %v4float %48 NClamp %302 %70 %96
                OpStore %_94_f %_skTemp28 None
-               OpBranch %523
-        %525 = OpLabel
-        %564 = OpLoad %uint %shadingSsboIndex None
-        %565 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
-        %566 = OpArrayLength %uint %_storage1 0
-        %567 = OpISub %uint %566 %uint_1
-        %568 = OpExtInst %uint %48 UMin %564 %567
-        %569 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %568 %uint_8
-        %571 = OpLoad %int %569 None
-        %572 = OpINotEqual %bool %571 %137
-               OpSelectionMerge %573 None
-               OpBranchConditional %572 %574 %575
-        %574 = OpLabel
-        %576 = OpLoad %v4float %_94_f None
-  %_skTemp29 = OpExtInst %v4float %48 NClamp %576 %70 %385
+               OpBranch %153
+        %155 = OpLabel
+        %304 = OpLoad %uint %shadingSsboIndex None
+        %305 = OpAccessChain %_ptr_StorageBuffer__runtimearr_FSUniformData %_storage1 %uint_0
+        %306 = OpArrayLength %uint %_storage1 0
+        %307 = OpISub %uint %306 %uint_1
+        %308 = OpExtInst %uint %48 UMin %304 %307
+        %309 = OpAccessChain %_ptr_StorageBuffer_int %_storage1 %uint_0 %308 %uint_8
+        %311 = OpLoad %int %309 None
+        %312 = OpINotEqual %bool %311 %126
+               OpSelectionMerge %313 None
+               OpBranchConditional %312 %314 %315
+        %314 = OpLabel
+        %446 = OpLoad %v4float %_94_f None
+  %_skTemp29 = OpExtInst %v4float %48 NClamp %446 %70 %96
                OpStore %_94_f %_skTemp29 None
-               OpBranch %573
-        %575 = OpLabel
-        %578 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
-        %579 = OpLoad %float %578 None
-  %_skTemp30 = OpExtInst %float %48 NClamp %579 %float_0 %float_1
-        %581 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
-               OpStore %581 %_skTemp30 None
-               OpBranch %573
-        %573 = OpLabel
-        %582 = OpLoad %v4float %_94_f None
-        %583 = OpVectorShuffle %v3float %582 %582 0 1 2
-        %584 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
-        %585 = OpLoad %float %584 None
-        %586 = OpVectorTimesScalar %v3float %583 %585
-        %587 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
-        %588 = OpLoad %float %587 None
-        %589 = OpCompositeConstruct %v4float %586 %588
-               OpStore %_94_f %589 None
-               OpBranch %523
-        %523 = OpLabel
+               OpBranch %313
+        %315 = OpLabel
+        %448 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
+        %449 = OpLoad %float %448 None
+  %_skTemp30 = OpExtInst %float %48 NClamp %449 %float_0 %float_1
+        %451 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
+               OpStore %451 %_skTemp30 None
+               OpBranch %313
+        %313 = OpLabel
+        %316 = OpLoad %v4float %_94_f None
+        %317 = OpVectorShuffle %v3float %316 %316 0 1 2
+        %318 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
+        %319 = OpLoad %float %318 None
+        %320 = OpVectorTimesScalar %v3float %317 %319
+        %321 = OpAccessChain %_ptr_Function_float %_94_f %uint_3
+        %322 = OpLoad %float %321 None
+        %323 = OpCompositeConstruct %v4float %320 %322
+               OpStore %_94_f %323 None
+               OpBranch %153
+        %153 = OpLabel
  %outColor_0 = OpLoad %v4float %_94_f None
-        %591 = OpAccessChain %_ptr_Function_v4float %_stageOut_root %uint_0
-               OpStore %591 %outColor_0 None
+        %157 = OpAccessChain %_ptr_Function_v4float %_stageOut_root %uint_0
+               OpStore %157 %outColor_0 None
                OpReturn
                OpFunctionEnd
  %main_inner = OpFunction %FSOut None %594
diff --git a/test/tint/bug/tint/534.wgsl.expected.spvasm b/test/tint/bug/tint/534.wgsl.expected.spvasm
index 2e99ae3..9e78556 100644
--- a/test/tint/bug/tint/534.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/534.wgsl.expected.spvasm
@@ -5,7 +5,7 @@
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
-         %61 = OpExtInstImport "GLSL.std.450"
+         %53 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %main "main" %main_global_invocation_id_Input
                OpExecutionMode %main LocalSize 1 1 1
@@ -34,11 +34,11 @@
                OpName %success "success"
                OpName %srcColorBits "srcColorBits"
                OpName %dstColorBits "dstColorBits"
+               OpName %outputIndex "outputIndex"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
                OpName %tint_low_inc "tint_low_inc"
                OpName %tint_carry "tint_carry"
-               OpName %outputIndex "outputIndex"
                OpName %tint_v4f32_to_v4u32 "tint_v4f32_to_v4u32"
                OpName %value "value"
                OpName %main "main"
@@ -88,20 +88,20 @@
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %_ptr_Uniform_uint = OpTypePointer Uniform %uint
        %bool = OpTypeBool
-%_ptr_Function_uint = OpTypePointer Function %uint
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
-         %64 = OpConstantComposite %v2uint %uint_1 %uint_1
+         %56 = OpConstantComposite %v2uint %uint_1 %uint_1
     %v4float = OpTypeVector %float 4
 %_ptr_Function_v4float = OpTypePointer Function %v4float
 %_ptr_Function_bool = OpTypePointer Function %bool
        %true = OpConstantTrue %bool
      %v4uint = OpTypeVector %uint 4
 %_ptr_Function_v4uint = OpTypePointer Function %v4uint
-         %87 = OpConstantNull %v4uint
+         %79 = OpConstantNull %v4uint
+%_ptr_Function_uint = OpTypePointer Function %uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %98 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-        %103 = OpConstantNull %v2uint
+        %109 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+        %114 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
      %uint_3 = OpConstant %uint 3
 %_ptr_Function_float = OpTypePointer Function %float
@@ -129,11 +129,11 @@
    %srcColor = OpVariable %_ptr_Function_v4float Function
    %dstColor = OpVariable %_ptr_Function_v4float Function
     %success = OpVariable %_ptr_Function_bool Function
-%srcColorBits = OpVariable %_ptr_Function_v4uint Function %87
+%srcColorBits = OpVariable %_ptr_Function_v4uint Function %79
 %dstColorBits = OpVariable %_ptr_Function_v4uint Function
+%outputIndex = OpVariable %_ptr_Function_uint Function
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
           %i = OpVariable %_ptr_Function_uint Function
-%outputIndex = OpVariable %_ptr_Function_uint Function
          %28 = OpLoad %3 %src None
          %29 = OpImageQuerySizeLod %v2uint %28 %uint_0
                OpStore %size %29
@@ -147,144 +147,144 @@
                OpSelectionMerge %43 None
                OpBranchConditional %41 %44 %43
          %44 = OpLabel
-         %45 = OpAccessChain %_ptr_Function_uint %size %uint_1
-         %47 = OpLoad %uint %45 None
-         %48 = OpAccessChain %_ptr_Function_uint %dstTexCoord %uint_1
-         %49 = OpLoad %uint %48 None
-         %50 = OpISub %uint %47 %49
-         %51 = OpISub %uint %50 %uint_1
-         %52 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
-               OpStore %52 %51 None
+        %101 = OpAccessChain %_ptr_Function_uint %size %uint_1
+        %102 = OpLoad %uint %101 None
+        %103 = OpAccessChain %_ptr_Function_uint %dstTexCoord %uint_1
+        %104 = OpLoad %uint %103 None
+        %105 = OpISub %uint %102 %104
+        %106 = OpISub %uint %105 %uint_1
+        %107 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
+               OpStore %107 %106 None
                OpBranch %43
          %43 = OpLabel
-         %53 = OpLoad %3 %src None
-         %54 = OpLoad %v2uint %srcTexCoord None
-         %55 = OpImageQueryLevels %uint %53
-         %56 = OpISub %uint %55 %uint_1
-         %57 = OpBitcast %uint %int_0
-         %60 = OpExtInst %uint %61 UMin %57 %56
-         %62 = OpImageQuerySizeLod %v2uint %53 %60
-         %63 = OpISub %v2uint %62 %64
-         %65 = OpExtInst %v2uint %61 UMin %54 %63
-         %66 = OpImageFetch %v4float %53 %65 Lod %60
-               OpStore %srcColor %66
-         %70 = OpLoad %3 %dst None
-         %71 = OpLoad %v2uint %dstTexCoord None
-         %72 = OpImageQueryLevels %uint %70
-         %73 = OpISub %uint %72 %uint_1
-         %74 = OpBitcast %uint %int_0
-         %75 = OpExtInst %uint %61 UMin %74 %73
-         %76 = OpImageQuerySizeLod %v2uint %70 %75
-         %77 = OpISub %v2uint %76 %64
-         %78 = OpExtInst %v2uint %61 UMin %71 %77
-         %79 = OpImageFetch %v4float %70 %78 Lod %75
-               OpStore %dstColor %79
+         %45 = OpLoad %3 %src None
+         %46 = OpLoad %v2uint %srcTexCoord None
+         %47 = OpImageQueryLevels %uint %45
+         %48 = OpISub %uint %47 %uint_1
+         %49 = OpBitcast %uint %int_0
+         %52 = OpExtInst %uint %53 UMin %49 %48
+         %54 = OpImageQuerySizeLod %v2uint %45 %52
+         %55 = OpISub %v2uint %54 %56
+         %57 = OpExtInst %v2uint %53 UMin %46 %55
+         %58 = OpImageFetch %v4float %45 %57 Lod %52
+               OpStore %srcColor %58
+         %62 = OpLoad %3 %dst None
+         %63 = OpLoad %v2uint %dstTexCoord None
+         %64 = OpImageQueryLevels %uint %62
+         %65 = OpISub %uint %64 %uint_1
+         %66 = OpBitcast %uint %int_0
+         %67 = OpExtInst %uint %53 UMin %66 %65
+         %68 = OpImageQuerySizeLod %v2uint %62 %67
+         %69 = OpISub %v2uint %68 %56
+         %70 = OpExtInst %v2uint %53 UMin %63 %69
+         %71 = OpImageFetch %v4float %62 %70 Lod %67
+               OpStore %dstColor %71
                OpStore %success %true
-         %88 = OpLoad %v4float %dstColor None
-         %89 = OpFunctionCall %v4uint %tint_v4f32_to_v4u32 %88
-               OpStore %dstColorBits %89
-               OpBranch %92
-         %92 = OpLabel
-               OpStore %tint_loop_idx %98
+         %80 = OpLoad %v4float %dstColor None
+         %81 = OpFunctionCall %v4uint %tint_v4f32_to_v4u32 %80
+               OpStore %dstColorBits %81
+               OpBranch %84
+         %84 = OpLabel
+               OpStore %tint_loop_idx %109
                OpStore %i %uint_0
-               OpBranch %95
-         %95 = OpLabel
-               OpLoopMerge %96 %94 None
-               OpBranch %93
-         %93 = OpLabel
-        %101 = OpLoad %v2uint %tint_loop_idx None
-        %102 = OpIEqual %v2bool %101 %103
-        %105 = OpAll %bool %102
-               OpSelectionMerge %106 None
-               OpBranchConditional %105 %107 %106
-        %107 = OpLabel
-               OpBranch %96
-        %106 = OpLabel
-        %108 = OpLoad %uint %i None
-        %109 = OpAccessChain %_ptr_Uniform_uint %11 %uint_0 %uint_3
-        %111 = OpLoad %uint %109 None
-        %112 = OpULessThan %bool %108 %111
-               OpSelectionMerge %113 None
-               OpBranchConditional %112 %113 %114
-        %114 = OpLabel
-               OpBranch %96
-        %113 = OpLabel
-        %115 = OpLoad %uint %i None
-        %116 = OpLoad %uint %i None
-        %117 = OpExtInst %uint %61 UMin %116 %uint_3
-        %118 = OpAccessChain %_ptr_Function_float %srcColor %117
-        %120 = OpLoad %float %118 None
-        %121 = OpFunctionCall %uint %ConvertToFp16FloatValue %120
-        %122 = OpExtInst %uint %61 UMin %115 %uint_3
-        %123 = OpAccessChain %_ptr_Function_uint %srcColorBits %122
-               OpStore %123 %121 None
-        %124 = OpLoad %bool %success None
-               OpSelectionMerge %125 None
-               OpBranchConditional %124 %126 %127
-        %126 = OpLabel
-        %128 = OpLoad %uint %i None
-        %129 = OpExtInst %uint %61 UMin %128 %uint_3
-        %130 = OpAccessChain %_ptr_Function_uint %srcColorBits %129
-        %131 = OpLoad %uint %130 None
-        %132 = OpLoad %uint %i None
-        %133 = OpExtInst %uint %61 UMin %132 %uint_3
-        %134 = OpAccessChain %_ptr_Function_uint %dstColorBits %133
-        %135 = OpLoad %uint %134 None
-        %136 = OpIEqual %bool %131 %135
-               OpBranch %125
-        %127 = OpLabel
-               OpBranch %125
+               OpBranch %87
+         %87 = OpLabel
+               OpLoopMerge %88 %86 None
+               OpBranch %85
+         %85 = OpLabel
+        %112 = OpLoad %v2uint %tint_loop_idx None
+        %113 = OpIEqual %v2bool %112 %114
+        %116 = OpAll %bool %113
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %118 %117
+        %118 = OpLabel
+               OpBranch %88
+        %117 = OpLabel
+        %119 = OpLoad %uint %i None
+        %120 = OpAccessChain %_ptr_Uniform_uint %11 %uint_0 %uint_3
+        %122 = OpLoad %uint %120 None
+        %123 = OpULessThan %bool %119 %122
+               OpSelectionMerge %124 None
+               OpBranchConditional %123 %124 %125
         %125 = OpLabel
-        %137 = OpPhi %bool %136 %126 %false %127
-               OpStore %success %137 None
-               OpBranch %94
-         %94 = OpLabel
-        %139 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-        %140 = OpLoad %uint %139 None
-%tint_low_inc = OpISub %uint %140 %uint_1
+               OpBranch %88
+        %124 = OpLabel
+        %126 = OpLoad %uint %i None
+        %127 = OpLoad %uint %i None
+        %128 = OpExtInst %uint %53 UMin %127 %uint_3
+        %129 = OpAccessChain %_ptr_Function_float %srcColor %128
+        %131 = OpLoad %float %129 None
+        %132 = OpFunctionCall %uint %ConvertToFp16FloatValue %131
+        %133 = OpExtInst %uint %53 UMin %126 %uint_3
+        %134 = OpAccessChain %_ptr_Function_uint %srcColorBits %133
+               OpStore %134 %132 None
+        %135 = OpLoad %bool %success None
+               OpSelectionMerge %136 None
+               OpBranchConditional %135 %137 %138
+        %137 = OpLabel
+        %168 = OpLoad %uint %i None
+        %169 = OpExtInst %uint %53 UMin %168 %uint_3
+        %170 = OpAccessChain %_ptr_Function_uint %srcColorBits %169
+        %171 = OpLoad %uint %170 None
+        %172 = OpLoad %uint %i None
+        %173 = OpExtInst %uint %53 UMin %172 %uint_3
+        %174 = OpAccessChain %_ptr_Function_uint %dstColorBits %173
+        %175 = OpLoad %uint %174 None
+        %140 = OpIEqual %bool %171 %175
+               OpBranch %136
+        %138 = OpLabel
+               OpBranch %136
+        %136 = OpLabel
+        %139 = OpPhi %bool %140 %137 %false %138
+               OpStore %success %139 None
+               OpBranch %86
+         %86 = OpLabel
         %142 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %142 %tint_low_inc None
-        %143 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %143 %uint_1 %uint_0
-        %145 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-        %146 = OpLoad %uint %145 None
-        %147 = OpISub %uint %146 %tint_carry
+        %143 = OpLoad %uint %142 None
+%tint_low_inc = OpISub %uint %143 %uint_1
+        %145 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %145 %tint_low_inc None
+        %146 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %146 %uint_1 %uint_0
         %148 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %148 %147 None
-        %149 = OpLoad %uint %i None
-        %150 = OpIAdd %uint %149 %uint_1
-               OpStore %i %150 None
-               OpBranch %95
-         %96 = OpLabel
-        %151 = OpCompositeExtract %uint %GlobalInvocationID 1
-        %152 = OpAccessChain %_ptr_Function_uint %size %uint_0
-        %153 = OpLoad %uint %152 None
-        %154 = OpIMul %uint %151 %153
-        %155 = OpCompositeExtract %uint %GlobalInvocationID 0
-        %156 = OpIAdd %uint %154 %155
-               OpStore %outputIndex %156
-        %158 = OpLoad %bool %success None
-               OpSelectionMerge %159 None
-               OpBranchConditional %158 %160 %161
-        %160 = OpLabel
+        %149 = OpLoad %uint %148 None
+        %150 = OpISub %uint %149 %tint_carry
+        %151 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %151 %150 None
+        %152 = OpLoad %uint %i None
+        %153 = OpIAdd %uint %152 %uint_1
+               OpStore %i %153 None
+               OpBranch %87
+         %88 = OpLabel
+         %89 = OpCompositeExtract %uint %GlobalInvocationID 1
+         %90 = OpAccessChain %_ptr_Function_uint %size %uint_0
+         %92 = OpLoad %uint %90 None
+         %93 = OpIMul %uint %89 %92
+         %94 = OpCompositeExtract %uint %GlobalInvocationID 0
+         %95 = OpIAdd %uint %93 %94
+               OpStore %outputIndex %95
+         %97 = OpLoad %bool %success None
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %100
+         %99 = OpLabel
+        %154 = OpLoad %uint %outputIndex None
+        %155 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %output %uint_0
+        %157 = OpArrayLength %uint %output 0
+        %158 = OpISub %uint %157 %uint_1
+        %159 = OpExtInst %uint %53 UMin %154 %158
+        %160 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %159
+               OpStore %160 %uint_1 None
+               OpBranch %98
+        %100 = OpLabel
         %162 = OpLoad %uint %outputIndex None
         %163 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %output %uint_0
-        %165 = OpArrayLength %uint %output 0
-        %166 = OpISub %uint %165 %uint_1
-        %167 = OpExtInst %uint %61 UMin %162 %166
-        %168 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %167
-               OpStore %168 %uint_1 None
-               OpBranch %159
-        %161 = OpLabel
-        %170 = OpLoad %uint %outputIndex None
-        %171 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %output %uint_0
-        %172 = OpArrayLength %uint %output 0
-        %173 = OpISub %uint %172 %uint_1
-        %174 = OpExtInst %uint %61 UMin %170 %173
-        %175 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %174
-               OpStore %175 %uint_0 None
-               OpBranch %159
-        %159 = OpLabel
+        %164 = OpArrayLength %uint %output 0
+        %165 = OpISub %uint %164 %uint_1
+        %166 = OpExtInst %uint %53 UMin %162 %165
+        %167 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %166
+               OpStore %167 %uint_0 None
+               OpBranch %98
+         %98 = OpLabel
                OpReturn
                OpFunctionEnd
 %tint_v4f32_to_v4u32 = OpFunction %v4uint None %177
@@ -292,7 +292,7 @@
         %178 = OpLabel
         %179 = OpConvertFToU %v4uint %value
         %180 = OpFOrdGreaterThanEqual %v4bool %value %181
-        %183 = OpSelect %v4uint %180 %179 %87
+        %183 = OpSelect %v4uint %180 %179 %79
         %184 = OpFOrdLessThanEqual %v4bool %value %185
         %187 = OpSelect %v4uint %184 %183 %188
                OpReturnValue %187
diff --git a/test/tint/bug/tint/744.wgsl.expected.spvasm b/test/tint/bug/tint/744.wgsl.expected.spvasm
index 51fad41..4e6d060 100644
--- a/test/tint/bug/tint/744.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/744.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 94
 ; Schema: 0
                OpCapability Shader
-         %63 = OpExtInstImport "GLSL.std.450"
+         %52 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %main "main" %main_global_invocation_id_Input
                OpExecutionMode %main LocalSize 2 2 1
@@ -26,10 +26,10 @@
                OpName %dimInner "dimInner"
                OpName %dimOutter "dimOutter"
                OpName %result "result"
+               OpName %index "index"
                OpName %i "i"
                OpName %a "a"
                OpName %b "b"
-               OpName %index "index"
                OpName %main "main"
                OpDecorate %_runtimearr_uint ArrayStride 4
                OpMemberDecorate %Matrix_tint_explicit_layout 0 Offset 0
@@ -76,9 +76,9 @@
      %uint_1 = OpConstant %uint 1
      %uint_2 = OpConstant %uint 2
 %_ptr_Function_uint = OpTypePointer Function %uint
-       %bool = OpTypeBool
 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+       %bool = OpTypeBool
 %_ptr_StorageBuffer__runtimearr_uint_0 = OpTypePointer StorageBuffer %_runtimearr_uint
 %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
          %90 = OpTypeFunction %void
@@ -105,55 +105,55 @@
                OpLoopMerge %42 %40 None
                OpBranch %39
          %39 = OpLabel
-         %44 = OpLoad %uint %i None
-         %45 = OpULessThan %bool %44 %dimInner
-               OpSelectionMerge %47 None
-               OpBranchConditional %45 %47 %48
-         %48 = OpLabel
+         %57 = OpLoad %uint %i None
+         %58 = OpULessThan %bool %57 %dimInner
+               OpSelectionMerge %60 None
+               OpBranchConditional %58 %60 %61
+         %61 = OpLabel
                OpBranch %42
-         %47 = OpLabel
-         %49 = OpLoad %uint %i None
-         %50 = OpCompositeExtract %uint %resultCell 0
-         %51 = OpIMul %uint %50 %dimInner
-          %a = OpIAdd %uint %49 %51
-         %53 = OpCompositeExtract %uint %resultCell 1
-         %54 = OpLoad %uint %i None
-         %55 = OpIMul %uint %54 %dimOutter
-          %b = OpIAdd %uint %53 %55
-         %57 = OpLoad %uint %result None
-         %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %firstMatrix %uint_0
-         %60 = OpArrayLength %uint %firstMatrix 0
-         %61 = OpISub %uint %60 %uint_1
-         %62 = OpExtInst %uint %63 UMin %a %61
-         %64 = OpAccessChain %_ptr_StorageBuffer_uint %firstMatrix %uint_0 %62
-         %66 = OpLoad %uint %64 None
-         %67 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %secondMatrix %uint_0
-         %68 = OpArrayLength %uint %secondMatrix 0
-         %69 = OpISub %uint %68 %uint_1
-         %70 = OpExtInst %uint %63 UMin %b %69
-         %71 = OpAccessChain %_ptr_StorageBuffer_uint %secondMatrix %uint_0 %70
-         %72 = OpLoad %uint %71 None
-         %73 = OpIMul %uint %66 %72
-         %74 = OpIAdd %uint %57 %73
-               OpStore %result %74 None
+         %60 = OpLabel
+         %62 = OpLoad %uint %i None
+         %63 = OpCompositeExtract %uint %resultCell 0
+         %64 = OpIMul %uint %63 %dimInner
+          %a = OpIAdd %uint %62 %64
+         %66 = OpCompositeExtract %uint %resultCell 1
+         %67 = OpLoad %uint %i None
+         %68 = OpIMul %uint %67 %dimOutter
+          %b = OpIAdd %uint %66 %68
+         %70 = OpLoad %uint %result None
+         %71 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %firstMatrix %uint_0
+         %73 = OpArrayLength %uint %firstMatrix 0
+         %74 = OpISub %uint %73 %uint_1
+         %75 = OpExtInst %uint %52 UMin %a %74
+         %76 = OpAccessChain %_ptr_StorageBuffer_uint_0 %firstMatrix %uint_0 %75
+         %78 = OpLoad %uint %76 None
+         %79 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %secondMatrix %uint_0
+         %80 = OpArrayLength %uint %secondMatrix 0
+         %81 = OpISub %uint %80 %uint_1
+         %82 = OpExtInst %uint %52 UMin %b %81
+         %83 = OpAccessChain %_ptr_StorageBuffer_uint_0 %secondMatrix %uint_0 %82
+         %84 = OpLoad %uint %83 None
+         %85 = OpIMul %uint %78 %84
+         %86 = OpIAdd %uint %70 %85
+               OpStore %result %86 None
                OpBranch %40
          %40 = OpLabel
-         %75 = OpLoad %uint %i None
-         %76 = OpIAdd %uint %75 %uint_1
-               OpStore %i %76 None
+         %87 = OpLoad %uint %i None
+         %88 = OpIAdd %uint %87 %uint_1
+               OpStore %i %88 None
                OpBranch %41
          %42 = OpLabel
-         %77 = OpCompositeExtract %uint %resultCell 1
-         %78 = OpCompositeExtract %uint %resultCell 0
-         %79 = OpIMul %uint %78 %dimOutter
-      %index = OpIAdd %uint %77 %79
-         %81 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint_0 %resultMatrix %uint_0
-         %83 = OpArrayLength %uint %resultMatrix 0
-         %84 = OpISub %uint %83 %uint_1
-         %85 = OpExtInst %uint %63 UMin %index %84
-         %86 = OpAccessChain %_ptr_StorageBuffer_uint_0 %resultMatrix %uint_0 %85
-         %88 = OpLoad %uint %result None
-               OpStore %86 %88 None
+         %43 = OpCompositeExtract %uint %resultCell 1
+         %44 = OpCompositeExtract %uint %resultCell 0
+         %45 = OpIMul %uint %44 %dimOutter
+      %index = OpIAdd %uint %43 %45
+         %47 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %resultMatrix %uint_0
+         %49 = OpArrayLength %uint %resultMatrix 0
+         %50 = OpISub %uint %49 %uint_1
+         %51 = OpExtInst %uint %52 UMin %index %50
+         %53 = OpAccessChain %_ptr_StorageBuffer_uint %resultMatrix %uint_0 %51
+         %55 = OpLoad %uint %result None
+               OpStore %53 %55 None
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %90
diff --git a/test/tint/bug/tint/913.wgsl.expected.spvasm b/test/tint/bug/tint/913.wgsl.expected.spvasm
index d5d9140..5b2fb1c 100644
--- a/test/tint/bug/tint/913.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/913.wgsl.expected.spvasm
@@ -33,10 +33,10 @@
                OpName %dstTexCoord "dstTexCoord"
                OpName %nonCoveredColor "nonCoveredColor"
                OpName %success "success"
+               OpName %outputIndex "outputIndex"
                OpName %srcTexCoord "srcTexCoord"
                OpName %srcColor "srcColor"
                OpName %dstColor "dstColor"
-               OpName %outputIndex "outputIndex"
                OpName %main "main"
                OpDecorate %src DescriptorSet 0
                OpDecorate %src Binding 0
@@ -94,17 +94,17 @@
 %_ptr_Uniform_uint = OpTypePointer Uniform %uint
      %uint_1 = OpConstant %uint 1
      %uint_4 = OpConstant %uint 4
-        %int = OpTypeInt 32 1
-      %v2int = OpTypeVector %int 2
-      %int_0 = OpConstant %int 0
-        %111 = OpConstantComposite %v2uint %uint_1 %uint_1
-     %v4bool = OpTypeVector %bool 4
       %false = OpConstantFalse %bool
      %uint_2 = OpConstant %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
-%_ptr_Function_uint = OpTypePointer Function %uint
+        %int = OpTypeInt 32 1
+      %v2int = OpTypeVector %int 2
+      %int_0 = OpConstant %int 0
+        %138 = OpConstantComposite %v2uint %uint_1 %uint_1
 %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+     %v4bool = OpTypeVector %bool 4
+%_ptr_Function_uint = OpTypePointer Function %uint
         %236 = OpTypeFunction %void
  %aboutEqual = OpFunction %bool None %23
       %value = OpFunctionParameter %float
@@ -136,228 +136,228 @@
          %57 = OpLabel
                OpBranch %56
          %58 = OpLabel
-         %59 = OpCompositeExtract %uint %dstTexCoord 1
-         %60 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_3
-         %61 = OpAccessChain %_ptr_Uniform_uint %60 %uint_1
-         %63 = OpLoad %uint %61 None
-         %64 = OpULessThan %bool %59 %63
-               OpBranch %56
-         %56 = OpLabel
-         %65 = OpPhi %bool %true %57 %64 %58
-               OpSelectionMerge %66 None
-               OpBranchConditional %65 %67 %68
-         %67 = OpLabel
-               OpBranch %66
-         %68 = OpLabel
-         %69 = OpCompositeExtract %uint %dstTexCoord 0
-         %70 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_3
-         %71 = OpAccessChain %_ptr_Uniform_uint %70 %uint_0
-         %72 = OpLoad %uint %71 None
-         %73 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_4
-         %75 = OpAccessChain %_ptr_Uniform_uint %73 %uint_0
-         %76 = OpLoad %uint %75 None
-         %77 = OpIAdd %uint %72 %76
-         %78 = OpUGreaterThanEqual %bool %69 %77
-               OpBranch %66
-         %66 = OpLabel
-         %79 = OpPhi %bool %true %67 %78 %68
-               OpSelectionMerge %80 None
-               OpBranchConditional %79 %81 %82
-         %81 = OpLabel
-               OpBranch %80
-         %82 = OpLabel
          %83 = OpCompositeExtract %uint %dstTexCoord 1
          %84 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_3
          %85 = OpAccessChain %_ptr_Uniform_uint %84 %uint_1
-         %86 = OpLoad %uint %85 None
-         %87 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_4
-         %88 = OpAccessChain %_ptr_Uniform_uint %87 %uint_1
-         %89 = OpLoad %uint %88 None
-         %90 = OpIAdd %uint %86 %89
-         %91 = OpUGreaterThanEqual %bool %83 %90
-               OpBranch %80
-         %80 = OpLabel
-         %92 = OpPhi %bool %true %81 %91 %82
-               OpSelectionMerge %93 None
-               OpBranchConditional %92 %94 %95
-         %94 = OpLabel
-         %96 = OpLoad %bool %success None
-               OpSelectionMerge %97 None
-               OpBranchConditional %96 %98 %99
-         %98 = OpLabel
-        %100 = OpLoad %3 %dst None
-        %103 = OpBitcast %v2int %dstTexCoord
-        %104 = OpImageQueryLevels %uint %100
-        %105 = OpISub %uint %104 %uint_1
-        %106 = OpBitcast %uint %int_0
-        %108 = OpExtInst %uint %27 UMin %106 %105
-        %109 = OpImageQuerySizeLod %v2uint %100 %108
-        %110 = OpISub %v2uint %109 %111
-        %112 = OpBitcast %v2uint %103
-        %113 = OpExtInst %v2uint %27 UMin %112 %110
-        %114 = OpImageFetch %v4float %100 %113 Lod %108
-        %115 = OpFOrdEqual %v4bool %114 %nonCoveredColor
-        %117 = OpAll %bool %115
-               OpBranch %97
-         %99 = OpLabel
-               OpBranch %97
-         %97 = OpLabel
-        %118 = OpPhi %bool %117 %98 %false %99
-               OpStore %success %118 None
-               OpBranch %93
-         %95 = OpLabel
-        %120 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_3
-        %121 = OpLoad %v2uint %120 None
-        %122 = OpISub %v2uint %dstTexCoord %121
-        %123 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_2
-        %125 = OpLoad %v2uint %123 None
-        %126 = OpIAdd %v2uint %122 %125
-               OpStore %srcTexCoord %126
-        %129 = OpAccessChain %_ptr_Uniform_uint %11 %uint_0 %uint_0
-        %130 = OpLoad %uint %129 None
-        %131 = OpIEqual %bool %130 %uint_1
-               OpSelectionMerge %132 None
-               OpBranchConditional %131 %133 %132
-        %133 = OpLabel
-        %134 = OpCompositeExtract %uint %srcSize 1
-        %135 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
-        %137 = OpLoad %uint %135 None
-        %138 = OpISub %uint %134 %137
-        %139 = OpISub %uint %138 %uint_1
-        %140 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
-               OpStore %140 %139 None
-               OpBranch %132
-        %132 = OpLabel
-        %141 = OpLoad %3 %src None
-        %142 = OpLoad %v2uint %srcTexCoord None
-        %143 = OpBitcast %v2int %142
-        %144 = OpImageQueryLevels %uint %141
+         %87 = OpLoad %uint %85 None
+         %60 = OpULessThan %bool %83 %87
+               OpBranch %56
+         %56 = OpLabel
+         %59 = OpPhi %bool %true %57 %60 %58
+               OpSelectionMerge %61 None
+               OpBranchConditional %59 %62 %63
+         %62 = OpLabel
+               OpBranch %61
+         %63 = OpLabel
+         %88 = OpCompositeExtract %uint %dstTexCoord 0
+         %89 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_3
+         %90 = OpAccessChain %_ptr_Uniform_uint %89 %uint_0
+         %91 = OpLoad %uint %90 None
+         %92 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_4
+         %94 = OpAccessChain %_ptr_Uniform_uint %92 %uint_0
+         %95 = OpLoad %uint %94 None
+         %96 = OpIAdd %uint %91 %95
+         %65 = OpUGreaterThanEqual %bool %88 %96
+               OpBranch %61
+         %61 = OpLabel
+         %64 = OpPhi %bool %true %62 %65 %63
+               OpSelectionMerge %66 None
+               OpBranchConditional %64 %67 %68
+         %67 = OpLabel
+               OpBranch %66
+         %68 = OpLabel
+         %97 = OpCompositeExtract %uint %dstTexCoord 1
+         %98 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_3
+         %99 = OpAccessChain %_ptr_Uniform_uint %98 %uint_1
+        %100 = OpLoad %uint %99 None
+        %101 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_4
+        %102 = OpAccessChain %_ptr_Uniform_uint %101 %uint_1
+        %103 = OpLoad %uint %102 None
+        %104 = OpIAdd %uint %100 %103
+         %70 = OpUGreaterThanEqual %bool %97 %104
+               OpBranch %66
+         %66 = OpLabel
+         %69 = OpPhi %bool %true %67 %70 %68
+               OpSelectionMerge %71 None
+               OpBranchConditional %69 %72 %73
+         %72 = OpLabel
+        %105 = OpLoad %bool %success None
+               OpSelectionMerge %106 None
+               OpBranchConditional %105 %107 %108
+        %107 = OpLabel
+        %171 = OpLoad %3 %dst None
+        %172 = OpBitcast %v2int %dstTexCoord
+        %173 = OpImageQueryLevels %uint %171
+        %174 = OpISub %uint %173 %uint_1
+        %175 = OpBitcast %uint %int_0
+        %176 = OpExtInst %uint %27 UMin %175 %174
+        %177 = OpImageQuerySizeLod %v2uint %171 %176
+        %178 = OpISub %v2uint %177 %138
+        %179 = OpBitcast %v2uint %172
+        %180 = OpExtInst %v2uint %27 UMin %179 %178
+        %181 = OpImageFetch %v4float %171 %180 Lod %176
+        %182 = OpFOrdEqual %v4bool %181 %nonCoveredColor
+        %110 = OpAll %bool %182
+               OpBranch %106
+        %108 = OpLabel
+               OpBranch %106
+        %106 = OpLabel
+        %109 = OpPhi %bool %110 %107 %false %108
+               OpStore %success %109 None
+               OpBranch %71
+         %73 = OpLabel
+        %112 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_3
+        %113 = OpLoad %v2uint %112 None
+        %114 = OpISub %v2uint %dstTexCoord %113
+        %115 = OpAccessChain %_ptr_Uniform_v2uint %11 %uint_0 %uint_2
+        %117 = OpLoad %v2uint %115 None
+        %118 = OpIAdd %v2uint %114 %117
+               OpStore %srcTexCoord %118
+        %121 = OpAccessChain %_ptr_Uniform_uint %11 %uint_0 %uint_0
+        %122 = OpLoad %uint %121 None
+        %123 = OpIEqual %bool %122 %uint_1
+               OpSelectionMerge %124 None
+               OpBranchConditional %123 %125 %124
+        %125 = OpLabel
+        %184 = OpCompositeExtract %uint %srcSize 1
+        %185 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
+        %187 = OpLoad %uint %185 None
+        %188 = OpISub %uint %184 %187
+        %189 = OpISub %uint %188 %uint_1
+        %190 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
+               OpStore %190 %189 None
+               OpBranch %124
+        %124 = OpLabel
+        %126 = OpLoad %3 %src None
+        %127 = OpLoad %v2uint %srcTexCoord None
+        %130 = OpBitcast %v2int %127
+        %131 = OpImageQueryLevels %uint %126
+        %132 = OpISub %uint %131 %uint_1
+        %133 = OpBitcast %uint %int_0
+        %135 = OpExtInst %uint %27 UMin %133 %132
+        %136 = OpImageQuerySizeLod %v2uint %126 %135
+        %137 = OpISub %v2uint %136 %138
+        %139 = OpBitcast %v2uint %130
+        %140 = OpExtInst %v2uint %27 UMin %139 %137
+   %srcColor = OpImageFetch %v4float %126 %140 Lod %135
+        %142 = OpLoad %3 %dst None
+        %143 = OpBitcast %v2int %dstTexCoord
+        %144 = OpImageQueryLevels %uint %142
         %145 = OpISub %uint %144 %uint_1
         %146 = OpBitcast %uint %int_0
         %147 = OpExtInst %uint %27 UMin %146 %145
-        %148 = OpImageQuerySizeLod %v2uint %141 %147
-        %149 = OpISub %v2uint %148 %111
+        %148 = OpImageQuerySizeLod %v2uint %142 %147
+        %149 = OpISub %v2uint %148 %138
         %150 = OpBitcast %v2uint %143
         %151 = OpExtInst %v2uint %27 UMin %150 %149
-   %srcColor = OpImageFetch %v4float %141 %151 Lod %147
-        %153 = OpLoad %3 %dst None
-        %154 = OpBitcast %v2int %dstTexCoord
-        %155 = OpImageQueryLevels %uint %153
-        %156 = OpISub %uint %155 %uint_1
-        %157 = OpBitcast %uint %int_0
-        %158 = OpExtInst %uint %27 UMin %157 %156
-        %159 = OpImageQuerySizeLod %v2uint %153 %158
-        %160 = OpISub %v2uint %159 %111
-        %161 = OpBitcast %v2uint %154
-        %162 = OpExtInst %v2uint %27 UMin %161 %160
-   %dstColor = OpImageFetch %v4float %153 %162 Lod %158
-        %164 = OpAccessChain %_ptr_Uniform_uint %11 %uint_0 %uint_1
-        %165 = OpLoad %uint %164 None
-        %166 = OpIEqual %bool %165 %uint_2
-               OpSelectionMerge %167 None
-               OpBranchConditional %166 %168 %169
-        %168 = OpLabel
-        %170 = OpLoad %bool %success None
-               OpSelectionMerge %171 None
-               OpBranchConditional %170 %172 %173
-        %172 = OpLabel
-        %174 = OpCompositeExtract %float %dstColor 0
-        %175 = OpCompositeExtract %float %srcColor 0
-        %176 = OpFunctionCall %bool %aboutEqual %174 %175
-               OpBranch %171
-        %173 = OpLabel
-               OpBranch %171
-        %171 = OpLabel
-        %177 = OpPhi %bool %176 %172 %false %173
-               OpSelectionMerge %178 None
-               OpBranchConditional %177 %179 %180
-        %179 = OpLabel
-        %181 = OpCompositeExtract %float %dstColor 1
-        %182 = OpCompositeExtract %float %srcColor 1
-        %183 = OpFunctionCall %bool %aboutEqual %181 %182
-               OpBranch %178
-        %180 = OpLabel
-               OpBranch %178
-        %178 = OpLabel
-        %184 = OpPhi %bool %183 %179 %false %180
-               OpStore %success %184 None
-               OpBranch %167
-        %169 = OpLabel
-        %185 = OpLoad %bool %success None
-               OpSelectionMerge %186 None
-               OpBranchConditional %185 %187 %188
-        %187 = OpLabel
-        %189 = OpCompositeExtract %float %dstColor 0
-        %190 = OpCompositeExtract %float %srcColor 0
-        %191 = OpFunctionCall %bool %aboutEqual %189 %190
-               OpBranch %186
-        %188 = OpLabel
-               OpBranch %186
-        %186 = OpLabel
-        %192 = OpPhi %bool %191 %187 %false %188
-               OpSelectionMerge %193 None
-               OpBranchConditional %192 %194 %195
-        %194 = OpLabel
-        %196 = OpCompositeExtract %float %dstColor 1
-        %197 = OpCompositeExtract %float %srcColor 1
-        %198 = OpFunctionCall %bool %aboutEqual %196 %197
-               OpBranch %193
-        %195 = OpLabel
-               OpBranch %193
+   %dstColor = OpImageFetch %v4float %142 %151 Lod %147
+        %153 = OpAccessChain %_ptr_Uniform_uint %11 %uint_0 %uint_1
+        %154 = OpLoad %uint %153 None
+        %155 = OpIEqual %bool %154 %uint_2
+               OpSelectionMerge %156 None
+               OpBranchConditional %155 %157 %158
+        %157 = OpLabel
+        %191 = OpLoad %bool %success None
+               OpSelectionMerge %192 None
+               OpBranchConditional %191 %193 %194
         %193 = OpLabel
-        %199 = OpPhi %bool %198 %194 %false %195
-               OpSelectionMerge %200 None
-               OpBranchConditional %199 %201 %202
-        %201 = OpLabel
-        %203 = OpCompositeExtract %float %dstColor 2
-        %204 = OpCompositeExtract %float %srcColor 2
-        %205 = OpFunctionCall %bool %aboutEqual %203 %204
-               OpBranch %200
-        %202 = OpLabel
-               OpBranch %200
-        %200 = OpLabel
-        %206 = OpPhi %bool %205 %201 %false %202
-               OpSelectionMerge %207 None
-               OpBranchConditional %206 %208 %209
-        %208 = OpLabel
-        %210 = OpCompositeExtract %float %dstColor 3
-        %211 = OpCompositeExtract %float %srcColor 3
-        %212 = OpFunctionCall %bool %aboutEqual %210 %211
-               OpBranch %207
+        %223 = OpCompositeExtract %float %dstColor 0
+        %224 = OpCompositeExtract %float %srcColor 0
+        %196 = OpFunctionCall %bool %aboutEqual %223 %224
+               OpBranch %192
+        %194 = OpLabel
+               OpBranch %192
+        %192 = OpLabel
+        %195 = OpPhi %bool %196 %193 %false %194
+               OpSelectionMerge %197 None
+               OpBranchConditional %195 %198 %199
+        %198 = OpLabel
+        %225 = OpCompositeExtract %float %dstColor 1
+        %226 = OpCompositeExtract %float %srcColor 1
+        %201 = OpFunctionCall %bool %aboutEqual %225 %226
+               OpBranch %197
+        %199 = OpLabel
+               OpBranch %197
+        %197 = OpLabel
+        %200 = OpPhi %bool %201 %198 %false %199
+               OpStore %success %200 None
+               OpBranch %156
+        %158 = OpLabel
+        %202 = OpLoad %bool %success None
+               OpSelectionMerge %203 None
+               OpBranchConditional %202 %204 %205
+        %204 = OpLabel
+        %227 = OpCompositeExtract %float %dstColor 0
+        %228 = OpCompositeExtract %float %srcColor 0
+        %207 = OpFunctionCall %bool %aboutEqual %227 %228
+               OpBranch %203
+        %205 = OpLabel
+               OpBranch %203
+        %203 = OpLabel
+        %206 = OpPhi %bool %207 %204 %false %205
+               OpSelectionMerge %208 None
+               OpBranchConditional %206 %209 %210
         %209 = OpLabel
-               OpBranch %207
-        %207 = OpLabel
-        %213 = OpPhi %bool %212 %208 %false %209
-               OpStore %success %213 None
-               OpBranch %167
-        %167 = OpLabel
-               OpBranch %93
-         %93 = OpLabel
-        %214 = OpCompositeExtract %uint %GlobalInvocationID 1
-        %215 = OpCompositeExtract %uint %dstSize 0
-        %216 = OpIMul %uint %214 %215
-        %217 = OpCompositeExtract %uint %GlobalInvocationID 0
-%outputIndex = OpIAdd %uint %216 %217
-        %219 = OpLoad %bool %success None
-               OpSelectionMerge %220 None
-               OpBranchConditional %219 %221 %222
-        %221 = OpLabel
-        %223 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %output %uint_0
-        %225 = OpArrayLength %uint %output 0
-        %226 = OpISub %uint %225 %uint_1
-        %227 = OpExtInst %uint %27 UMin %outputIndex %226
-        %228 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %227
-               OpStore %228 %uint_1 None
-               OpBranch %220
-        %222 = OpLabel
-        %230 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %output %uint_0
-        %231 = OpArrayLength %uint %output 0
-        %232 = OpISub %uint %231 %uint_1
-        %233 = OpExtInst %uint %27 UMin %outputIndex %232
-        %234 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %233
-               OpStore %234 %uint_0 None
-               OpBranch %220
+        %229 = OpCompositeExtract %float %dstColor 1
+        %230 = OpCompositeExtract %float %srcColor 1
+        %212 = OpFunctionCall %bool %aboutEqual %229 %230
+               OpBranch %208
+        %210 = OpLabel
+               OpBranch %208
+        %208 = OpLabel
+        %211 = OpPhi %bool %212 %209 %false %210
+               OpSelectionMerge %213 None
+               OpBranchConditional %211 %214 %215
+        %214 = OpLabel
+        %231 = OpCompositeExtract %float %dstColor 2
+        %232 = OpCompositeExtract %float %srcColor 2
+        %217 = OpFunctionCall %bool %aboutEqual %231 %232
+               OpBranch %213
+        %215 = OpLabel
+               OpBranch %213
+        %213 = OpLabel
+        %216 = OpPhi %bool %217 %214 %false %215
+               OpSelectionMerge %218 None
+               OpBranchConditional %216 %219 %220
+        %219 = OpLabel
+        %233 = OpCompositeExtract %float %dstColor 3
+        %234 = OpCompositeExtract %float %srcColor 3
+        %222 = OpFunctionCall %bool %aboutEqual %233 %234
+               OpBranch %218
         %220 = OpLabel
+               OpBranch %218
+        %218 = OpLabel
+        %221 = OpPhi %bool %222 %219 %false %220
+               OpStore %success %221 None
+               OpBranch %156
+        %156 = OpLabel
+               OpBranch %71
+         %71 = OpLabel
+         %74 = OpCompositeExtract %uint %GlobalInvocationID 1
+         %75 = OpCompositeExtract %uint %dstSize 0
+         %76 = OpIMul %uint %74 %75
+         %77 = OpCompositeExtract %uint %GlobalInvocationID 0
+%outputIndex = OpIAdd %uint %76 %77
+         %79 = OpLoad %bool %success None
+               OpSelectionMerge %80 None
+               OpBranchConditional %79 %81 %82
+         %81 = OpLabel
+        %159 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %output %uint_0
+        %161 = OpArrayLength %uint %output 0
+        %162 = OpISub %uint %161 %uint_1
+        %163 = OpExtInst %uint %27 UMin %outputIndex %162
+        %164 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %163
+               OpStore %164 %uint_1 None
+               OpBranch %80
+         %82 = OpLabel
+        %166 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %output %uint_0
+        %167 = OpArrayLength %uint %output 0
+        %168 = OpISub %uint %167 %uint_1
+        %169 = OpExtInst %uint %27 UMin %outputIndex %168
+        %170 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %169
+               OpStore %170 %uint_0 None
+               OpBranch %80
+         %80 = OpLabel
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %236
diff --git a/test/tint/bug/tint/914.wgsl.expected.spvasm b/test/tint/bug/tint/914.wgsl.expected.spvasm
index 0bd2beb..4037c18 100644
--- a/test/tint/bug/tint/914.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/914.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 430
 ; Schema: 0
                OpCapability Shader
-         %63 = OpExtInstImport "GLSL.std.450"
+         %67 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %main "main" %main_local_invocation_id_Input %main_global_invocation_id_Input %main_local_invocation_index_Input
                OpExecutionMode %main LocalSize 16 16 1
@@ -53,25 +53,25 @@
                OpName %acc "acc"
                OpName %ACached "ACached"
                OpName %BCached "BCached"
-               OpName %index_0 "index"
                OpName %ColPerThreadA "ColPerThreadA"
                OpName %tileColA "tileColA"
                OpName %ColPerThreadA "RowPerThreadB"
                OpName %tileRowB "tileRowB"
+               OpName %index_0 "index"
                OpName %t "t"
                OpName %innerRow "innerRow"
+               OpName %innerRow_0 "innerRow"
+               OpName %innerRow_1 "innerRow"
+               OpName %k "k"
                OpName %innerCol "innerCol"
+               OpName %index_1 "index"
+               OpName %innerCol_0 "innerCol"
                OpName %inputRow "inputRow"
                OpName %inputCol "inputCol"
-               OpName %innerRow_0 "innerRow"
-               OpName %innerCol_0 "innerCol"
+               OpName %innerCol_1 "innerCol"
                OpName %inputRow_0 "inputRow"
                OpName %inputCol_0 "inputCol"
-               OpName %k "k"
                OpName %inner "inner"
-               OpName %innerRow_1 "innerRow"
-               OpName %innerCol_1 "innerCol"
-               OpName %index_1 "index"
                OpName %innerRow_2 "innerRow"
                OpName %innerCol_2 "innerCol"
                OpName %index_2 "index"
@@ -135,8 +135,8 @@
        %true = OpConstantTrue %bool
 %_ptr_Uniform_uint = OpTypePointer Uniform %uint
      %uint_0 = OpConstant %uint 0
-     %uint_1 = OpConstant %uint 1
       %false = OpConstantFalse %bool
+     %uint_1 = OpConstant %uint 1
 %_ptr_StorageBuffer__runtimearr_float = OpTypePointer StorageBuffer %_runtimearr_float
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
     %float_0 = OpConstant %float 0
@@ -146,18 +146,18 @@
 %_ptr_StorageBuffer__runtimearr_float_0 = OpTypePointer StorageBuffer %_runtimearr_float
 %_ptr_StorageBuffer_float_0 = OpTypePointer StorageBuffer %float
         %139 = OpTypeFunction %void %v3uint %v3uint %uint
-  %uint_4096 = OpConstant %uint 4096
-%_ptr_Workgroup_float = OpTypePointer Workgroup %float
-   %uint_256 = OpConstant %uint 256
    %uint_264 = OpConstant %uint 264
 %ColPerThreadA = OpConstant %uint 4
     %uint_16 = OpConstant %uint 16
 %_arr_float_uint_16 = OpTypeArray %float %uint_16
 %_ptr_Function__arr_float_uint_16 = OpTypePointer Function %_arr_float_uint_16
-        %181 = OpConstantNull %_arr_float_uint_16
+        %169 = OpConstantNull %_arr_float_uint_16
 %_arr_float_ColPerThreadA = OpTypeArray %float %ColPerThreadA
 %_ptr_Function__arr_float_ColPerThreadA = OpTypePointer Function %_arr_float_ColPerThreadA
-        %186 = OpConstantNull %_arr_float_ColPerThreadA
+        %174 = OpConstantNull %_arr_float_ColPerThreadA
+  %uint_4096 = OpConstant %uint 4096
+%_ptr_Workgroup_float = OpTypePointer Workgroup %float
+   %uint_256 = OpConstant %uint 256
 %_ptr_Function_uint = OpTypePointer Function %uint
     %uint_15 = OpConstant %uint 15
     %uint_63 = OpConstant %uint 63
@@ -177,40 +177,40 @@
                OpSelectionMerge %43 None
                OpBranchConditional %42 %44 %45
          %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_1
-         %48 = OpLoad %uint %46 None
-         %49 = OpULessThan %bool %col %48
+         %55 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_1
+         %57 = OpLoad %uint %55 None
+         %47 = OpULessThan %bool %col %57
                OpBranch %43
          %45 = OpLabel
                OpBranch %43
          %43 = OpLabel
-         %50 = OpPhi %bool %49 %44 %false %45
-               OpSelectionMerge %52 None
-               OpBranchConditional %50 %53 %52
-         %53 = OpLabel
-         %54 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_1
-         %55 = OpLoad %uint %54 None
-         %56 = OpIMul %uint %row %55
-         %57 = OpIAdd %uint %56 %col
-         %58 = OpAccessChain %_ptr_StorageBuffer__runtimearr_float %firstMatrix %uint_0
-         %60 = OpArrayLength %uint %firstMatrix 0
-         %61 = OpISub %uint %60 %uint_1
-         %62 = OpExtInst %uint %63 UMin %57 %61
-         %64 = OpAccessChain %_ptr_StorageBuffer_float %firstMatrix %uint_0 %62
-     %result = OpLoad %float %64 None
+         %46 = OpPhi %bool %47 %44 %false %45
+               OpSelectionMerge %49 None
+               OpBranchConditional %46 %50 %49
+         %50 = OpLabel
+         %58 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_1
+         %59 = OpLoad %uint %58 None
+         %60 = OpIMul %uint %row %59
+         %61 = OpIAdd %uint %60 %col
+         %62 = OpAccessChain %_ptr_StorageBuffer__runtimearr_float %firstMatrix %uint_0
+         %64 = OpArrayLength %uint %firstMatrix 0
+         %65 = OpISub %uint %64 %uint_1
+         %66 = OpExtInst %uint %67 UMin %61 %65
+         %68 = OpAccessChain %_ptr_StorageBuffer_float %firstMatrix %uint_0 %66
+     %result = OpLoad %float %68 None
                OpStore %continue_execution %false None
                OpStore %return_value %result None
+               OpBranch %49
+         %49 = OpLabel
+         %51 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %52 None
+               OpBranchConditional %51 %53 %52
+         %53 = OpLabel
+               OpStore %return_value %float_0 None
                OpBranch %52
          %52 = OpLabel
-         %67 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %68 None
-               OpBranchConditional %67 %69 %68
-         %69 = OpLabel
-               OpStore %return_value %float_0 None
-               OpBranch %68
-         %68 = OpLabel
-         %71 = OpLoad %float %return_value None
-               OpReturnValue %71
+         %54 = OpLoad %float %return_value None
+               OpReturnValue %54
                OpFunctionEnd
    %mm_readB = OpFunction %float None %29
       %row_0 = OpFunctionParameter %uint
@@ -225,40 +225,40 @@
                OpSelectionMerge %81 None
                OpBranchConditional %80 %82 %83
          %82 = OpLabel
-         %84 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_2
-         %86 = OpLoad %uint %84 None
-         %87 = OpULessThan %bool %col_0 %86
+         %92 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_2
+         %94 = OpLoad %uint %92 None
+         %85 = OpULessThan %bool %col_0 %94
                OpBranch %81
          %83 = OpLabel
                OpBranch %81
          %81 = OpLabel
-         %88 = OpPhi %bool %87 %82 %false %83
+         %84 = OpPhi %bool %85 %82 %false %83
+               OpSelectionMerge %86 None
+               OpBranchConditional %84 %87 %86
+         %87 = OpLabel
+         %95 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_2
+         %96 = OpLoad %uint %95 None
+         %97 = OpIMul %uint %row_0 %96
+         %98 = OpIAdd %uint %97 %col_0
+         %99 = OpAccessChain %_ptr_StorageBuffer__runtimearr_float %secondMatrix %uint_0
+        %100 = OpArrayLength %uint %secondMatrix 0
+        %101 = OpISub %uint %100 %uint_1
+        %102 = OpExtInst %uint %67 UMin %98 %101
+        %103 = OpAccessChain %_ptr_StorageBuffer_float %secondMatrix %uint_0 %102
+   %result_0 = OpLoad %float %103 None
+               OpStore %continue_execution_0 %false None
+               OpStore %return_value_0 %result_0 None
+               OpBranch %86
+         %86 = OpLabel
+         %88 = OpLoad %bool %continue_execution_0 None
                OpSelectionMerge %89 None
                OpBranchConditional %88 %90 %89
          %90 = OpLabel
-         %91 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_2
-         %92 = OpLoad %uint %91 None
-         %93 = OpIMul %uint %row_0 %92
-         %94 = OpIAdd %uint %93 %col_0
-         %95 = OpAccessChain %_ptr_StorageBuffer__runtimearr_float %secondMatrix %uint_0
-         %96 = OpArrayLength %uint %secondMatrix 0
-         %97 = OpISub %uint %96 %uint_1
-         %98 = OpExtInst %uint %63 UMin %94 %97
-         %99 = OpAccessChain %_ptr_StorageBuffer_float %secondMatrix %uint_0 %98
-   %result_0 = OpLoad %float %99 None
-               OpStore %continue_execution_0 %false None
-               OpStore %return_value_0 %result_0 None
+               OpStore %return_value_0 %float_0 None
                OpBranch %89
          %89 = OpLabel
-        %101 = OpLoad %bool %continue_execution_0 None
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %102
-        %103 = OpLabel
-               OpStore %return_value_0 %float_0 None
-               OpBranch %102
-        %102 = OpLabel
-        %104 = OpLoad %float %return_value_0 None
-               OpReturnValue %104
+         %91 = OpLoad %float %return_value_0 None
+               OpReturnValue %91
                OpFunctionEnd
    %mm_write = OpFunction %void None %110
       %row_1 = OpFunctionParameter %uint
@@ -271,17 +271,17 @@
                OpSelectionMerge %115 None
                OpBranchConditional %114 %116 %117
         %116 = OpLabel
-        %118 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_2
-        %119 = OpLoad %uint %118 None
-        %120 = OpULessThan %bool %col_1 %119
+        %122 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_2
+        %123 = OpLoad %uint %122 None
+        %119 = OpULessThan %bool %col_1 %123
                OpBranch %115
         %117 = OpLabel
                OpBranch %115
         %115 = OpLabel
-        %121 = OpPhi %bool %120 %116 %false %117
-               OpSelectionMerge %122 None
-               OpBranchConditional %121 %123 %122
-        %123 = OpLabel
+        %118 = OpPhi %bool %119 %116 %false %117
+               OpSelectionMerge %120 None
+               OpBranchConditional %118 %121 %120
+        %121 = OpLabel
         %124 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_2
         %125 = OpLoad %uint %124 None
         %126 = OpIMul %uint %row_1 %125
@@ -289,11 +289,11 @@
         %128 = OpAccessChain %_ptr_StorageBuffer__runtimearr_float_0 %resultMatrix %uint_0
         %130 = OpArrayLength %uint %resultMatrix 0
         %131 = OpISub %uint %130 %uint_1
-        %132 = OpExtInst %uint %63 UMin %index %131
+        %132 = OpExtInst %uint %67 UMin %index %131
         %133 = OpAccessChain %_ptr_StorageBuffer_float_0 %resultMatrix %uint_0 %132
                OpStore %133 %value None
-               OpBranch %122
-        %122 = OpLabel
+               OpBranch %120
+        %120 = OpLabel
                OpReturn
                OpFunctionEnd
  %main_inner = OpFunction %void None %139
@@ -301,19 +301,19 @@
   %global_id = OpFunctionParameter %v3uint
 %tint_local_index = OpFunctionParameter %uint
         %140 = OpLabel
-        %acc = OpVariable %_ptr_Function__arr_float_uint_16 Function %181
+        %acc = OpVariable %_ptr_Function__arr_float_uint_16 Function %169
     %ACached = OpVariable %_ptr_Function_float Function %33
-    %BCached = OpVariable %_ptr_Function__arr_float_ColPerThreadA Function %186
+    %BCached = OpVariable %_ptr_Function__arr_float_ColPerThreadA Function %174
     %index_0 = OpVariable %_ptr_Function_uint Function
           %t = OpVariable %_ptr_Function_uint Function
    %innerRow = OpVariable %_ptr_Function_uint Function
-   %innerCol = OpVariable %_ptr_Function_uint Function
  %innerRow_0 = OpVariable %_ptr_Function_uint Function
- %innerCol_0 = OpVariable %_ptr_Function_uint Function
-          %k = OpVariable %_ptr_Function_uint Function
-      %inner = OpVariable %_ptr_Function_uint Function
  %innerRow_1 = OpVariable %_ptr_Function_uint Function
+          %k = OpVariable %_ptr_Function_uint Function
+   %innerCol = OpVariable %_ptr_Function_uint Function
+ %innerCol_0 = OpVariable %_ptr_Function_uint Function
  %innerCol_1 = OpVariable %_ptr_Function_uint Function
+      %inner = OpVariable %_ptr_Function_uint Function
  %innerRow_2 = OpVariable %_ptr_Function_uint Function
  %innerCol_2 = OpVariable %_ptr_Function_uint Function
                OpBranch %141
@@ -324,390 +324,390 @@
                OpLoopMerge %145 %143 None
                OpBranch %142
         %142 = OpLabel
-        %148 = OpUGreaterThanEqual %bool %146 %uint_4096
-               OpSelectionMerge %150 None
-               OpBranchConditional %148 %151 %150
-        %151 = OpLabel
+        %194 = OpUGreaterThanEqual %bool %146 %uint_4096
+               OpSelectionMerge %196 None
+               OpBranchConditional %194 %197 %196
+        %197 = OpLabel
                OpBranch %145
-        %150 = OpLabel
-        %152 = OpUMod %uint %146 %uint_64
-        %153 = OpUDiv %uint %146 %uint_64
-        %154 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %153 %152
-               OpStore %154 %float_0 None
-        %156 = OpUMod %uint %146 %uint_64
-        %157 = OpUDiv %uint %146 %uint_64
-        %158 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %157 %156
-               OpStore %158 %float_0 None
+        %196 = OpLabel
+        %198 = OpUMod %uint %146 %uint_64
+        %199 = OpUDiv %uint %146 %uint_64
+        %200 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %199 %198
+               OpStore %200 %float_0 None
+        %202 = OpUMod %uint %146 %uint_64
+        %203 = OpUDiv %uint %146 %uint_64
+        %204 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %203 %202
+               OpStore %204 %float_0 None
                OpBranch %143
         %143 = OpLabel
         %147 = OpIAdd %uint %146 %uint_256
                OpBranch %144
         %145 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-        %162 = OpCompositeExtract %uint %local_id 1
-    %tileRow = OpIMul %uint %162 %ColPerThreadA
-        %165 = OpCompositeExtract %uint %local_id 0
-    %tileCol = OpIMul %uint %165 %ColPerThreadA
-        %167 = OpCompositeExtract %uint %global_id 1
-  %globalRow = OpIMul %uint %167 %ColPerThreadA
-        %169 = OpCompositeExtract %uint %global_id 0
-  %globalCol = OpIMul %uint %169 %ColPerThreadA
-        %171 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_1
-        %172 = OpLoad %uint %171 None
-        %173 = OpISub %uint %172 %uint_1
-        %174 = OpFunctionCall %uint %tint_div_u32 %173 %uint_64
-   %numTiles = OpIAdd %uint %174 %uint_1
+        %150 = OpCompositeExtract %uint %local_id 1
+    %tileRow = OpIMul %uint %150 %ColPerThreadA
+        %153 = OpCompositeExtract %uint %local_id 0
+    %tileCol = OpIMul %uint %153 %ColPerThreadA
+        %155 = OpCompositeExtract %uint %global_id 1
+  %globalRow = OpIMul %uint %155 %ColPerThreadA
+        %157 = OpCompositeExtract %uint %global_id 0
+  %globalCol = OpIMul %uint %157 %ColPerThreadA
+        %159 = OpAccessChain %_ptr_Uniform_uint %9 %uint_0 %uint_1
+        %160 = OpLoad %uint %159 None
+        %161 = OpISub %uint %160 %uint_1
+        %162 = OpFunctionCall %uint %tint_div_u32 %161 %uint_64
+   %numTiles = OpIAdd %uint %162 %uint_1
+               OpBranch %175
+        %175 = OpLabel
+               OpStore %index_0 %uint_0
+               OpBranch %178
+        %178 = OpLabel
+               OpLoopMerge %179 %177 None
+               OpBranch %176
+        %176 = OpLabel
+        %208 = OpLoad %uint %index_0 None
+        %209 = OpULessThan %bool %208 %uint_16
+               OpSelectionMerge %210 None
+               OpBranchConditional %209 %210 %211
+        %211 = OpLabel
+               OpBranch %179
+        %210 = OpLabel
+        %212 = OpLoad %uint %index_0 None
+        %213 = OpExtInst %uint %67 UMin %212 %uint_15
+        %215 = OpAccessChain %_ptr_Function_float %acc %213
+               OpStore %215 %float_0 None
+               OpBranch %177
+        %177 = OpLabel
+        %216 = OpLoad %uint %index_0 None
+        %217 = OpIAdd %uint %216 %uint_1
+               OpStore %index_0 %217 None
+               OpBranch %178
+        %179 = OpLabel
+        %180 = OpCompositeExtract %uint %local_id 0
+   %tileColA = OpIMul %uint %180 %ColPerThreadA
+        %182 = OpCompositeExtract %uint %local_id 1
+   %tileRowB = OpIMul %uint %182 %ColPerThreadA
+               OpBranch %184
+        %184 = OpLabel
+               OpStore %t %uint_0
                OpBranch %187
         %187 = OpLabel
-               OpStore %index_0 %uint_0
-               OpBranch %190
-        %190 = OpLabel
-               OpLoopMerge %191 %189 None
+               OpLoopMerge %188 %186 None
+               OpBranch %185
+        %185 = OpLabel
+        %219 = OpLoad %uint %t None
+        %220 = OpULessThan %bool %219 %numTiles
+               OpSelectionMerge %221 None
+               OpBranchConditional %220 %221 %222
+        %222 = OpLabel
                OpBranch %188
-        %188 = OpLabel
-        %194 = OpLoad %uint %index_0 None
-        %195 = OpULessThan %bool %194 %uint_16
-               OpSelectionMerge %196 None
-               OpBranchConditional %195 %196 %197
-        %197 = OpLabel
-               OpBranch %191
-        %196 = OpLabel
-        %198 = OpLoad %uint %index_0 None
-        %199 = OpExtInst %uint %63 UMin %198 %uint_15
-        %201 = OpAccessChain %_ptr_Function_float %acc %199
-               OpStore %201 %float_0 None
-               OpBranch %189
-        %189 = OpLabel
-        %202 = OpLoad %uint %index_0 None
-        %203 = OpIAdd %uint %202 %uint_1
-               OpStore %index_0 %203 None
-               OpBranch %190
-        %191 = OpLabel
-        %204 = OpCompositeExtract %uint %local_id 0
-   %tileColA = OpIMul %uint %204 %ColPerThreadA
-        %206 = OpCompositeExtract %uint %local_id 1
-   %tileRowB = OpIMul %uint %206 %ColPerThreadA
-               OpBranch %208
-        %208 = OpLabel
-               OpStore %t %uint_0
-               OpBranch %211
-        %211 = OpLabel
-               OpLoopMerge %212 %210 None
-               OpBranch %209
-        %209 = OpLabel
-        %214 = OpLoad %uint %t None
-        %215 = OpULessThan %bool %214 %numTiles
-               OpSelectionMerge %216 None
-               OpBranchConditional %215 %216 %217
-        %217 = OpLabel
-               OpBranch %212
-        %216 = OpLabel
-               OpBranch %218
-        %218 = OpLabel
-               OpStore %innerRow %uint_0
-               OpBranch %221
         %221 = OpLabel
-               OpLoopMerge %222 %220 None
-               OpBranch %219
-        %219 = OpLabel
-        %224 = OpLoad %uint %innerRow None
-        %225 = OpULessThan %bool %224 %ColPerThreadA
-               OpSelectionMerge %226 None
-               OpBranchConditional %225 %226 %227
-        %227 = OpLabel
-               OpBranch %222
+               OpBranch %223
+        %223 = OpLabel
+               OpStore %innerRow_0 %uint_0
+               OpBranch %226
         %226 = OpLabel
+               OpLoopMerge %227 %225 None
+               OpBranch %224
+        %224 = OpLabel
+        %255 = OpLoad %uint %innerRow_0 None
+        %256 = OpULessThan %bool %255 %ColPerThreadA
+               OpSelectionMerge %257 None
+               OpBranchConditional %256 %257 %258
+        %258 = OpLabel
+               OpBranch %227
+        %257 = OpLabel
+               OpBranch %259
+        %259 = OpLabel
+               OpStore %innerCol_0 %uint_0
+               OpBranch %262
+        %262 = OpLabel
+               OpLoopMerge %263 %261 None
+               OpBranch %260
+        %260 = OpLabel
+        %315 = OpLoad %uint %innerCol_0 None
+        %316 = OpULessThan %bool %315 %ColPerThreadA
+               OpSelectionMerge %317 None
+               OpBranchConditional %316 %317 %318
+        %318 = OpLabel
+               OpBranch %263
+        %317 = OpLabel
+        %319 = OpLoad %uint %innerRow_0 None
+   %inputRow = OpIAdd %uint %tileRow %319
+        %321 = OpLoad %uint %innerCol_0 None
+   %inputCol = OpIAdd %uint %tileColA %321
+        %323 = OpExtInst %uint %67 UMin %inputRow %uint_63
+        %325 = OpExtInst %uint %67 UMin %inputCol %uint_63
+        %326 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %323 %325
+        %327 = OpLoad %uint %innerRow_0 None
+        %328 = OpIAdd %uint %globalRow %327
+        %329 = OpLoad %uint %t None
+        %330 = OpIMul %uint %329 %uint_64
+        %331 = OpIAdd %uint %330 %inputCol
+        %332 = OpFunctionCall %float %mm_readA %328 %331
+               OpStore %326 %332 None
+               OpBranch %261
+        %261 = OpLabel
+        %333 = OpLoad %uint %innerCol_0 None
+        %334 = OpIAdd %uint %333 %uint_1
+               OpStore %innerCol_0 %334 None
+               OpBranch %262
+        %263 = OpLabel
+               OpBranch %225
+        %225 = OpLabel
+        %264 = OpLoad %uint %innerRow_0 None
+        %265 = OpIAdd %uint %264 %uint_1
+               OpStore %innerRow_0 %265 None
+               OpBranch %226
+        %227 = OpLabel
                OpBranch %228
         %228 = OpLabel
-               OpStore %innerCol %uint_0
+               OpStore %innerRow_1 %uint_0
                OpBranch %231
         %231 = OpLabel
                OpLoopMerge %232 %230 None
                OpBranch %229
         %229 = OpLabel
-        %234 = OpLoad %uint %innerCol None
-        %235 = OpULessThan %bool %234 %ColPerThreadA
-               OpSelectionMerge %236 None
-               OpBranchConditional %235 %236 %237
-        %237 = OpLabel
+        %267 = OpLoad %uint %innerRow_1 None
+        %268 = OpULessThan %bool %267 %ColPerThreadA
+               OpSelectionMerge %269 None
+               OpBranchConditional %268 %269 %270
+        %270 = OpLabel
                OpBranch %232
-        %236 = OpLabel
-        %238 = OpLoad %uint %innerRow None
-   %inputRow = OpIAdd %uint %tileRow %238
-        %240 = OpLoad %uint %innerCol None
-   %inputCol = OpIAdd %uint %tileColA %240
-        %242 = OpExtInst %uint %63 UMin %inputRow %uint_63
-        %244 = OpExtInst %uint %63 UMin %inputCol %uint_63
-        %245 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %242 %244
-        %246 = OpLoad %uint %innerRow None
-        %247 = OpIAdd %uint %globalRow %246
-        %248 = OpLoad %uint %t None
-        %249 = OpIMul %uint %248 %uint_64
-        %250 = OpIAdd %uint %249 %inputCol
-        %251 = OpFunctionCall %float %mm_readA %247 %250
-               OpStore %245 %251 None
+        %269 = OpLabel
+               OpBranch %271
+        %271 = OpLabel
+               OpStore %innerCol_1 %uint_0
+               OpBranch %274
+        %274 = OpLabel
+               OpLoopMerge %275 %273 None
+               OpBranch %272
+        %272 = OpLabel
+        %336 = OpLoad %uint %innerCol_1 None
+        %337 = OpULessThan %bool %336 %ColPerThreadA
+               OpSelectionMerge %338 None
+               OpBranchConditional %337 %338 %339
+        %339 = OpLabel
+               OpBranch %275
+        %338 = OpLabel
+        %340 = OpLoad %uint %innerRow_1 None
+ %inputRow_0 = OpIAdd %uint %tileRowB %340
+        %342 = OpLoad %uint %innerCol_1 None
+ %inputCol_0 = OpIAdd %uint %tileCol %342
+        %344 = OpLoad %uint %innerCol_1 None
+        %345 = OpExtInst %uint %67 UMin %344 %uint_63
+        %346 = OpExtInst %uint %67 UMin %inputCol_0 %uint_63
+        %347 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %345 %346
+        %348 = OpLoad %uint %t None
+        %349 = OpIMul %uint %348 %uint_64
+        %350 = OpIAdd %uint %349 %inputRow_0
+        %351 = OpLoad %uint %innerCol_1 None
+        %352 = OpIAdd %uint %globalCol %351
+        %353 = OpFunctionCall %float %mm_readB %350 %352
+               OpStore %347 %353 None
+               OpBranch %273
+        %273 = OpLabel
+        %354 = OpLoad %uint %innerCol_1 None
+        %355 = OpIAdd %uint %354 %uint_1
+               OpStore %innerCol_1 %355 None
+               OpBranch %274
+        %275 = OpLabel
                OpBranch %230
         %230 = OpLabel
-        %252 = OpLoad %uint %innerCol None
-        %253 = OpIAdd %uint %252 %uint_1
-               OpStore %innerCol %253 None
+        %276 = OpLoad %uint %innerRow_1 None
+        %277 = OpIAdd %uint %276 %uint_1
+               OpStore %innerRow_1 %277 None
                OpBranch %231
         %232 = OpLabel
-               OpBranch %220
-        %220 = OpLabel
-        %254 = OpLoad %uint %innerRow None
-        %255 = OpIAdd %uint %254 %uint_1
-               OpStore %innerRow %255 None
-               OpBranch %221
-        %222 = OpLabel
-               OpBranch %256
-        %256 = OpLabel
-               OpStore %innerRow_0 %uint_0
-               OpBranch %259
-        %259 = OpLabel
-               OpLoopMerge %260 %258 None
-               OpBranch %257
-        %257 = OpLabel
-        %262 = OpLoad %uint %innerRow_0 None
-        %263 = OpULessThan %bool %262 %ColPerThreadA
-               OpSelectionMerge %264 None
-               OpBranchConditional %263 %264 %265
-        %265 = OpLabel
-               OpBranch %260
-        %264 = OpLabel
-               OpBranch %266
-        %266 = OpLabel
-               OpStore %innerCol_0 %uint_0
-               OpBranch %269
-        %269 = OpLabel
-               OpLoopMerge %270 %268 None
-               OpBranch %267
-        %267 = OpLabel
-        %272 = OpLoad %uint %innerCol_0 None
-        %273 = OpULessThan %bool %272 %ColPerThreadA
-               OpSelectionMerge %274 None
-               OpBranchConditional %273 %274 %275
-        %275 = OpLabel
-               OpBranch %270
-        %274 = OpLabel
-        %276 = OpLoad %uint %innerRow_0 None
- %inputRow_0 = OpIAdd %uint %tileRowB %276
-        %278 = OpLoad %uint %innerCol_0 None
- %inputCol_0 = OpIAdd %uint %tileCol %278
-        %280 = OpLoad %uint %innerCol_0 None
-        %281 = OpExtInst %uint %63 UMin %280 %uint_63
-        %282 = OpExtInst %uint %63 UMin %inputCol_0 %uint_63
-        %283 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %281 %282
-        %284 = OpLoad %uint %t None
-        %285 = OpIMul %uint %284 %uint_64
-        %286 = OpIAdd %uint %285 %inputRow_0
-        %287 = OpLoad %uint %innerCol_0 None
-        %288 = OpIAdd %uint %globalCol %287
-        %289 = OpFunctionCall %float %mm_readB %286 %288
-               OpStore %283 %289 None
-               OpBranch %268
-        %268 = OpLabel
-        %290 = OpLoad %uint %innerCol_0 None
-        %291 = OpIAdd %uint %290 %uint_1
-               OpStore %innerCol_0 %291 None
-               OpBranch %269
-        %270 = OpLabel
-               OpBranch %258
-        %258 = OpLabel
-        %292 = OpLoad %uint %innerRow_0 None
-        %293 = OpIAdd %uint %292 %uint_1
-               OpStore %innerRow_0 %293 None
-               OpBranch %259
-        %260 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpBranch %295
-        %295 = OpLabel
+               OpBranch %234
+        %234 = OpLabel
                OpStore %k %uint_0
-               OpBranch %298
-        %298 = OpLabel
-               OpLoopMerge %299 %297 None
-               OpBranch %296
-        %296 = OpLabel
-        %301 = OpLoad %uint %k None
-        %302 = OpULessThan %bool %301 %uint_64
-               OpSelectionMerge %303 None
-               OpBranchConditional %302 %303 %304
-        %304 = OpLabel
-               OpBranch %299
-        %303 = OpLabel
-               OpBranch %305
-        %305 = OpLabel
+               OpBranch %237
+        %237 = OpLabel
+               OpLoopMerge %238 %236 None
+               OpBranch %235
+        %235 = OpLabel
+        %279 = OpLoad %uint %k None
+        %280 = OpULessThan %bool %279 %uint_64
+               OpSelectionMerge %281 None
+               OpBranchConditional %280 %281 %282
+        %282 = OpLabel
+               OpBranch %238
+        %281 = OpLabel
+               OpBranch %283
+        %283 = OpLabel
                OpStore %inner %uint_0
-               OpBranch %308
-        %308 = OpLabel
-               OpLoopMerge %309 %307 None
-               OpBranch %306
-        %306 = OpLabel
-        %311 = OpLoad %uint %inner None
-        %312 = OpULessThan %bool %311 %ColPerThreadA
-               OpSelectionMerge %313 None
-               OpBranchConditional %312 %313 %314
-        %314 = OpLabel
-               OpBranch %309
-        %313 = OpLabel
-        %315 = OpLoad %uint %inner None
-        %316 = OpExtInst %uint %63 UMin %315 %uint_3
-        %318 = OpAccessChain %_ptr_Function_float %BCached %316
-        %319 = OpLoad %uint %k None
-        %320 = OpLoad %uint %inner None
-        %321 = OpIAdd %uint %tileCol %320
-        %322 = OpExtInst %uint %63 UMin %319 %uint_63
-        %323 = OpExtInst %uint %63 UMin %321 %uint_63
-        %324 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %322 %323
-        %325 = OpLoad %float %324 None
-               OpStore %318 %325 None
-               OpBranch %307
-        %307 = OpLabel
-        %326 = OpLoad %uint %inner None
-        %327 = OpIAdd %uint %326 %uint_1
-               OpStore %inner %327 None
-               OpBranch %308
-        %309 = OpLabel
-               OpBranch %328
-        %328 = OpLabel
-               OpStore %innerRow_1 %uint_0
-               OpBranch %331
-        %331 = OpLabel
-               OpLoopMerge %332 %330 None
-               OpBranch %329
-        %329 = OpLabel
-        %334 = OpLoad %uint %innerRow_1 None
-        %335 = OpULessThan %bool %334 %ColPerThreadA
-               OpSelectionMerge %336 None
-               OpBranchConditional %335 %336 %337
-        %337 = OpLabel
-               OpBranch %332
-        %336 = OpLabel
-        %338 = OpLoad %uint %innerRow_1 None
-        %339 = OpIAdd %uint %tileRow %338
-        %340 = OpLoad %uint %k None
-        %341 = OpExtInst %uint %63 UMin %339 %uint_63
-        %342 = OpExtInst %uint %63 UMin %340 %uint_63
-        %343 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %341 %342
-        %344 = OpLoad %float %343 None
-               OpStore %ACached %344 None
-               OpBranch %345
-        %345 = OpLabel
-               OpStore %innerCol_1 %uint_0
-               OpBranch %348
-        %348 = OpLabel
-               OpLoopMerge %349 %347 None
-               OpBranch %346
-        %346 = OpLabel
-        %351 = OpLoad %uint %innerCol_1 None
-        %352 = OpULessThan %bool %351 %ColPerThreadA
-               OpSelectionMerge %353 None
-               OpBranchConditional %352 %353 %354
-        %354 = OpLabel
-               OpBranch %349
-        %353 = OpLabel
-        %355 = OpLoad %uint %innerRow_1 None
-        %356 = OpIMul %uint %355 %ColPerThreadA
-        %357 = OpLoad %uint %innerCol_1 None
-    %index_1 = OpIAdd %uint %356 %357
-        %359 = OpExtInst %uint %63 UMin %index_1 %uint_15
-        %360 = OpAccessChain %_ptr_Function_float %acc %359
-        %361 = OpExtInst %uint %63 UMin %index_1 %uint_15
-        %362 = OpAccessChain %_ptr_Function_float %acc %361
-        %363 = OpLoad %float %362 None
-        %364 = OpLoad %float %ACached None
-        %365 = OpLoad %uint %innerCol_1 None
-        %366 = OpExtInst %uint %63 UMin %365 %uint_3
-        %367 = OpAccessChain %_ptr_Function_float %BCached %366
-        %368 = OpLoad %float %367 None
-        %369 = OpFMul %float %364 %368
-        %370 = OpFAdd %float %363 %369
-               OpStore %360 %370 None
-               OpBranch %347
-        %347 = OpLabel
-        %371 = OpLoad %uint %innerCol_1 None
-        %372 = OpIAdd %uint %371 %uint_1
-               OpStore %innerCol_1 %372 None
-               OpBranch %348
-        %349 = OpLabel
-               OpBranch %330
-        %330 = OpLabel
-        %373 = OpLoad %uint %innerRow_1 None
-        %374 = OpIAdd %uint %373 %uint_1
-               OpStore %innerRow_1 %374 None
-               OpBranch %331
-        %332 = OpLabel
-               OpBranch %297
-        %297 = OpLabel
-        %375 = OpLoad %uint %k None
-        %376 = OpIAdd %uint %375 %uint_1
-               OpStore %k %376 None
-               OpBranch %298
-        %299 = OpLabel
-               OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpBranch %210
-        %210 = OpLabel
-        %378 = OpLoad %uint %t None
-        %379 = OpIAdd %uint %378 %uint_1
-               OpStore %t %379 None
-               OpBranch %211
-        %212 = OpLabel
-               OpBranch %380
-        %380 = OpLabel
+               OpBranch %286
+        %286 = OpLabel
+               OpLoopMerge %287 %285 None
+               OpBranch %284
+        %284 = OpLabel
+        %357 = OpLoad %uint %inner None
+        %358 = OpULessThan %bool %357 %ColPerThreadA
+               OpSelectionMerge %359 None
+               OpBranchConditional %358 %359 %360
+        %360 = OpLabel
+               OpBranch %287
+        %359 = OpLabel
+        %361 = OpLoad %uint %inner None
+        %362 = OpExtInst %uint %67 UMin %361 %uint_3
+        %364 = OpAccessChain %_ptr_Function_float %BCached %362
+        %365 = OpLoad %uint %k None
+        %366 = OpLoad %uint %inner None
+        %367 = OpIAdd %uint %tileCol %366
+        %368 = OpExtInst %uint %67 UMin %365 %uint_63
+        %369 = OpExtInst %uint %67 UMin %367 %uint_63
+        %370 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %368 %369
+        %371 = OpLoad %float %370 None
+               OpStore %364 %371 None
+               OpBranch %285
+        %285 = OpLabel
+        %372 = OpLoad %uint %inner None
+        %373 = OpIAdd %uint %372 %uint_1
+               OpStore %inner %373 None
+               OpBranch %286
+        %287 = OpLabel
+               OpBranch %288
+        %288 = OpLabel
                OpStore %innerRow_2 %uint_0
-               OpBranch %383
-        %383 = OpLabel
-               OpLoopMerge %384 %382 None
-               OpBranch %381
-        %381 = OpLabel
-        %386 = OpLoad %uint %innerRow_2 None
-        %387 = OpULessThan %bool %386 %ColPerThreadA
-               OpSelectionMerge %388 None
-               OpBranchConditional %387 %388 %389
-        %389 = OpLabel
-               OpBranch %384
-        %388 = OpLabel
-               OpBranch %390
-        %390 = OpLabel
+               OpBranch %291
+        %291 = OpLabel
+               OpLoopMerge %292 %290 None
+               OpBranch %289
+        %289 = OpLabel
+        %375 = OpLoad %uint %innerRow_2 None
+        %376 = OpULessThan %bool %375 %ColPerThreadA
+               OpSelectionMerge %377 None
+               OpBranchConditional %376 %377 %378
+        %378 = OpLabel
+               OpBranch %292
+        %377 = OpLabel
+        %379 = OpLoad %uint %innerRow_2 None
+        %380 = OpIAdd %uint %tileRow %379
+        %381 = OpLoad %uint %k None
+        %382 = OpExtInst %uint %67 UMin %380 %uint_63
+        %383 = OpExtInst %uint %67 UMin %381 %uint_63
+        %384 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %382 %383
+        %385 = OpLoad %float %384 None
+               OpStore %ACached %385 None
+               OpBranch %386
+        %386 = OpLabel
                OpStore %innerCol_2 %uint_0
-               OpBranch %393
-        %393 = OpLabel
-               OpLoopMerge %394 %392 None
-               OpBranch %391
-        %391 = OpLabel
-        %396 = OpLoad %uint %innerCol_2 None
-        %397 = OpULessThan %bool %396 %ColPerThreadA
-               OpSelectionMerge %398 None
-               OpBranchConditional %397 %398 %399
-        %399 = OpLabel
-               OpBranch %394
-        %398 = OpLabel
-        %400 = OpLoad %uint %innerRow_2 None
-        %401 = OpIMul %uint %400 %ColPerThreadA
-        %402 = OpLoad %uint %innerCol_2 None
-    %index_2 = OpIAdd %uint %401 %402
-        %404 = OpLoad %uint %innerRow_2 None
-        %405 = OpIAdd %uint %globalRow %404
-        %406 = OpLoad %uint %innerCol_2 None
-        %407 = OpIAdd %uint %globalCol %406
-        %408 = OpExtInst %uint %63 UMin %index_2 %uint_15
-        %409 = OpAccessChain %_ptr_Function_float %acc %408
-        %410 = OpLoad %float %409 None
-        %411 = OpFunctionCall %void %mm_write %405 %407 %410
-               OpBranch %392
-        %392 = OpLabel
-        %412 = OpLoad %uint %innerCol_2 None
-        %413 = OpIAdd %uint %412 %uint_1
-               OpStore %innerCol_2 %413 None
-               OpBranch %393
-        %394 = OpLabel
-               OpBranch %382
-        %382 = OpLabel
-        %414 = OpLoad %uint %innerRow_2 None
+               OpBranch %389
+        %389 = OpLabel
+               OpLoopMerge %390 %388 None
+               OpBranch %387
+        %387 = OpLabel
+        %394 = OpLoad %uint %innerCol_2 None
+        %395 = OpULessThan %bool %394 %ColPerThreadA
+               OpSelectionMerge %396 None
+               OpBranchConditional %395 %396 %397
+        %397 = OpLabel
+               OpBranch %390
+        %396 = OpLabel
+        %398 = OpLoad %uint %innerRow_2 None
+        %399 = OpIMul %uint %398 %ColPerThreadA
+        %400 = OpLoad %uint %innerCol_2 None
+    %index_2 = OpIAdd %uint %399 %400
+        %402 = OpExtInst %uint %67 UMin %index_2 %uint_15
+        %403 = OpAccessChain %_ptr_Function_float %acc %402
+        %404 = OpExtInst %uint %67 UMin %index_2 %uint_15
+        %405 = OpAccessChain %_ptr_Function_float %acc %404
+        %406 = OpLoad %float %405 None
+        %407 = OpLoad %float %ACached None
+        %408 = OpLoad %uint %innerCol_2 None
+        %409 = OpExtInst %uint %67 UMin %408 %uint_3
+        %410 = OpAccessChain %_ptr_Function_float %BCached %409
+        %411 = OpLoad %float %410 None
+        %412 = OpFMul %float %407 %411
+        %413 = OpFAdd %float %406 %412
+               OpStore %403 %413 None
+               OpBranch %388
+        %388 = OpLabel
+        %414 = OpLoad %uint %innerCol_2 None
         %415 = OpIAdd %uint %414 %uint_1
-               OpStore %innerRow_2 %415 None
-               OpBranch %383
-        %384 = OpLabel
+               OpStore %innerCol_2 %415 None
+               OpBranch %389
+        %390 = OpLabel
+               OpBranch %290
+        %290 = OpLabel
+        %391 = OpLoad %uint %innerRow_2 None
+        %392 = OpIAdd %uint %391 %uint_1
+               OpStore %innerRow_2 %392 None
+               OpBranch %291
+        %292 = OpLabel
+               OpBranch %236
+        %236 = OpLabel
+        %293 = OpLoad %uint %k None
+        %294 = OpIAdd %uint %293 %uint_1
+               OpStore %k %294 None
+               OpBranch %237
+        %238 = OpLabel
+               OpControlBarrier %uint_2 %uint_2 %uint_264
+               OpBranch %186
+        %186 = OpLabel
+        %240 = OpLoad %uint %t None
+        %241 = OpIAdd %uint %240 %uint_1
+               OpStore %t %241 None
+               OpBranch %187
+        %188 = OpLabel
+               OpBranch %189
+        %189 = OpLabel
+               OpStore %innerRow %uint_0
+               OpBranch %192
+        %192 = OpLabel
+               OpLoopMerge %193 %191 None
+               OpBranch %190
+        %190 = OpLabel
+        %243 = OpLoad %uint %innerRow None
+        %244 = OpULessThan %bool %243 %ColPerThreadA
+               OpSelectionMerge %245 None
+               OpBranchConditional %244 %245 %246
+        %246 = OpLabel
+               OpBranch %193
+        %245 = OpLabel
+               OpBranch %247
+        %247 = OpLabel
+               OpStore %innerCol %uint_0
+               OpBranch %250
+        %250 = OpLabel
+               OpLoopMerge %251 %249 None
+               OpBranch %248
+        %248 = OpLabel
+        %296 = OpLoad %uint %innerCol None
+        %297 = OpULessThan %bool %296 %ColPerThreadA
+               OpSelectionMerge %298 None
+               OpBranchConditional %297 %298 %299
+        %299 = OpLabel
+               OpBranch %251
+        %298 = OpLabel
+        %300 = OpLoad %uint %innerRow None
+        %301 = OpIMul %uint %300 %ColPerThreadA
+        %302 = OpLoad %uint %innerCol None
+    %index_1 = OpIAdd %uint %301 %302
+        %304 = OpLoad %uint %innerRow None
+        %305 = OpIAdd %uint %globalRow %304
+        %306 = OpLoad %uint %innerCol None
+        %307 = OpIAdd %uint %globalCol %306
+        %308 = OpExtInst %uint %67 UMin %index_1 %uint_15
+        %309 = OpAccessChain %_ptr_Function_float %acc %308
+        %310 = OpLoad %float %309 None
+        %311 = OpFunctionCall %void %mm_write %305 %307 %310
+               OpBranch %249
+        %249 = OpLabel
+        %312 = OpLoad %uint %innerCol None
+        %313 = OpIAdd %uint %312 %uint_1
+               OpStore %innerCol %313 None
+               OpBranch %250
+        %251 = OpLabel
+               OpBranch %191
+        %191 = OpLabel
+        %252 = OpLoad %uint %innerRow None
+        %253 = OpIAdd %uint %252 %uint_1
+               OpStore %innerRow %253 None
+               OpBranch %192
+        %193 = OpLabel
                OpReturn
                OpFunctionEnd
 %tint_div_u32 = OpFunction %uint None %418
diff --git a/test/tint/bug/tint/942.wgsl.expected.spvasm b/test/tint/bug/tint/942.wgsl.expected.spvasm
index 4780c3d..754c779 100644
--- a/test/tint/bug/tint/942.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/942.wgsl.expected.spvasm
@@ -5,7 +5,7 @@
 ; Schema: 0
                OpCapability Shader
                OpCapability ImageQuery
-         %76 = OpExtInstImport "GLSL.std.450"
+         %65 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %main "main" %main_workgroup_id_Input %main_local_invocation_id_Input %main_local_invocation_index_Input
                OpExecutionMode %main LocalSize 64 1 1
@@ -33,9 +33,9 @@
                OpName %dims "dims"
                OpName %baseIndex "baseIndex"
                OpName %r "r"
+               OpName %r_0 "r"
                OpName %c "c"
                OpName %loadIndex "loadIndex"
-               OpName %r_0 "r"
                OpName %c_0 "c"
                OpName %writeIndex "writeIndex"
                OpName %center "center"
@@ -106,11 +106,6 @@
 %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %38 = OpTypeFunction %void %v3uint %v3uint %uint
-  %uint_1024 = OpConstant %uint 1024
-       %bool = OpTypeBool
-%_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
-         %56 = OpConstantNull %v3float
-    %uint_64 = OpConstant %uint 64
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Uniform_uint = OpTypePointer Uniform %uint
@@ -119,24 +114,29 @@
         %int = OpTypeInt 32 1
       %int_0 = OpConstant %int 0
      %v2uint = OpTypeVector %uint 2
-         %86 = OpConstantComposite %v2uint %uint_4 %uint_1
+         %75 = OpConstantComposite %v2uint %uint_4 %uint_1
+  %uint_1024 = OpConstant %uint 1024
+       %bool = OpTypeBool
+%_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
+         %99 = OpConstantNull %v3float
+    %uint_64 = OpConstant %uint 64
 %_ptr_Function_uint = OpTypePointer Function %uint
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
      %uint_3 = OpConstant %uint 3
    %uint_255 = OpConstant %uint 255
     %v2float = OpTypeVector %float 2
  %float_0_25 = OpConstant %float 0.25
-        %140 = OpConstantComposite %v2float %float_0_25 %float_0_25
-        %145 = OpTypeSampledImage %11
+        %158 = OpConstantComposite %v2float %float_0_25 %float_0_25
+        %163 = OpTypeSampledImage %11
     %v4float = OpTypeVector %float 4
     %float_0 = OpConstant %float 0
       %false = OpConstantFalse %bool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-%uint_4294967295 = OpConstant %uint 4294967295
-        %217 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-        %222 = OpConstantNull %v2uint
     %float_1 = OpConstant %float 1
+%uint_4294967295 = OpConstant %uint 4294967295
+        %227 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+        %232 = OpConstantNull %v2uint
         %273 = OpTypeFunction %uint %uint %uint
         %279 = OpTypeFunction %void
  %main_inner = OpFunction %void None %38
@@ -145,9 +145,9 @@
 %tint_local_index = OpFunctionParameter %uint
          %39 = OpLabel
           %r = OpVariable %_ptr_Function_uint Function
+        %r_0 = OpVariable %_ptr_Function_uint Function
           %c = OpVariable %_ptr_Function_uint Function
   %loadIndex = OpVariable %_ptr_Function_v2uint Function
-        %r_0 = OpVariable %_ptr_Function_uint Function
         %c_0 = OpVariable %_ptr_Function_uint Function
  %writeIndex = OpVariable %_ptr_Function_v2uint Function
         %acc = OpVariable %_ptr_Function_v3float Function
@@ -162,151 +162,151 @@
                OpLoopMerge %44 %42 None
                OpBranch %41
          %41 = OpLabel
-         %47 = OpUGreaterThanEqual %bool %45 %uint_1024
-               OpSelectionMerge %50 None
-               OpBranchConditional %47 %51 %50
-         %51 = OpLabel
+         %90 = OpUGreaterThanEqual %bool %45 %uint_1024
+               OpSelectionMerge %93 None
+               OpBranchConditional %90 %94 %93
+         %94 = OpLabel
                OpBranch %44
-         %50 = OpLabel
-         %52 = OpUMod %uint %45 %uint_256
-         %53 = OpUDiv %uint %45 %uint_256
-         %54 = OpAccessChain %_ptr_Workgroup_v3float %tile %53 %52
-               OpStore %54 %56 None
+         %93 = OpLabel
+         %95 = OpUMod %uint %45 %uint_256
+         %96 = OpUDiv %uint %45 %uint_256
+         %97 = OpAccessChain %_ptr_Workgroup_v3float %tile %96 %95
+               OpStore %97 %99 None
                OpBranch %42
          %42 = OpLabel
          %46 = OpIAdd %uint %45 %uint_64
                OpBranch %43
          %44 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %61 = OpAccessChain %_ptr_Uniform_uint %4 %uint_0 %uint_0
-         %64 = OpLoad %uint %61 None
-         %65 = OpISub %uint %64 %uint_1
-%filterOffset = OpFunctionCall %uint %tint_div_u32 %65 %uint_2
-         %69 = OpLoad %11 %inputTex None
-         %70 = OpImageQueryLevels %uint %69
-         %71 = OpISub %uint %70 %uint_1
-         %72 = OpBitcast %uint %int_0
-         %75 = OpExtInst %uint %76 UMin %72 %71
-       %dims = OpImageQuerySizeLod %v2uint %69 %75
-         %79 = OpVectorShuffle %v2uint %WorkGroupID %WorkGroupID 0 1
-         %80 = OpAccessChain %_ptr_Uniform_uint %4 %uint_0 %uint_1
-         %81 = OpLoad %uint %80 None
-         %82 = OpCompositeConstruct %v2uint %81 %uint_4
-         %83 = OpIMul %v2uint %79 %82
-         %84 = OpVectorShuffle %v2uint %LocalInvocationID %LocalInvocationID 0 1
-         %85 = OpIMul %v2uint %84 %86
-         %87 = OpIAdd %v2uint %83 %85
-         %88 = OpCompositeConstruct %v2uint %filterOffset %uint_0
-  %baseIndex = OpISub %v2uint %87 %88
-               OpBranch %90
-         %90 = OpLabel
+         %50 = OpAccessChain %_ptr_Uniform_uint %4 %uint_0 %uint_0
+         %53 = OpLoad %uint %50 None
+         %54 = OpISub %uint %53 %uint_1
+%filterOffset = OpFunctionCall %uint %tint_div_u32 %54 %uint_2
+         %58 = OpLoad %11 %inputTex None
+         %59 = OpImageQueryLevels %uint %58
+         %60 = OpISub %uint %59 %uint_1
+         %61 = OpBitcast %uint %int_0
+         %64 = OpExtInst %uint %65 UMin %61 %60
+       %dims = OpImageQuerySizeLod %v2uint %58 %64
+         %68 = OpVectorShuffle %v2uint %WorkGroupID %WorkGroupID 0 1
+         %69 = OpAccessChain %_ptr_Uniform_uint %4 %uint_0 %uint_1
+         %70 = OpLoad %uint %69 None
+         %71 = OpCompositeConstruct %v2uint %70 %uint_4
+         %72 = OpIMul %v2uint %68 %71
+         %73 = OpVectorShuffle %v2uint %LocalInvocationID %LocalInvocationID 0 1
+         %74 = OpIMul %v2uint %73 %75
+         %76 = OpIAdd %v2uint %72 %74
+         %77 = OpCompositeConstruct %v2uint %filterOffset %uint_0
+  %baseIndex = OpISub %v2uint %76 %77
+               OpBranch %79
+         %79 = OpLabel
                OpStore %r %uint_0
-               OpBranch %93
-         %93 = OpLabel
-               OpLoopMerge %94 %92 None
-               OpBranch %91
-         %91 = OpLabel
-         %97 = OpLoad %uint %r None
-         %98 = OpULessThan %bool %97 %uint_4
-               OpSelectionMerge %99 None
-               OpBranchConditional %98 %99 %100
-        %100 = OpLabel
-               OpBranch %94
-         %99 = OpLabel
-               OpBranch %101
-        %101 = OpLabel
+               OpBranch %82
+         %82 = OpLabel
+               OpLoopMerge %83 %81 None
+               OpBranch %80
+         %80 = OpLabel
+        %103 = OpLoad %uint %r None
+        %104 = OpULessThan %bool %103 %uint_4
+               OpSelectionMerge %105 None
+               OpBranchConditional %104 %105 %106
+        %106 = OpLabel
+               OpBranch %83
+        %105 = OpLabel
+               OpBranch %107
+        %107 = OpLabel
                OpStore %c %uint_0
-               OpBranch %104
-        %104 = OpLabel
-               OpLoopMerge %105 %103 None
-               OpBranch %102
-        %102 = OpLabel
-        %107 = OpLoad %uint %c None
-        %108 = OpULessThan %bool %107 %uint_4
-               OpSelectionMerge %109 None
-               OpBranchConditional %108 %109 %110
+               OpBranch %110
         %110 = OpLabel
-               OpBranch %105
+               OpLoopMerge %111 %109 None
+               OpBranch %108
+        %108 = OpLabel
+        %127 = OpLoad %uint %c None
+        %128 = OpULessThan %bool %127 %uint_4
+               OpSelectionMerge %129 None
+               OpBranchConditional %128 %129 %130
+        %130 = OpLabel
+               OpBranch %111
+        %129 = OpLabel
+        %131 = OpLoad %uint %c None
+        %132 = OpLoad %uint %r None
+        %133 = OpCompositeConstruct %v2uint %131 %132
+        %134 = OpIAdd %v2uint %baseIndex %133
+               OpStore %loadIndex %134
+        %137 = OpAccessChain %_ptr_Uniform_uint %16 %uint_0 %uint_0
+        %138 = OpLoad %uint %137 None
+        %139 = OpINotEqual %bool %138 %uint_0
+               OpSelectionMerge %140 None
+               OpBranchConditional %139 %141 %140
+        %141 = OpLabel
+        %205 = OpLoad %v2uint %loadIndex None
+        %206 = OpVectorShuffle %v2uint %205 %205 1 0
+               OpStore %loadIndex %206 None
+               OpBranch %140
+        %140 = OpLabel
+        %142 = OpLoad %uint %r None
+        %143 = OpCompositeExtract %uint %LocalInvocationID 0
+        %144 = OpIMul %uint %uint_4 %143
+        %145 = OpLoad %uint %c None
+        %146 = OpIAdd %uint %144 %145
+        %147 = OpExtInst %uint %65 UMin %142 %uint_3
+        %149 = OpExtInst %uint %65 UMin %146 %uint_255
+        %151 = OpAccessChain %_ptr_Workgroup_v3float %tile %147 %149
+        %152 = OpLoad %11 %inputTex None
+        %153 = OpLoad %3 %samp None
+        %154 = OpLoad %v2uint %loadIndex None
+        %156 = OpConvertUToF %v2float %154
+        %157 = OpFAdd %v2float %156 %158
+        %160 = OpConvertUToF %v2float %dims
+        %161 = OpFDiv %v2float %157 %160
+        %162 = OpSampledImage %163 %152 %153
+        %164 = OpImageSampleExplicitLod %v4float %162 %161 Lod %float_0
+        %167 = OpVectorShuffle %v3float %164 %164 0 1 2
+               OpStore %151 %167 None
+               OpBranch %109
         %109 = OpLabel
-        %111 = OpLoad %uint %c None
+        %168 = OpLoad %uint %c None
+        %169 = OpIAdd %uint %168 %uint_1
+               OpStore %c %169 None
+               OpBranch %110
+        %111 = OpLabel
+               OpBranch %81
+         %81 = OpLabel
         %112 = OpLoad %uint %r None
-        %113 = OpCompositeConstruct %v2uint %111 %112
-        %114 = OpIAdd %v2uint %baseIndex %113
-               OpStore %loadIndex %114
-        %117 = OpAccessChain %_ptr_Uniform_uint %16 %uint_0 %uint_0
-        %118 = OpLoad %uint %117 None
-        %119 = OpINotEqual %bool %118 %uint_0
-               OpSelectionMerge %120 None
-               OpBranchConditional %119 %121 %120
-        %121 = OpLabel
-        %122 = OpLoad %v2uint %loadIndex None
-        %123 = OpVectorShuffle %v2uint %122 %122 1 0
-               OpStore %loadIndex %123 None
+        %113 = OpIAdd %uint %112 %uint_1
+               OpStore %r %113 None
+               OpBranch %82
+         %83 = OpLabel
+               OpControlBarrier %uint_2 %uint_2 %uint_264
+               OpBranch %85
+         %85 = OpLabel
+               OpStore %r_0 %uint_0
+               OpBranch %88
+         %88 = OpLabel
+               OpLoopMerge %89 %87 None
+               OpBranch %86
+         %86 = OpLabel
+        %115 = OpLoad %uint %r_0 None
+        %116 = OpULessThan %bool %115 %uint_4
+               OpSelectionMerge %117 None
+               OpBranchConditional %116 %117 %118
+        %118 = OpLabel
+               OpBranch %89
+        %117 = OpLabel
+               OpBranch %119
+        %119 = OpLabel
+               OpStore %c_0 %uint_0
+               OpBranch %122
+        %122 = OpLabel
+               OpLoopMerge %123 %121 None
                OpBranch %120
         %120 = OpLabel
-        %124 = OpLoad %uint %r None
-        %125 = OpCompositeExtract %uint %LocalInvocationID 0
-        %126 = OpIMul %uint %uint_4 %125
-        %127 = OpLoad %uint %c None
-        %128 = OpIAdd %uint %126 %127
-        %129 = OpExtInst %uint %76 UMin %124 %uint_3
-        %131 = OpExtInst %uint %76 UMin %128 %uint_255
-        %133 = OpAccessChain %_ptr_Workgroup_v3float %tile %129 %131
-        %134 = OpLoad %11 %inputTex None
-        %135 = OpLoad %3 %samp None
-        %136 = OpLoad %v2uint %loadIndex None
-        %138 = OpConvertUToF %v2float %136
-        %139 = OpFAdd %v2float %138 %140
-        %142 = OpConvertUToF %v2float %dims
-        %143 = OpFDiv %v2float %139 %142
-        %144 = OpSampledImage %145 %134 %135
-        %146 = OpImageSampleExplicitLod %v4float %144 %143 Lod %float_0
-        %149 = OpVectorShuffle %v3float %146 %146 0 1 2
-               OpStore %133 %149 None
-               OpBranch %103
-        %103 = OpLabel
-        %150 = OpLoad %uint %c None
-        %151 = OpIAdd %uint %150 %uint_1
-               OpStore %c %151 None
-               OpBranch %104
-        %105 = OpLabel
-               OpBranch %92
-         %92 = OpLabel
-        %152 = OpLoad %uint %r None
-        %153 = OpIAdd %uint %152 %uint_1
-               OpStore %r %153 None
-               OpBranch %93
-         %94 = OpLabel
-               OpControlBarrier %uint_2 %uint_2 %uint_264
-               OpBranch %155
-        %155 = OpLabel
-               OpStore %r_0 %uint_0
-               OpBranch %158
-        %158 = OpLabel
-               OpLoopMerge %159 %157 None
-               OpBranch %156
-        %156 = OpLabel
-        %161 = OpLoad %uint %r_0 None
-        %162 = OpULessThan %bool %161 %uint_4
-               OpSelectionMerge %163 None
-               OpBranchConditional %162 %163 %164
-        %164 = OpLabel
-               OpBranch %159
-        %163 = OpLabel
-               OpBranch %165
-        %165 = OpLabel
-               OpStore %c_0 %uint_0
-               OpBranch %168
-        %168 = OpLabel
-               OpLoopMerge %169 %167 None
-               OpBranch %166
-        %166 = OpLabel
         %171 = OpLoad %uint %c_0 None
         %172 = OpULessThan %bool %171 %uint_4
                OpSelectionMerge %173 None
                OpBranchConditional %172 %173 %174
         %174 = OpLabel
-               OpBranch %169
+               OpBranch %123
         %173 = OpLabel
         %175 = OpLoad %uint %c_0 None
         %176 = OpLoad %uint %r_0 None
@@ -319,125 +319,125 @@
                OpSelectionMerge %183 None
                OpBranchConditional %182 %184 %183
         %184 = OpLabel
-        %185 = OpLoad %v2uint %writeIndex None
-        %186 = OpVectorShuffle %v2uint %185 %185 1 0
-               OpStore %writeIndex %186 None
+        %207 = OpLoad %v2uint %writeIndex None
+        %208 = OpVectorShuffle %v2uint %207 %207 1 0
+               OpStore %writeIndex %208 None
                OpBranch %183
         %183 = OpLabel
-        %187 = OpCompositeExtract %uint %LocalInvocationID 0
-        %188 = OpIMul %uint %uint_4 %187
-        %189 = OpLoad %uint %c_0 None
-     %center = OpIAdd %uint %188 %189
-        %191 = OpUGreaterThanEqual %bool %center %filterOffset
-               OpSelectionMerge %192 None
-               OpBranchConditional %191 %193 %194
-        %193 = OpLabel
-        %195 = OpISub %uint %uint_256 %filterOffset
-        %196 = OpULessThan %bool %center %195
-               OpBranch %192
-        %194 = OpLabel
-               OpBranch %192
+        %185 = OpCompositeExtract %uint %LocalInvocationID 0
+        %186 = OpIMul %uint %uint_4 %185
+        %187 = OpLoad %uint %c_0 None
+     %center = OpIAdd %uint %186 %187
+        %189 = OpUGreaterThanEqual %bool %center %filterOffset
+               OpSelectionMerge %190 None
+               OpBranchConditional %189 %191 %192
+        %191 = OpLabel
+        %209 = OpISub %uint %uint_256 %filterOffset
+        %194 = OpULessThan %bool %center %209
+               OpBranch %190
         %192 = OpLabel
-        %197 = OpPhi %bool %196 %193 %false %194
-               OpSelectionMerge %199 None
-               OpBranchConditional %197 %200 %201
-        %200 = OpLabel
-        %202 = OpLoad %v2uint %writeIndex None
-        %203 = OpULessThan %v2bool %202 %dims
-        %205 = OpAll %bool %203
-               OpBranch %199
-        %201 = OpLabel
-               OpBranch %199
-        %199 = OpLabel
-        %206 = OpPhi %bool %205 %200 %false %201
-               OpSelectionMerge %207 None
-               OpBranchConditional %206 %208 %207
-        %208 = OpLabel
-               OpStore %acc %56
-               OpBranch %211
-        %211 = OpLabel
-               OpStore %tint_loop_idx %217
+               OpBranch %190
+        %190 = OpLabel
+        %193 = OpPhi %bool %194 %191 %false %192
+               OpSelectionMerge %196 None
+               OpBranchConditional %193 %197 %198
+        %197 = OpLabel
+        %210 = OpLoad %v2uint %writeIndex None
+        %211 = OpULessThan %v2bool %210 %dims
+        %200 = OpAll %bool %211
+               OpBranch %196
+        %198 = OpLabel
+               OpBranch %196
+        %196 = OpLabel
+        %199 = OpPhi %bool %200 %197 %false %198
+               OpSelectionMerge %201 None
+               OpBranchConditional %199 %202 %201
+        %202 = OpLabel
+               OpStore %acc %99
+               OpBranch %215
+        %215 = OpLabel
+               OpStore %tint_loop_idx %227
                OpStore %f %uint_0
-               OpBranch %214
-        %214 = OpLabel
-               OpLoopMerge %215 %213 None
-               OpBranch %212
-        %212 = OpLabel
-        %220 = OpLoad %v2uint %tint_loop_idx None
-        %221 = OpIEqual %v2bool %220 %222
-        %223 = OpAll %bool %221
-               OpSelectionMerge %224 None
-               OpBranchConditional %223 %225 %224
-        %225 = OpLabel
-               OpBranch %215
-        %224 = OpLabel
-        %226 = OpLoad %uint %f None
-        %227 = OpAccessChain %_ptr_Uniform_uint %4 %uint_0 %uint_0
-        %228 = OpLoad %uint %227 None
-        %229 = OpULessThan %bool %226 %228
-               OpSelectionMerge %230 None
-               OpBranchConditional %229 %230 %231
-        %231 = OpLabel
-               OpBranch %215
-        %230 = OpLabel
-        %232 = OpLoad %uint %f None
-        %233 = OpIAdd %uint %center %232
-        %234 = OpISub %uint %233 %filterOffset
-               OpStore %i %234
-        %236 = OpLoad %v3float %acc None
+               OpBranch %218
+        %218 = OpLabel
+               OpLoopMerge %219 %217 None
+               OpBranch %216
+        %216 = OpLabel
+        %230 = OpLoad %v2uint %tint_loop_idx None
+        %231 = OpIEqual %v2bool %230 %232
+        %233 = OpAll %bool %231
+               OpSelectionMerge %234 None
+               OpBranchConditional %233 %235 %234
+        %235 = OpLabel
+               OpBranch %219
+        %234 = OpLabel
+        %236 = OpLoad %uint %f None
         %237 = OpAccessChain %_ptr_Uniform_uint %4 %uint_0 %uint_0
         %238 = OpLoad %uint %237 None
-        %239 = OpConvertUToF %float %238
-        %240 = OpFDiv %float %float_1 %239
-        %242 = OpLoad %uint %r_0 None
-        %243 = OpLoad %uint %i None
-        %244 = OpExtInst %uint %76 UMin %242 %uint_3
-        %245 = OpExtInst %uint %76 UMin %243 %uint_255
-        %246 = OpAccessChain %_ptr_Workgroup_v3float %tile %244 %245
-        %247 = OpLoad %v3float %246 None
-        %248 = OpVectorTimesScalar %v3float %247 %240
-        %249 = OpFAdd %v3float %236 %248
-               OpStore %acc %249 None
-               OpBranch %213
-        %213 = OpLabel
-        %250 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-        %251 = OpLoad %uint %250 None
-%tint_low_inc = OpISub %uint %251 %uint_1
-        %253 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %253 %tint_low_inc None
-        %254 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %254 %uint_1 %uint_0
-        %256 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-        %257 = OpLoad %uint %256 None
-        %258 = OpISub %uint %257 %tint_carry
-        %259 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %259 %258 None
-        %260 = OpLoad %uint %f None
-        %261 = OpIAdd %uint %260 %uint_1
-               OpStore %f %261 None
-               OpBranch %214
-        %215 = OpLabel
-        %262 = OpLoad %15 %outputTex None
-        %263 = OpLoad %v2uint %writeIndex None
-        %264 = OpLoad %v3float %acc None
-        %265 = OpCompositeConstruct %v4float %264 %float_1
-               OpImageWrite %262 %263 %265 None
-               OpBranch %207
-        %207 = OpLabel
-               OpBranch %167
-        %167 = OpLabel
-        %267 = OpLoad %uint %c_0 None
-        %268 = OpIAdd %uint %267 %uint_1
-               OpStore %c_0 %268 None
-               OpBranch %168
-        %169 = OpLabel
-               OpBranch %157
-        %157 = OpLabel
-        %269 = OpLoad %uint %r_0 None
+        %239 = OpULessThan %bool %236 %238
+               OpSelectionMerge %240 None
+               OpBranchConditional %239 %240 %241
+        %241 = OpLabel
+               OpBranch %219
+        %240 = OpLabel
+        %242 = OpLoad %uint %f None
+        %243 = OpIAdd %uint %center %242
+        %244 = OpISub %uint %243 %filterOffset
+               OpStore %i %244
+        %246 = OpLoad %v3float %acc None
+        %247 = OpAccessChain %_ptr_Uniform_uint %4 %uint_0 %uint_0
+        %248 = OpLoad %uint %247 None
+        %249 = OpConvertUToF %float %248
+        %250 = OpFDiv %float %float_1 %249
+        %251 = OpLoad %uint %r_0 None
+        %252 = OpLoad %uint %i None
+        %253 = OpExtInst %uint %65 UMin %251 %uint_3
+        %254 = OpExtInst %uint %65 UMin %252 %uint_255
+        %255 = OpAccessChain %_ptr_Workgroup_v3float %tile %253 %254
+        %256 = OpLoad %v3float %255 None
+        %257 = OpVectorTimesScalar %v3float %256 %250
+        %258 = OpFAdd %v3float %246 %257
+               OpStore %acc %258 None
+               OpBranch %217
+        %217 = OpLabel
+        %259 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+        %260 = OpLoad %uint %259 None
+%tint_low_inc = OpISub %uint %260 %uint_1
+        %262 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %262 %tint_low_inc None
+        %263 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %263 %uint_1 %uint_0
+        %265 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+        %266 = OpLoad %uint %265 None
+        %267 = OpISub %uint %266 %tint_carry
+        %268 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %268 %267 None
+        %269 = OpLoad %uint %f None
         %270 = OpIAdd %uint %269 %uint_1
-               OpStore %r_0 %270 None
-               OpBranch %158
-        %159 = OpLabel
+               OpStore %f %270 None
+               OpBranch %218
+        %219 = OpLabel
+        %220 = OpLoad %15 %outputTex None
+        %221 = OpLoad %v2uint %writeIndex None
+        %222 = OpLoad %v3float %acc None
+        %223 = OpCompositeConstruct %v4float %222 %float_1
+               OpImageWrite %220 %221 %223 None
+               OpBranch %201
+        %201 = OpLabel
+               OpBranch %121
+        %121 = OpLabel
+        %203 = OpLoad %uint %c_0 None
+        %204 = OpIAdd %uint %203 %uint_1
+               OpStore %c_0 %204 None
+               OpBranch %122
+        %123 = OpLabel
+               OpBranch %87
+         %87 = OpLabel
+        %124 = OpLoad %uint %r_0 None
+        %125 = OpIAdd %uint %124 %uint_1
+               OpStore %r_0 %125 None
+               OpBranch %88
+         %89 = OpLabel
                OpReturn
                OpFunctionEnd
 %tint_div_u32 = OpFunction %uint None %273
diff --git a/test/tint/bug/tint/948.wgsl.expected.spvasm b/test/tint/bug/tint/948.wgsl.expected.spvasm
index 0ae9320..5951626 100644
--- a/test/tint/bug/tint/948.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/948.wgsl.expected.spvasm
@@ -80,33 +80,18 @@
                OpName %x_101 "x_101"
                OpName %x_106 "x_106"
                OpName %x_111 "x_111"
+               OpName %x_310 "x_310"
+               OpName %x_311 "x_311"
+               OpName %x_313 "x_313"
+               OpName %x_314 "x_314"
+               OpName %x_318 "x_318"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %x_122 "x_122"
                OpName %x_126 "x_126"
-               OpName %x_150 "x_150"
-               OpName %x_154 "x_154"
-               OpName %x_156 "x_156"
-               OpName %x_136 "x_136"
-               OpName %x_140 "x_140"
-               OpName %x_142 "x_142"
                OpName %x_166 "x_166"
                OpName %x_169 "x_169"
                OpName %x_172 "x_172"
                OpName %x_174 "x_174"
-               OpName %x_181 "x_181"
-               OpName %x_184 "x_184"
-               OpName %tint_loop_idx_0 "tint_loop_idx"
-               OpName %x_193 "x_193"
-               OpName %x_197 "x_197"
-               OpName %x_198 "x_198"
-               OpName %x_203 "x_203"
-               OpName %x_208 "x_208"
-               OpName %x_211 "x_211"
-               OpName %x_214 "x_214"
-               OpName %x_217 "x_217"
-               OpName %tint_low_inc_1 "tint_low_inc_1"
-               OpName %tint_carry_1 "tint_carry_1"
-               OpName %x_218 "x_218"
                OpName %x_222 "x_222"
                OpName %x_225 "x_225"
                OpName %x_228 "x_228"
@@ -116,8 +101,19 @@
                OpName %x_241 "x_241"
                OpName %x_244 "x_244"
                OpName %x_248 "x_248"
-               OpName %x_252 "x_252"
                OpName %x_254 "x_254"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
+               OpName %x_304 "x_304"
+               OpName %x_150 "x_150"
+               OpName %x_154 "x_154"
+               OpName %x_156 "x_156"
+               OpName %x_136 "x_136"
+               OpName %x_140 "x_140"
+               OpName %x_142 "x_142"
+               OpName %x_181 "x_181"
+               OpName %x_184 "x_184"
+               OpName %x_252 "x_252"
                OpName %x_263 "x_263"
                OpName %x_264 "x_264"
                OpName %x_266 "x_266"
@@ -133,14 +129,18 @@
                OpName %x_295 "x_295"
                OpName %x_298 "x_298"
                OpName %x_299 "x_299"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
-               OpName %x_304 "x_304"
-               OpName %x_310 "x_310"
-               OpName %x_311 "x_311"
-               OpName %x_313 "x_313"
-               OpName %x_314 "x_314"
-               OpName %x_318 "x_318"
+               OpName %tint_loop_idx_0 "tint_loop_idx"
+               OpName %x_193 "x_193"
+               OpName %x_197 "x_197"
+               OpName %x_198 "x_198"
+               OpName %x_208 "x_208"
+               OpName %x_211 "x_211"
+               OpName %x_214 "x_214"
+               OpName %x_217 "x_217"
+               OpName %tint_low_inc_1 "tint_low_inc_1"
+               OpName %tint_carry_1 "tint_carry_1"
+               OpName %x_218 "x_218"
+               OpName %x_203 "x_203"
                OpName %main_inner "main_inner"
                OpMemberName %main_out 0 "glFragColor_1"
                OpName %main_out "main_out"
@@ -269,22 +269,22 @@
         %152 = OpConstantComposite %v2float %float_1 %float_1
      %uint_4 = OpConstant %uint 4
       %int_0 = OpConstant %int 0
+%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
+     %uint_8 = OpConstant %uint 8
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-        %169 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-        %173 = OpConstantNull %v2uint
+        %186 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+        %190 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %int_2 = OpConstant %int 2
-        %195 = OpConstantComposite %v2float %float_0_5 %float_0_5
      %uint_2 = OpConstant %uint 2
-    %float_8 = OpConstant %float 8
 %_ptr_Function_uint = OpTypePointer Function %uint
-     %uint_3 = OpConstant %uint 3
       %int_1 = OpConstant %int 1
-%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
-     %uint_8 = OpConstant %uint 8
+        %283 = OpConstantComposite %v2float %float_0_5 %float_0_5
+     %uint_3 = OpConstant %uint 3
+    %float_8 = OpConstant %float 8
    %main_out = OpTypeStruct %v4float
         %403 = OpTypeFunction %main_out %v2float %v2float %v2float %v2float %v3float %v2float
 %getFrameData_f1_ = OpFunction %mat4v4float None %53
@@ -384,288 +384,288 @@
                OpStore %i %int_0 None
                OpBranch %161
         %161 = OpLabel
-               OpStore %tint_loop_idx %169
+               OpStore %tint_loop_idx %186
                OpBranch %164
         %164 = OpLabel
                OpLoopMerge %165 %163 None
                OpBranch %162
         %162 = OpLabel
-        %171 = OpLoad %v2uint %tint_loop_idx None
-        %172 = OpIEqual %v2bool %171 %173
-        %176 = OpAll %bool %172
-               OpSelectionMerge %177 None
-               OpBranchConditional %176 %178 %177
-        %178 = OpLabel
+        %188 = OpLoad %v2uint %tint_loop_idx None
+        %189 = OpIEqual %v2bool %188 %190
+        %193 = OpAll %bool %189
+               OpSelectionMerge %194 None
+               OpBranchConditional %193 %195 %194
+        %195 = OpLabel
                OpBranch %165
-        %177 = OpLabel
+        %194 = OpLabel
       %x_122 = OpLoad %int %i None
-        %180 = OpSLessThan %bool %x_122 %int_2
-               OpSelectionMerge %182 None
-               OpBranchConditional %180 %182 %183
-        %183 = OpLabel
+        %197 = OpSLessThan %bool %x_122 %int_2
+               OpSelectionMerge %199 None
+               OpBranchConditional %197 %199 %200
+        %200 = OpLabel
                OpBranch %165
-        %182 = OpLabel
+        %199 = OpLabel
       %x_126 = OpLoad %int %i None
-               OpSelectionMerge %188 None
-               OpSwitch %x_126 %185 1 %186 0 %187
-        %186 = OpLabel
+               OpSelectionMerge %205 None
+               OpSwitch %x_126 %202 1 %203 0 %204
+        %202 = OpLabel
+               OpBranch %205
+        %203 = OpLabel
       %x_150 = OpLoad %v2float %tileID None
-        %190 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_4
-      %x_154 = OpLoad %v2float %190 None
-        %192 = OpLoad %13 %tileMapsTexture1 None
-        %193 = OpLoad %16 %tileMapsSampler None
-        %194 = OpFAdd %v2float %x_150 %195
-        %196 = OpFDiv %v2float %194 %x_154
-        %197 = OpExtInst %float %69 NClamp %float_0 %float_n16 %float_15_9899998
-        %198 = OpSampledImage %73 %192 %193
-      %x_156 = OpImageSampleImplicitLod %v4float %198 %196 Bias %197
-        %200 = OpCompositeExtract %float %x_156 0
-               OpStore %frameID_1 %200 None
-               OpBranch %188
-        %187 = OpLabel
+        %278 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_4
+      %x_154 = OpLoad %v2float %278 None
+        %280 = OpLoad %13 %tileMapsTexture1 None
+        %281 = OpLoad %16 %tileMapsSampler None
+        %282 = OpFAdd %v2float %x_150 %283
+        %284 = OpFDiv %v2float %282 %x_154
+        %285 = OpExtInst %float %69 NClamp %float_0 %float_n16 %float_15_9899998
+        %286 = OpSampledImage %73 %280 %281
+      %x_156 = OpImageSampleImplicitLod %v4float %286 %284 Bias %285
+        %288 = OpCompositeExtract %float %x_156 0
+               OpStore %frameID_1 %288 None
+               OpBranch %205
+        %204 = OpLabel
       %x_136 = OpLoad %v2float %tileID None
-        %202 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_4
-      %x_140 = OpLoad %v2float %202 None
-        %204 = OpLoad %13 %tileMapsTexture0 None
-        %205 = OpLoad %16 %tileMapsSampler None
-        %206 = OpFAdd %v2float %x_136 %195
-        %207 = OpFDiv %v2float %206 %x_140
-        %208 = OpExtInst %float %69 NClamp %float_0 %float_n16 %float_15_9899998
-        %209 = OpSampledImage %73 %204 %205
-      %x_142 = OpImageSampleImplicitLod %v4float %209 %207 Bias %208
-        %211 = OpCompositeExtract %float %x_142 0
-               OpStore %frameID_1 %211 None
-               OpBranch %188
-        %185 = OpLabel
-               OpBranch %188
-        %188 = OpLabel
+        %290 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_4
+      %x_140 = OpLoad %v2float %290 None
+        %292 = OpLoad %13 %tileMapsTexture0 None
+        %293 = OpLoad %16 %tileMapsSampler None
+        %294 = OpFAdd %v2float %x_136 %283
+        %295 = OpFDiv %v2float %294 %x_140
+        %296 = OpExtInst %float %69 NClamp %float_0 %float_n16 %float_15_9899998
+        %297 = OpSampledImage %73 %292 %293
+      %x_142 = OpImageSampleImplicitLod %v4float %297 %295 Bias %296
+        %299 = OpCompositeExtract %float %x_142 0
+               OpStore %frameID_1 %299 None
+               OpBranch %205
+        %205 = OpLabel
       %x_166 = OpLoad %float %frameID_1 None
-        %213 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_7
-      %x_169 = OpLoad %float %213 None
-        %215 = OpLoad %13 %animationMapTexture None
-        %216 = OpLoad %16 %animationMapSampler None
-        %217 = OpFAdd %float %x_166 %float_0_5
-        %218 = OpFDiv %float %217 %x_169
-        %219 = OpCompositeConstruct %v2float %218 %float_0
-        %220 = OpExtInst %float %69 NClamp %float_0 %float_n16 %float_15_9899998
-        %221 = OpSampledImage %73 %215 %216
-      %x_172 = OpImageSampleImplicitLod %v4float %221 %219 Bias %220
+        %207 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_7
+      %x_169 = OpLoad %float %207 None
+        %209 = OpLoad %13 %animationMapTexture None
+        %210 = OpLoad %16 %animationMapSampler None
+        %211 = OpFAdd %float %x_166 %float_0_5
+        %212 = OpFDiv %float %211 %x_169
+        %213 = OpCompositeConstruct %v2float %212 %float_0
+        %214 = OpExtInst %float %69 NClamp %float_0 %float_n16 %float_15_9899998
+        %215 = OpSampledImage %73 %209 %210
+      %x_172 = OpImageSampleImplicitLod %v4float %215 %213 Bias %214
                OpStore %animationData %x_172 None
-        %223 = OpAccessChain %_ptr_Function_float %animationData %uint_1
-      %x_174 = OpLoad %float %223 None
-        %225 = OpFOrdGreaterThan %bool %x_174 %float_0
-               OpSelectionMerge %226 None
-               OpBranchConditional %225 %227 %226
-        %227 = OpLabel
-        %228 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_0
-      %x_181 = OpLoad %float %228 None
-        %230 = OpAccessChain %_ptr_Function_float %animationData %uint_2
-      %x_184 = OpLoad %float %230 None
-        %233 = OpFMul %float %x_181 %x_184
-        %234 = OpFRem %float %233 %float_1
-               OpStore %mt %234 None
+        %217 = OpAccessChain %_ptr_Function_float %animationData %uint_1
+      %x_174 = OpLoad %float %217 None
+        %219 = OpFOrdGreaterThan %bool %x_174 %float_0
+               OpSelectionMerge %220 None
+               OpBranchConditional %219 %221 %220
+        %221 = OpLabel
+        %300 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_0
+      %x_181 = OpLoad %float %300 None
+        %302 = OpAccessChain %_ptr_Function_float %animationData %uint_2
+      %x_184 = OpLoad %float %302 None
+        %304 = OpFMul %float %x_181 %x_184
+        %305 = OpFRem %float %304 %float_1
+               OpStore %mt %305 None
                OpStore %f %float_0 None
-               OpBranch %235
-        %235 = OpLabel
-               OpStore %tint_loop_idx_0 %169
-               OpBranch %238
-        %238 = OpLabel
-               OpLoopMerge %239 %237 None
-               OpBranch %236
-        %236 = OpLabel
-        %241 = OpLoad %v2uint %tint_loop_idx_0 None
-        %242 = OpIEqual %v2bool %241 %173
-        %243 = OpAll %bool %242
-               OpSelectionMerge %244 None
-               OpBranchConditional %243 %245 %244
-        %245 = OpLabel
-               OpBranch %239
-        %244 = OpLabel
+               OpBranch %306
+        %306 = OpLabel
+               OpStore %tint_loop_idx_0 %186
+               OpBranch %309
+        %309 = OpLabel
+               OpLoopMerge %310 %308 None
+               OpBranch %307
+        %307 = OpLabel
+        %361 = OpLoad %v2uint %tint_loop_idx_0 None
+        %362 = OpIEqual %v2bool %361 %190
+        %363 = OpAll %bool %362
+               OpSelectionMerge %364 None
+               OpBranchConditional %363 %365 %364
+        %365 = OpLabel
+               OpBranch %310
+        %364 = OpLabel
       %x_193 = OpLoad %float %f None
-        %247 = OpFOrdLessThan %bool %x_193 %float_8
-               OpSelectionMerge %249 None
-               OpBranchConditional %247 %249 %250
-        %250 = OpLabel
-               OpBranch %239
-        %249 = OpLabel
-        %251 = OpAccessChain %_ptr_Function_float %animationData %uint_1
-      %x_197 = OpLoad %float %251 None
+        %367 = OpFOrdLessThan %bool %x_193 %float_8
+               OpSelectionMerge %369 None
+               OpBranchConditional %367 %369 %370
+        %370 = OpLabel
+               OpBranch %310
+        %369 = OpLabel
+        %371 = OpAccessChain %_ptr_Function_float %animationData %uint_1
+      %x_197 = OpLoad %float %371 None
       %x_198 = OpLoad %float %mt None
-        %254 = OpFOrdGreaterThan %bool %x_197 %x_198
-               OpSelectionMerge %255 None
-               OpBranchConditional %254 %256 %255
-        %256 = OpLabel
-        %257 = OpAccessChain %_ptr_Function_float %animationData %uint_0
-      %x_203 = OpLoad %float %257 None
+        %374 = OpFOrdGreaterThan %bool %x_197 %x_198
+               OpSelectionMerge %375 None
+               OpBranchConditional %374 %376 %375
+        %376 = OpLabel
+        %393 = OpAccessChain %_ptr_Function_float %animationData %uint_0
+      %x_203 = OpLoad %float %393 None
                OpStore %frameID_1 %x_203 None
-               OpBranch %239
-        %255 = OpLabel
+               OpBranch %310
+        %375 = OpLabel
       %x_208 = OpLoad %float %frameID_1 None
-        %260 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_7
-      %x_211 = OpLoad %float %260 None
+        %378 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_7
+      %x_211 = OpLoad %float %378 None
       %x_214 = OpLoad %float %f None
                OpStore %animationData %x_217 None
-               OpBranch %237
-        %237 = OpLabel
-        %263 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-        %265 = OpLoad %uint %263 None
-%tint_low_inc_1 = OpISub %uint %265 %uint_1
-        %267 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %267 %tint_low_inc_1 None
-        %268 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %268 %uint_1 %uint_0
-        %270 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-        %271 = OpLoad %uint %270 None
-        %272 = OpISub %uint %271 %tint_carry_1
-        %273 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %273 %272 None
+               OpBranch %308
+        %308 = OpLabel
+        %381 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+        %382 = OpLoad %uint %381 None
+%tint_low_inc_1 = OpISub %uint %382 %uint_1
+        %384 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %384 %tint_low_inc_1 None
+        %385 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %385 %uint_1 %uint_0
+        %387 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+        %388 = OpLoad %uint %387 None
+        %389 = OpISub %uint %388 %tint_carry_1
+        %390 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %390 %389 None
       %x_218 = OpLoad %float %f None
-        %275 = OpFAdd %float %x_218 %float_1
-               OpStore %f %275 None
-               OpBranch %238
-        %239 = OpLabel
-               OpBranch %226
-        %226 = OpLabel
+        %392 = OpFAdd %float %x_218 %float_1
+               OpStore %f %392 None
+               OpBranch %309
+        %310 = OpLabel
+               OpBranch %220
+        %220 = OpLabel
       %x_222 = OpLoad %float %frameID_1 None
-        %277 = OpFAdd %float %x_222 %float_0_5
-               OpStore %param %277 None
+        %223 = OpFAdd %float %x_222 %float_0_5
+               OpStore %param %223 None
       %x_225 = OpFunctionCall %mat4v4float %getFrameData_f1_ %param
                OpStore %frameData %x_225 None
-        %279 = OpAccessChain %_ptr_Function_v4float %frameData %uint_0
-      %x_228 = OpLoad %v4float %279 None
-        %281 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_5
-      %x_231 = OpLoad %v2float %281 None
-        %283 = OpCompositeExtract %float %x_228 3
-        %284 = OpCompositeExtract %float %x_228 2
-        %285 = OpCompositeConstruct %v2float %283 %284
-        %286 = OpFDiv %v2float %285 %x_231
-               OpStore %frameSize %286 None
-        %287 = OpAccessChain %_ptr_Function_v4float %frameData %uint_0
-      %x_235 = OpLoad %v4float %287 None
+        %225 = OpAccessChain %_ptr_Function_v4float %frameData %uint_0
+      %x_228 = OpLoad %v4float %225 None
+        %227 = OpAccessChain %_ptr_Uniform_v2float %1 %uint_0 %uint_5
+      %x_231 = OpLoad %v2float %227 None
+        %229 = OpCompositeExtract %float %x_228 3
+        %230 = OpCompositeExtract %float %x_228 2
+        %231 = OpCompositeConstruct %v2float %229 %230
+        %232 = OpFDiv %v2float %231 %x_231
+               OpStore %frameSize %232 None
+        %233 = OpAccessChain %_ptr_Function_v4float %frameData %uint_0
+      %x_235 = OpLoad %v4float %233 None
       %x_237 = OpLoad %v2float %sheetUnits None
-        %290 = OpCompositeExtract %float %x_235 0
-        %291 = OpCompositeExtract %float %x_235 1
-        %292 = OpCompositeConstruct %v2float %290 %291
-        %293 = OpFMul %v2float %292 %x_237
-               OpStore %offset_1 %293 None
-        %294 = OpAccessChain %_ptr_Function_v4float %frameData %uint_2
-      %x_241 = OpLoad %v4float %294 None
-        %296 = OpAccessChain %_ptr_Function_v4float %frameData %uint_0
-      %x_244 = OpLoad %v4float %296 None
-        %298 = OpCompositeExtract %float %x_241 0
-        %299 = OpCompositeExtract %float %x_241 1
-        %300 = OpCompositeConstruct %v2float %298 %299
-        %301 = OpCompositeExtract %float %x_244 3
-        %302 = OpCompositeExtract %float %x_244 2
-        %303 = OpCompositeConstruct %v2float %301 %302
-        %304 = OpFDiv %v2float %300 %303
-               OpStore %ratio %304 None
-        %305 = OpAccessChain %_ptr_Function_v4float %frameData %uint_2
-        %306 = OpAccessChain %_ptr_Function_float %305 %uint_2
-      %x_248 = OpLoad %float %306 None
-        %308 = OpFOrdEqual %bool %x_248 %float_1
-               OpSelectionMerge %309 None
-               OpBranchConditional %308 %310 %309
-        %310 = OpLabel
+        %236 = OpCompositeExtract %float %x_235 0
+        %237 = OpCompositeExtract %float %x_235 1
+        %238 = OpCompositeConstruct %v2float %236 %237
+        %239 = OpFMul %v2float %238 %x_237
+               OpStore %offset_1 %239 None
+        %240 = OpAccessChain %_ptr_Function_v4float %frameData %uint_2
+      %x_241 = OpLoad %v4float %240 None
+        %243 = OpAccessChain %_ptr_Function_v4float %frameData %uint_0
+      %x_244 = OpLoad %v4float %243 None
+        %245 = OpCompositeExtract %float %x_241 0
+        %246 = OpCompositeExtract %float %x_241 1
+        %247 = OpCompositeConstruct %v2float %245 %246
+        %248 = OpCompositeExtract %float %x_244 3
+        %249 = OpCompositeExtract %float %x_244 2
+        %250 = OpCompositeConstruct %v2float %248 %249
+        %251 = OpFDiv %v2float %247 %250
+               OpStore %ratio %251 None
+        %252 = OpAccessChain %_ptr_Function_v4float %frameData %uint_2
+        %253 = OpAccessChain %_ptr_Function_float %252 %uint_2
+      %x_248 = OpLoad %float %253 None
+        %255 = OpFOrdEqual %bool %x_248 %float_1
+               OpSelectionMerge %256 None
+               OpBranchConditional %255 %257 %256
+        %257 = OpLabel
       %x_252 = OpLoad %v2float %tileUV None
         %312 = OpCompositeExtract %float %x_252 1
         %313 = OpCompositeExtract %float %x_252 0
         %314 = OpCompositeConstruct %v2float %312 %313
                OpStore %tileUV %314 None
-               OpBranch %309
-        %309 = OpLabel
+               OpBranch %256
+        %256 = OpLabel
       %x_254 = OpLoad %int %i None
-        %316 = OpIEqual %bool %x_254 %int_0
-               OpSelectionMerge %317 None
-               OpBranchConditional %316 %318 %319
-        %318 = OpLabel
+        %259 = OpIEqual %bool %x_254 %int_0
+               OpSelectionMerge %260 None
+               OpBranchConditional %259 %261 %262
+        %261 = OpLabel
       %x_263 = OpLoad %v2float %tileUV None
       %x_264 = OpLoad %v2float %frameSize None
       %x_266 = OpLoad %v2float %offset_1 None
-        %323 = OpLoad %13 %spriteSheetTexture None
-        %324 = OpLoad %16 %spriteSheetSampler None
-        %325 = OpFMul %v2float %x_263 %x_264
-        %326 = OpFAdd %v2float %325 %x_266
-        %327 = OpSampledImage %73 %323 %324
-      %x_268 = OpImageSampleImplicitLod %v4float %327 %326 None
+        %318 = OpLoad %13 %spriteSheetTexture None
+        %319 = OpLoad %16 %spriteSheetSampler None
+        %320 = OpFMul %v2float %x_263 %x_264
+        %321 = OpFAdd %v2float %320 %x_266
+        %322 = OpSampledImage %73 %318 %319
+      %x_268 = OpImageSampleImplicitLod %v4float %322 %321 None
                OpStore %color %x_268 None
-               OpBranch %317
-        %319 = OpLabel
+               OpBranch %260
+        %262 = OpLabel
       %x_274 = OpLoad %v2float %tileUV None
       %x_275 = OpLoad %v2float %frameSize None
       %x_277 = OpLoad %v2float %offset_1 None
-        %332 = OpLoad %13 %spriteSheetTexture None
-        %333 = OpLoad %16 %spriteSheetSampler None
-        %334 = OpFMul %v2float %x_274 %x_275
-        %335 = OpFAdd %v2float %334 %x_277
-        %336 = OpSampledImage %73 %332 %333
-      %x_279 = OpImageSampleImplicitLod %v4float %336 %335 None
+        %327 = OpLoad %13 %spriteSheetTexture None
+        %328 = OpLoad %16 %spriteSheetSampler None
+        %329 = OpFMul %v2float %x_274 %x_275
+        %330 = OpFAdd %v2float %329 %x_277
+        %331 = OpSampledImage %73 %327 %328
+      %x_279 = OpImageSampleImplicitLod %v4float %331 %330 None
                OpStore %nc %x_279 None
-        %338 = OpAccessChain %_ptr_Function_float %color %uint_3
-      %x_283 = OpLoad %float %338 None
-        %341 = OpAccessChain %_ptr_Function_float %nc %uint_3
-      %x_285 = OpLoad %float %341 None
-        %343 = OpFAdd %float %x_283 %x_285
-        %344 = OpExtInst %float %69 FMin %343 %float_1
-               OpStore %alpha %344 None
+        %333 = OpAccessChain %_ptr_Function_float %color %uint_3
+      %x_283 = OpLoad %float %333 None
+        %336 = OpAccessChain %_ptr_Function_float %nc %uint_3
+      %x_285 = OpLoad %float %336 None
+        %338 = OpFAdd %float %x_283 %x_285
+        %339 = OpExtInst %float %69 FMin %338 %float_1
+               OpStore %alpha %339 None
       %x_290 = OpLoad %v4float %color None
       %x_292 = OpLoad %v4float %nc None
-        %347 = OpAccessChain %_ptr_Function_float %nc %uint_3
-      %x_295 = OpLoad %float %347 None
-        %349 = OpCompositeExtract %float %x_290 0
-        %350 = OpCompositeExtract %float %x_290 1
-        %351 = OpCompositeExtract %float %x_290 2
-        %352 = OpCompositeConstruct %v3float %349 %350 %351
-        %353 = OpCompositeExtract %float %x_292 0
-        %354 = OpCompositeExtract %float %x_292 1
-        %355 = OpCompositeExtract %float %x_292 2
-        %356 = OpCompositeConstruct %v3float %353 %354 %355
-        %357 = OpCompositeConstruct %v3float %x_295 %x_295 %x_295
-        %358 = OpExtInst %v3float %69 FMix %352 %356 %357
-               OpStore %mixed %358 None
+        %342 = OpAccessChain %_ptr_Function_float %nc %uint_3
+      %x_295 = OpLoad %float %342 None
+        %344 = OpCompositeExtract %float %x_290 0
+        %345 = OpCompositeExtract %float %x_290 1
+        %346 = OpCompositeExtract %float %x_290 2
+        %347 = OpCompositeConstruct %v3float %344 %345 %346
+        %348 = OpCompositeExtract %float %x_292 0
+        %349 = OpCompositeExtract %float %x_292 1
+        %350 = OpCompositeExtract %float %x_292 2
+        %351 = OpCompositeConstruct %v3float %348 %349 %350
+        %352 = OpCompositeConstruct %v3float %x_295 %x_295 %x_295
+        %353 = OpExtInst %v3float %69 FMix %347 %351 %352
+               OpStore %mixed %353 None
       %x_298 = OpLoad %v3float %mixed None
       %x_299 = OpLoad %float %alpha None
-        %361 = OpCompositeExtract %float %x_298 0
-        %362 = OpCompositeExtract %float %x_298 1
-        %363 = OpCompositeExtract %float %x_298 2
-        %364 = OpCompositeConstruct %v4float %361 %362 %363 %x_299
-               OpStore %color %364 None
-               OpBranch %317
-        %317 = OpLabel
+        %356 = OpCompositeExtract %float %x_298 0
+        %357 = OpCompositeExtract %float %x_298 1
+        %358 = OpCompositeExtract %float %x_298 2
+        %359 = OpCompositeConstruct %v4float %356 %357 %358 %x_299
+               OpStore %color %359 None
+               OpBranch %260
+        %260 = OpLabel
                OpBranch %163
         %163 = OpLabel
-        %365 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-        %366 = OpLoad %uint %365 None
-%tint_low_inc = OpISub %uint %366 %uint_1
-        %368 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %368 %tint_low_inc None
-        %369 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %369 %uint_1 %uint_0
-        %371 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-        %372 = OpLoad %uint %371 None
-        %373 = OpISub %uint %372 %tint_carry
-        %374 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %374 %373 None
+        %263 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+        %265 = OpLoad %uint %263 None
+%tint_low_inc = OpISub %uint %265 %uint_1
+        %267 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %267 %tint_low_inc None
+        %268 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %268 %uint_1 %uint_0
+        %270 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+        %271 = OpLoad %uint %270 None
+        %272 = OpISub %uint %271 %tint_carry
+        %273 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %273 %272 None
       %x_304 = OpLoad %int %i None
-        %376 = OpIAdd %int %x_304 %int_1
-               OpStore %i %376 None
+        %275 = OpIAdd %int %x_304 %int_1
+               OpStore %i %275 None
                OpBranch %164
         %165 = OpLabel
-        %378 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_8
-      %x_310 = OpLoad %v3float %378 None
+        %166 = OpAccessChain %_ptr_Uniform_v3float %1 %uint_0 %uint_8
+      %x_310 = OpLoad %v3float %166 None
       %x_311 = OpLoad %v4float %color None
-        %383 = OpCompositeExtract %float %x_311 0
-        %384 = OpCompositeExtract %float %x_311 1
-        %385 = OpCompositeExtract %float %x_311 2
-        %386 = OpCompositeConstruct %v3float %383 %384 %385
-      %x_313 = OpFMul %v3float %386 %x_310
+        %171 = OpCompositeExtract %float %x_311 0
+        %172 = OpCompositeExtract %float %x_311 1
+        %173 = OpCompositeExtract %float %x_311 2
+        %174 = OpCompositeConstruct %v3float %171 %172 %173
+      %x_313 = OpFMul %v3float %174 %x_310
       %x_314 = OpLoad %v4float %color None
-        %389 = OpCompositeExtract %float %x_313 0
-        %390 = OpCompositeExtract %float %x_313 1
-        %391 = OpCompositeExtract %float %x_313 2
-        %392 = OpCompositeExtract %float %x_314 3
-        %393 = OpCompositeConstruct %v4float %389 %390 %391 %392
-               OpStore %color %393 None
+        %177 = OpCompositeExtract %float %x_313 0
+        %178 = OpCompositeExtract %float %x_313 1
+        %179 = OpCompositeExtract %float %x_313 2
+        %180 = OpCompositeExtract %float %x_314 3
+        %181 = OpCompositeConstruct %v4float %177 %178 %179 %180
+               OpStore %color %181 None
       %x_318 = OpLoad %v4float %color None
                OpStore %glFragColor %x_318 None
                OpReturn
diff --git a/test/tint/bug/tint/949.wgsl.expected.spvasm b/test/tint/bug/tint/949.wgsl.expected.spvasm
index 704bffc..877a9bd 100644
--- a/test/tint/bug/tint/949.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/949.wgsl.expected.spvasm
@@ -223,8 +223,6 @@
                OpName %x_282 "x_282"
                OpName %x_292 "x_292"
                OpName %x_298 "x_298"
-               OpName %x_303 "x_303"
-               OpName %x_305 "x_305"
                OpName %x_307 "x_307"
                OpName %x_310 "x_310"
                OpName %x_312 "x_312"
@@ -251,35 +249,6 @@
                OpName %x_365 "x_365"
                OpName %x_366 "x_366"
                OpName %x_374 "x_374"
-               OpName %tint_loop_idx "tint_loop_idx"
-               OpName %x_388 "x_388"
-               OpName %x_394 "x_394"
-               OpName %x_395 "x_395"
-               OpName %x_397 "x_397"
-               OpName %x_400 "x_400"
-               OpName %x_401 "x_401"
-               OpName %x_406 "x_406"
-               OpName %x_407 "x_407"
-               OpName %x_410 "x_410"
-               OpName %x_411 "x_411"
-               OpName %x_413 "x_413"
-               OpName %x_416 "x_416"
-               OpName %x_417 "x_417"
-               OpName %x_418 "x_418"
-               OpName %x_421 "x_421"
-               OpName %x_422 "x_422"
-               OpName %x_424 "x_424"
-               OpName %x_426 "x_426"
-               OpName %x_431 "x_431"
-               OpName %x_432 "x_432"
-               OpName %x_434 "x_434"
-               OpName %x_435 "x_435"
-               OpName %x_436 "x_436"
-               OpName %x_438 "x_438"
-               OpName %x_440 "x_440"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
-               OpName %x_441 "x_441"
                OpName %x_444 "x_444"
                OpName %x_445 "x_445"
                OpName %x_449 "x_449"
@@ -319,6 +288,37 @@
                OpName %x_543 "x_543"
                OpName %x_544 "x_544"
                OpName %x_548 "x_548"
+               OpName %x_303 "x_303"
+               OpName %x_305 "x_305"
+               OpName %tint_loop_idx "tint_loop_idx"
+               OpName %x_388 "x_388"
+               OpName %x_394 "x_394"
+               OpName %x_395 "x_395"
+               OpName %x_397 "x_397"
+               OpName %x_400 "x_400"
+               OpName %x_401 "x_401"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
+               OpName %x_441 "x_441"
+               OpName %x_406 "x_406"
+               OpName %x_407 "x_407"
+               OpName %x_410 "x_410"
+               OpName %x_411 "x_411"
+               OpName %x_413 "x_413"
+               OpName %x_416 "x_416"
+               OpName %x_417 "x_417"
+               OpName %x_418 "x_418"
+               OpName %x_421 "x_421"
+               OpName %x_422 "x_422"
+               OpName %x_424 "x_424"
+               OpName %x_426 "x_426"
+               OpName %x_431 "x_431"
+               OpName %x_432 "x_432"
+               OpName %x_434 "x_434"
+               OpName %x_435 "x_435"
+               OpName %x_436 "x_436"
+               OpName %x_438 "x_438"
+               OpName %x_440 "x_440"
                OpName %main_inner "main_inner"
                OpMemberName %main_out 0 "glFragColor_1"
                OpName %main_out "main_out"
@@ -463,17 +463,17 @@
   %float_n11 = OpConstant %float -11
    %float_15 = OpConstant %float 15
       %int_0 = OpConstant %int 0
+%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
+     %uint_3 = OpConstant %uint 3
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-        %455 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-        %459 = OpConstantNull %v2uint
+        %556 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+        %560 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
      %int_15 = OpConstant %int 15
 %_ptr_Function_uint = OpTypePointer Function %uint
       %int_1 = OpConstant %int 1
-%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
-     %uint_3 = OpConstant %uint 3
    %main_out = OpTypeStruct %v4float
         %631 = OpTypeFunction %main_out %v2float %v4float %bool %v2float %v4float
 %cotangent_frame_vf3_vf3_vf2_vf2_ = OpFunction %mat3v3float None %60
@@ -811,30 +811,30 @@
                OpBranch %371
         %373 = OpLabel
       %x_305 = OpLoad %v2float %v_uv None
-        %376 = OpFNegate %v2float %x_305
-               OpStore %x_299 %376 None
+        %552 = OpFNegate %v2float %x_305
+               OpStore %x_299 %552 None
                OpBranch %371
         %371 = OpLabel
       %x_307 = OpLoad %v2float %x_299 None
                OpStore %TBNUV %x_307 None
       %x_310 = OpLoad %v4float %v_output2 None
       %x_312 = OpLoad %float %normalScale None
-        %380 = OpCompositeExtract %float %x_310 0
-        %381 = OpCompositeExtract %float %x_310 1
-        %382 = OpCompositeExtract %float %x_310 2
-        %383 = OpCompositeConstruct %v3float %380 %381 %382
-        %384 = OpVectorTimesScalar %v3float %383 %x_312
-               OpStore %param_3 %384 None
+        %377 = OpCompositeExtract %float %x_310 0
+        %378 = OpCompositeExtract %float %x_310 1
+        %379 = OpCompositeExtract %float %x_310 2
+        %380 = OpCompositeConstruct %v3float %377 %378 %379
+        %381 = OpVectorTimesScalar %v3float %380 %x_312
+               OpStore %param_3 %381 None
       %x_317 = OpLoad %v4float %v_output1 None
-        %386 = OpCompositeExtract %float %x_317 0
-        %387 = OpCompositeExtract %float %x_317 1
-        %388 = OpCompositeExtract %float %x_317 2
-        %389 = OpCompositeConstruct %v3float %386 %387 %388
-               OpStore %param_4 %389 None
+        %383 = OpCompositeExtract %float %x_317 0
+        %384 = OpCompositeExtract %float %x_317 1
+        %385 = OpCompositeExtract %float %x_317 2
+        %386 = OpCompositeConstruct %v3float %383 %384 %385
+               OpStore %param_4 %386 None
       %x_320 = OpLoad %v2float %TBNUV None
                OpStore %param_5 %x_320 None
-        %391 = OpAccessChain %_ptr_Uniform_v2float %19 %uint_0 %uint_8
-      %x_324 = OpLoad %v2float %391 None
+        %388 = OpAccessChain %_ptr_Uniform_v2float %19 %uint_0 %uint_8
+      %x_324 = OpLoad %v2float %388 None
                OpStore %param_6 %x_324 None
       %x_325 = OpFunctionCall %mat3v3float %cotangent_frame_vf3_vf3_vf2_vf2_ %param_3 %param_4 %param_5 %param_6
                OpStore %TBN %x_325 None
@@ -844,285 +844,285 @@
                OpStore %invTBN %x_329 None
       %x_331 = OpLoad %mat3v3float %invTBN None
       %x_332 = OpLoad %v3float %output5 None
-        %400 = OpFNegate %v3float %x_332
-      %x_334 = OpMatrixTimesVector %v3float %x_331 %400
+        %397 = OpFNegate %v3float %x_332
+      %x_334 = OpMatrixTimesVector %v3float %x_331 %397
       %x_337 = OpLoad %mat3v3float %invTBN None
       %x_338 = OpLoad %v3float %output5 None
-        %404 = OpCompositeExtract %float %x_334 0
-        %405 = OpCompositeExtract %float %x_334 1
-        %406 = OpCompositeConstruct %v2float %404 %405
-        %407 = OpExtInst %float %83 Length %406
-        %408 = OpFNegate %v3float %x_338
-        %409 = OpMatrixTimesVector %v3float %x_337 %408
-        %410 = OpCompositeExtract %float %409 2
-        %411 = OpFDiv %float %407 %410
-               OpStore %parallaxLimit %411 None
-        %412 = OpAccessChain %_ptr_Uniform_float %19 %uint_0 %uint_5
-      %x_345 = OpLoad %float %412 None
+        %401 = OpCompositeExtract %float %x_334 0
+        %402 = OpCompositeExtract %float %x_334 1
+        %403 = OpCompositeConstruct %v2float %401 %402
+        %404 = OpExtInst %float %83 Length %403
+        %405 = OpFNegate %v3float %x_338
+        %406 = OpMatrixTimesVector %v3float %x_337 %405
+        %407 = OpCompositeExtract %float %406 2
+        %408 = OpFDiv %float %404 %407
+               OpStore %parallaxLimit %408 None
+        %409 = OpAccessChain %_ptr_Uniform_float %19 %uint_0 %uint_5
+      %x_345 = OpLoad %float %409 None
       %x_346 = OpLoad %float %parallaxLimit None
-        %416 = OpFMul %float %x_346 %x_345
-               OpStore %parallaxLimit %416 None
+        %413 = OpFMul %float %x_346 %x_345
+               OpStore %parallaxLimit %413 None
       %x_349 = OpLoad %mat3v3float %invTBN None
       %x_350 = OpLoad %v3float %output5 None
-        %419 = OpFNegate %v3float %x_350
-      %x_352 = OpMatrixTimesVector %v3float %x_349 %419
-        %421 = OpCompositeExtract %float %x_352 0
-        %422 = OpCompositeExtract %float %x_352 1
-        %423 = OpCompositeConstruct %v2float %421 %422
-        %424 = OpExtInst %v2float %83 Normalize %423
-               OpStore %vOffsetDir %424 None
+        %416 = OpFNegate %v3float %x_350
+      %x_352 = OpMatrixTimesVector %v3float %x_349 %416
+        %418 = OpCompositeExtract %float %x_352 0
+        %419 = OpCompositeExtract %float %x_352 1
+        %420 = OpCompositeConstruct %v2float %418 %419
+        %421 = OpExtInst %v2float %83 Normalize %420
+               OpStore %vOffsetDir %421 None
       %x_356 = OpLoad %v2float %vOffsetDir None
       %x_357 = OpLoad %float %parallaxLimit None
-        %427 = OpVectorTimesScalar %v2float %x_356 %x_357
-               OpStore %vMaxOffset %427 None
+        %424 = OpVectorTimesScalar %v2float %x_356 %x_357
+               OpStore %vMaxOffset %424 None
       %x_361 = OpLoad %mat3v3float %invTBN None
       %x_362 = OpLoad %v3float %output5 None
       %x_365 = OpLoad %mat3v3float %invTBN None
       %x_366 = OpLoad %v4float %v_output2 None
-        %432 = OpFNegate %v3float %x_362
-        %433 = OpMatrixTimesVector %v3float %x_361 %432
-        %434 = OpCompositeExtract %float %x_366 0
-        %435 = OpCompositeExtract %float %x_366 1
-        %436 = OpCompositeExtract %float %x_366 2
-        %437 = OpCompositeConstruct %v3float %434 %435 %436
-        %438 = OpMatrixTimesVector %v3float %x_365 %437
-        %439 = OpDot %float %433 %438
-        %440 = OpFMul %float %439 %float_n11
-        %442 = OpFAdd %float %float_15 %440
-               OpStore %numSamples %442 None
+        %429 = OpFNegate %v3float %x_362
+        %430 = OpMatrixTimesVector %v3float %x_361 %429
+        %431 = OpCompositeExtract %float %x_366 0
+        %432 = OpCompositeExtract %float %x_366 1
+        %433 = OpCompositeExtract %float %x_366 2
+        %434 = OpCompositeConstruct %v3float %431 %432 %433
+        %435 = OpMatrixTimesVector %v3float %x_365 %434
+        %436 = OpDot %float %430 %435
+        %437 = OpFMul %float %436 %float_n11
+        %439 = OpFAdd %float %float_15 %437
+               OpStore %numSamples %439 None
       %x_374 = OpLoad %float %numSamples None
-        %445 = OpFDiv %float %float_1 %x_374
-               OpStore %stepSize %445 None
+        %442 = OpFDiv %float %float_1 %x_374
+               OpStore %stepSize %442 None
                OpStore %currRayHeight %float_1 None
                OpStore %vCurrOffset %18 None
                OpStore %vLastOffset %18 None
                OpStore %lastSampledHeight %float_1 None
                OpStore %currSampledHeight %float_1 None
                OpStore %i %int_0 None
+               OpBranch %444
+        %444 = OpLabel
+               OpStore %tint_loop_idx %556
                OpBranch %447
         %447 = OpLabel
-               OpStore %tint_loop_idx %455
-               OpBranch %450
-        %450 = OpLabel
-               OpLoopMerge %451 %449 None
+               OpLoopMerge %448 %446 None
+               OpBranch %445
+        %445 = OpLabel
+        %558 = OpLoad %v2uint %tint_loop_idx None
+        %559 = OpIEqual %v2bool %558 %560
+        %562 = OpAll %bool %559
+               OpSelectionMerge %563 None
+               OpBranchConditional %562 %564 %563
+        %564 = OpLabel
                OpBranch %448
-        %448 = OpLabel
-        %457 = OpLoad %v2uint %tint_loop_idx None
-        %458 = OpIEqual %v2bool %457 %459
-        %461 = OpAll %bool %458
-               OpSelectionMerge %462 None
-               OpBranchConditional %461 %463 %462
-        %463 = OpLabel
-               OpBranch %451
-        %462 = OpLabel
+        %563 = OpLabel
       %x_388 = OpLoad %int %i None
-        %465 = OpSLessThan %bool %x_388 %int_15
-               OpSelectionMerge %467 None
-               OpBranchConditional %465 %467 %468
-        %468 = OpLabel
-               OpBranch %451
-        %467 = OpLabel
+        %566 = OpSLessThan %bool %x_388 %int_15
+               OpSelectionMerge %568 None
+               OpBranchConditional %566 %568 %569
+        %569 = OpLabel
+               OpBranch %448
+        %568 = OpLabel
       %x_394 = OpLoad %v2float %v_uv None
       %x_395 = OpLoad %v2float %vCurrOffset None
-        %471 = OpCompositeExtract %float %x_397 3
-               OpStore %currSampledHeight %471 None
+        %572 = OpCompositeExtract %float %x_397 3
+               OpStore %currSampledHeight %572 None
       %x_400 = OpLoad %float %currSampledHeight None
       %x_401 = OpLoad %float %currRayHeight None
-        %474 = OpFOrdGreaterThan %bool %x_400 %x_401
-               OpSelectionMerge %475 None
-               OpBranchConditional %474 %476 %477
-        %476 = OpLabel
+        %575 = OpFOrdGreaterThan %bool %x_400 %x_401
+               OpSelectionMerge %576 None
+               OpBranchConditional %575 %577 %578
+        %577 = OpLabel
       %x_406 = OpLoad %float %currSampledHeight None
       %x_407 = OpLoad %float %currRayHeight None
-        %480 = OpFSub %float %x_406 %x_407
-               OpStore %delta1 %480 None
+        %595 = OpFSub %float %x_406 %x_407
+               OpStore %delta1 %595 None
       %x_410 = OpLoad %float %currRayHeight None
       %x_411 = OpLoad %float %stepSize None
       %x_413 = OpLoad %float %lastSampledHeight None
-        %484 = OpFAdd %float %x_410 %x_411
-        %485 = OpFSub %float %484 %x_413
-               OpStore %delta2 %485 None
+        %599 = OpFAdd %float %x_410 %x_411
+        %600 = OpFSub %float %599 %x_413
+               OpStore %delta2 %600 None
       %x_416 = OpLoad %float %delta1 None
       %x_417 = OpLoad %float %delta1 None
       %x_418 = OpLoad %float %delta2 None
-        %489 = OpFAdd %float %x_417 %x_418
-        %490 = OpFDiv %float %x_416 %489
-               OpStore %ratio %490 None
+        %604 = OpFAdd %float %x_417 %x_418
+        %605 = OpFDiv %float %x_416 %604
+               OpStore %ratio %605 None
       %x_421 = OpLoad %float %ratio None
       %x_422 = OpLoad %v2float %vLastOffset None
       %x_424 = OpLoad %float %ratio None
       %x_426 = OpLoad %v2float %vCurrOffset None
-        %495 = OpVectorTimesScalar %v2float %x_422 %x_421
-        %496 = OpFSub %float %float_1 %x_424
-        %497 = OpVectorTimesScalar %v2float %x_426 %496
-        %498 = OpFAdd %v2float %495 %497
-               OpStore %vCurrOffset %498 None
-               OpBranch %451
-        %477 = OpLabel
+        %610 = OpVectorTimesScalar %v2float %x_422 %x_421
+        %611 = OpFSub %float %float_1 %x_424
+        %612 = OpVectorTimesScalar %v2float %x_426 %611
+        %613 = OpFAdd %v2float %610 %612
+               OpStore %vCurrOffset %613 None
+               OpBranch %448
+        %578 = OpLabel
       %x_431 = OpLoad %float %stepSize None
       %x_432 = OpLoad %float %currRayHeight None
-        %501 = OpFSub %float %x_432 %x_431
-               OpStore %currRayHeight %501 None
+        %616 = OpFSub %float %x_432 %x_431
+               OpStore %currRayHeight %616 None
       %x_434 = OpLoad %v2float %vCurrOffset None
                OpStore %vLastOffset %x_434 None
       %x_435 = OpLoad %float %stepSize None
       %x_436 = OpLoad %v2float %vMaxOffset None
       %x_438 = OpLoad %v2float %vCurrOffset None
-        %506 = OpVectorTimesScalar %v2float %x_436 %x_435
-        %507 = OpFAdd %v2float %x_438 %506
-               OpStore %vCurrOffset %507 None
+        %621 = OpVectorTimesScalar %v2float %x_436 %x_435
+        %622 = OpFAdd %v2float %x_438 %621
+               OpStore %vCurrOffset %622 None
       %x_440 = OpLoad %float %currSampledHeight None
                OpStore %lastSampledHeight %x_440 None
-               OpBranch %475
-        %475 = OpLabel
-               OpBranch %449
-        %449 = OpLabel
-        %509 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-        %511 = OpLoad %uint %509 None
-%tint_low_inc = OpISub %uint %511 %uint_1
-        %513 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %513 %tint_low_inc None
-        %514 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %514 %uint_1 %uint_0
-        %516 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-        %517 = OpLoad %uint %516 None
-        %518 = OpISub %uint %517 %tint_carry
-        %519 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %519 %518 None
+               OpBranch %576
+        %576 = OpLabel
+               OpBranch %446
+        %446 = OpLabel
+        %579 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+        %581 = OpLoad %uint %579 None
+%tint_low_inc = OpISub %uint %581 %uint_1
+        %583 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %583 %tint_low_inc None
+        %584 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %584 %uint_1 %uint_0
+        %586 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+        %587 = OpLoad %uint %586 None
+        %588 = OpISub %uint %587 %tint_carry
+        %589 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %589 %588 None
       %x_441 = OpLoad %int %i None
-        %521 = OpIAdd %int %x_441 %int_1
-               OpStore %i %521 None
-               OpBranch %450
-        %451 = OpLabel
+        %591 = OpIAdd %int %x_441 %int_1
+               OpStore %i %591 None
+               OpBranch %447
+        %448 = OpLabel
       %x_444 = OpLoad %v2float %vCurrOffset None
                OpStore %parallaxOcclusion_0 %x_444 None
       %x_445 = OpLoad %v2float %parallaxOcclusion_0 None
                OpStore %uvOffset %x_445 None
       %x_449 = OpLoad %v2float %v_uv None
       %x_450 = OpLoad %v2float %uvOffset None
-        %527 = OpLoad %11 %TextureSamplerTexture None
-        %528 = OpLoad %14 %TextureSamplerSampler None
-        %529 = OpFAdd %v2float %x_449 %x_450
-        %530 = OpSampledImage %344 %527 %528
-      %x_452 = OpImageSampleImplicitLod %v4float %530 %529 None
-        %532 = OpAccessChain %_ptr_Uniform_float %19 %uint_0 %uint_2
-      %x_454 = OpLoad %float %532 None
+        %453 = OpLoad %11 %TextureSamplerTexture None
+        %454 = OpLoad %14 %TextureSamplerSampler None
+        %455 = OpFAdd %v2float %x_449 %x_450
+        %456 = OpSampledImage %344 %453 %454
+      %x_452 = OpImageSampleImplicitLod %v4float %456 %455 None
+        %458 = OpAccessChain %_ptr_Uniform_float %19 %uint_0 %uint_2
+      %x_454 = OpLoad %float %458 None
       %x_457 = OpLoad %mat3v3float %TBN None
                OpStore %param_8 %x_457 None
-        %535 = OpCompositeExtract %float %x_452 0
-        %536 = OpCompositeExtract %float %x_452 1
-        %537 = OpCompositeExtract %float %x_452 2
-        %538 = OpCompositeConstruct %v3float %535 %536 %537
-               OpStore %param_9 %538 None
-        %539 = OpFDiv %float %float_1 %x_454
-               OpStore %param_10 %539 None
+        %461 = OpCompositeExtract %float %x_452 0
+        %462 = OpCompositeExtract %float %x_452 1
+        %463 = OpCompositeExtract %float %x_452 2
+        %464 = OpCompositeConstruct %v3float %461 %462 %463
+               OpStore %param_9 %464 None
+        %465 = OpFDiv %float %float_1 %x_454
+               OpStore %param_10 %465 None
       %x_461 = OpFunctionCall %v3float %perturbNormal_mf33_vf3_f1_ %param_8 %param_9 %param_10
       %x_462 = OpLoad %v4float %output4 None
-        %542 = OpCompositeExtract %float %x_461 0
-        %543 = OpCompositeExtract %float %x_461 1
-        %544 = OpCompositeExtract %float %x_461 2
-        %545 = OpCompositeExtract %float %x_462 3
-        %546 = OpCompositeConstruct %v4float %542 %543 %544 %545
-               OpStore %output4 %546 None
+        %468 = OpCompositeExtract %float %x_461 0
+        %469 = OpCompositeExtract %float %x_461 1
+        %470 = OpCompositeExtract %float %x_461 2
+        %471 = OpCompositeExtract %float %x_462 3
+        %472 = OpCompositeConstruct %v4float %468 %469 %470 %471
+               OpStore %output4 %472 None
       %x_465 = OpLoad %v2float %v_uv None
       %x_466 = OpLoad %v2float %uvOffset None
-        %549 = OpFAdd %v2float %x_465 %x_466
-               OpStore %output6 %549 None
+        %475 = OpFAdd %v2float %x_465 %x_466
+               OpStore %output6 %475 None
       %x_474 = OpLoad %v2float %output6 None
-        %551 = OpLoad %11 %TextureSampler1Texture None
-        %552 = OpLoad %14 %TextureSampler1Sampler None
-        %553 = OpSampledImage %344 %551 %552
-      %x_475 = OpImageSampleImplicitLod %v4float %553 %x_474 None
+        %477 = OpLoad %11 %TextureSampler1Texture None
+        %478 = OpLoad %14 %TextureSampler1Sampler None
+        %479 = OpSampledImage %344 %477 %478
+      %x_475 = OpImageSampleImplicitLod %v4float %479 %x_474 None
                OpStore %tempTextureRead1 %x_475 None
       %x_477 = OpLoad %v4float %tempTextureRead1 None
-        %556 = OpCompositeExtract %float %x_477 0
-        %557 = OpCompositeExtract %float %x_477 1
-        %558 = OpCompositeExtract %float %x_477 2
-        %559 = OpCompositeConstruct %v3float %556 %557 %558
-               OpStore %rgb1 %559 None
-        %560 = OpAccessChain %_ptr_Uniform_v3float %19 %uint_0 %uint_4
-      %x_481 = OpLoad %v3float %560 None
+        %482 = OpCompositeExtract %float %x_477 0
+        %483 = OpCompositeExtract %float %x_477 1
+        %484 = OpCompositeExtract %float %x_477 2
+        %485 = OpCompositeConstruct %v3float %482 %483 %484
+               OpStore %rgb1 %485 None
+        %486 = OpAccessChain %_ptr_Uniform_v3float %19 %uint_0 %uint_4
+      %x_481 = OpLoad %v3float %486 None
       %x_482 = OpLoad %v4float %v_output1 None
-        %563 = OpCompositeExtract %float %x_482 0
-        %564 = OpCompositeExtract %float %x_482 1
-        %565 = OpCompositeExtract %float %x_482 2
-        %566 = OpCompositeConstruct %v3float %563 %564 %565
-        %567 = OpFSub %v3float %x_481 %566
-        %568 = OpExtInst %v3float %83 Normalize %567
-               OpStore %viewDirectionW_1 %568 None
+        %489 = OpCompositeExtract %float %x_482 0
+        %490 = OpCompositeExtract %float %x_482 1
+        %491 = OpCompositeExtract %float %x_482 2
+        %492 = OpCompositeConstruct %v3float %489 %490 %491
+        %493 = OpFSub %v3float %x_481 %492
+        %494 = OpExtInst %v3float %83 Normalize %493
+               OpStore %viewDirectionW_1 %494 None
                OpStore %shadow %float_1 None
       %x_488 = OpLoad %float %u_Float None
-        %570 = OpFMul %float %float_1 %x_488
-               OpStore %glossiness_1 %570 None
+        %496 = OpFMul %float %float_1 %x_488
+               OpStore %glossiness_1 %496 None
                OpStore %diffuseBase %8 None
                OpStore %specularBase %8 None
       %x_494 = OpLoad %v4float %output4 None
-        %572 = OpCompositeExtract %float %x_494 0
-        %573 = OpCompositeExtract %float %x_494 1
-        %574 = OpCompositeExtract %float %x_494 2
-        %575 = OpCompositeConstruct %v3float %572 %573 %574
-               OpStore %normalW %575 None
+        %498 = OpCompositeExtract %float %x_494 0
+        %499 = OpCompositeExtract %float %x_494 1
+        %500 = OpCompositeExtract %float %x_494 2
+        %501 = OpCompositeConstruct %v3float %498 %499 %500
+               OpStore %normalW %501 None
       %x_501 = OpLoad %v3float %viewDirectionW_1 None
                OpStore %param_11 %x_501 None
       %x_503 = OpLoad %v3float %normalW None
                OpStore %param_12 %x_503 None
-        %578 = OpAccessChain %_ptr_Uniform_v4float %37 %uint_0 %uint_0
-      %x_507 = OpLoad %v4float %578 None
+        %504 = OpAccessChain %_ptr_Uniform_v4float %37 %uint_0 %uint_0
+      %x_507 = OpLoad %v4float %504 None
                OpStore %param_13 %x_507 None
-        %581 = OpAccessChain %_ptr_Uniform_v4float %37 %uint_0 %uint_1
-      %x_510 = OpLoad %v4float %581 None
-        %583 = OpCompositeExtract %float %x_510 0
-        %584 = OpCompositeExtract %float %x_510 1
-        %585 = OpCompositeExtract %float %x_510 2
-        %586 = OpCompositeConstruct %v3float %583 %584 %585
-               OpStore %param_14 %586 None
-        %587 = OpAccessChain %_ptr_Uniform_v4float %37 %uint_0 %uint_2
-      %x_514 = OpLoad %v4float %587 None
-        %589 = OpCompositeExtract %float %x_514 0
-        %590 = OpCompositeExtract %float %x_514 1
-        %591 = OpCompositeExtract %float %x_514 2
-        %592 = OpCompositeConstruct %v3float %589 %590 %591
-               OpStore %param_15 %592 None
-        %593 = OpAccessChain %_ptr_Uniform_v3float %37 %uint_0 %uint_3
-      %x_518 = OpLoad %v3float %593 None
+        %507 = OpAccessChain %_ptr_Uniform_v4float %37 %uint_0 %uint_1
+      %x_510 = OpLoad %v4float %507 None
+        %509 = OpCompositeExtract %float %x_510 0
+        %510 = OpCompositeExtract %float %x_510 1
+        %511 = OpCompositeExtract %float %x_510 2
+        %512 = OpCompositeConstruct %v3float %509 %510 %511
+               OpStore %param_14 %512 None
+        %513 = OpAccessChain %_ptr_Uniform_v4float %37 %uint_0 %uint_2
+      %x_514 = OpLoad %v4float %513 None
+        %515 = OpCompositeExtract %float %x_514 0
+        %516 = OpCompositeExtract %float %x_514 1
+        %517 = OpCompositeExtract %float %x_514 2
+        %518 = OpCompositeConstruct %v3float %515 %516 %517
+               OpStore %param_15 %518 None
+        %519 = OpAccessChain %_ptr_Uniform_v3float %37 %uint_0 %uint_3
+      %x_518 = OpLoad %v3float %519 None
                OpStore %param_16 %x_518 None
       %x_520 = OpLoad %float %glossiness_1 None
                OpStore %param_17 %x_520 None
       %x_521 = OpFunctionCall %lightingInfo %computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_ %param_11 %param_12 %param_13 %param_14 %param_15 %param_16 %param_17
                OpStore %info %x_521 None
                OpStore %shadow %float_1 None
-        %598 = OpAccessChain %_ptr_Function_v3float %info %uint_0
-      %x_523 = OpLoad %v3float %598 None
+        %524 = OpAccessChain %_ptr_Function_v3float %info %uint_0
+      %x_523 = OpLoad %v3float %524 None
       %x_524 = OpLoad %float %shadow None
       %x_526 = OpLoad %v3float %diffuseBase None
-        %602 = OpVectorTimesScalar %v3float %x_523 %x_524
-        %603 = OpFAdd %v3float %x_526 %602
-               OpStore %diffuseBase %603 None
-        %604 = OpAccessChain %_ptr_Function_v3float %info %uint_1
-      %x_529 = OpLoad %v3float %604 None
+        %528 = OpVectorTimesScalar %v3float %x_523 %x_524
+        %529 = OpFAdd %v3float %x_526 %528
+               OpStore %diffuseBase %529 None
+        %530 = OpAccessChain %_ptr_Function_v3float %info %uint_1
+      %x_529 = OpLoad %v3float %530 None
       %x_530 = OpLoad %float %shadow None
       %x_532 = OpLoad %v3float %specularBase None
-        %608 = OpVectorTimesScalar %v3float %x_529 %x_530
-        %609 = OpFAdd %v3float %x_532 %608
-               OpStore %specularBase %609 None
+        %534 = OpVectorTimesScalar %v3float %x_529 %x_530
+        %535 = OpFAdd %v3float %x_532 %534
+               OpStore %specularBase %535 None
       %x_535 = OpLoad %v3float %diffuseBase None
       %x_536 = OpLoad %v3float %rgb1 None
-        %612 = OpFMul %v3float %x_535 %x_536
-               OpStore %diffuseOutput %612 None
+        %538 = OpFMul %v3float %x_535 %x_536
+               OpStore %diffuseOutput %538 None
       %x_539 = OpLoad %v3float %specularBase None
       %x_540 = OpLoad %v3float %u_Color None
-        %615 = OpFMul %v3float %x_539 %x_540
-               OpStore %specularOutput %615 None
+        %541 = OpFMul %v3float %x_539 %x_540
+               OpStore %specularOutput %541 None
       %x_543 = OpLoad %v3float %diffuseOutput None
       %x_544 = OpLoad %v3float %specularOutput None
-        %618 = OpFAdd %v3float %x_543 %x_544
-               OpStore %output3 %618 None
+        %544 = OpFAdd %v3float %x_543 %x_544
+               OpStore %output3 %544 None
       %x_548 = OpLoad %v3float %output3 None
-        %620 = OpCompositeExtract %float %x_548 0
-        %621 = OpCompositeExtract %float %x_548 1
-        %622 = OpCompositeExtract %float %x_548 2
-        %623 = OpCompositeConstruct %v4float %620 %621 %622 %float_1
-               OpStore %glFragColor %623 None
+        %546 = OpCompositeExtract %float %x_548 0
+        %547 = OpCompositeExtract %float %x_548 1
+        %548 = OpCompositeExtract %float %x_548 2
+        %549 = OpCompositeConstruct %v4float %546 %547 %548 %float_1
+               OpStore %glFragColor %549 None
                OpReturn
                OpFunctionEnd
  %main_inner = OpFunction %main_out None %631
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.spvasm
index d8aa928..b6c43bc 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.wgsl.expected.spvasm
@@ -26,11 +26,11 @@
 %compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %15 = OpTypeFunction %void %uint
-     %uint_6 = OpConstant %uint 6
-       %bool = OpTypeBool
+   %uint_264 = OpConstant %uint 264
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_0 = OpConstant %uint 0
-   %uint_264 = OpConstant %uint 264
+     %uint_6 = OpConstant %uint 6
+       %bool = OpTypeBool
          %40 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -43,24 +43,24 @@
                OpLoopMerge %21 %19 None
                OpBranch %18
          %18 = OpLabel
-         %24 = OpUGreaterThanEqual %bool %22 %uint_6
-               OpSelectionMerge %27 None
-               OpBranchConditional %24 %28 %27
-         %28 = OpLabel
+         %30 = OpUGreaterThanEqual %bool %22 %uint_6
+               OpSelectionMerge %33 None
+               OpBranchConditional %30 %34 %33
+         %34 = OpLabel
                OpBranch %21
-         %27 = OpLabel
-         %29 = OpUMod %uint %22 %uint_2
-         %30 = OpUDiv %uint %22 %uint_2
-         %31 = OpAccessChain %_ptr_Workgroup_uint %wg %30 %29 %uint_0
-               OpAtomicStore %31 %uint_2 %uint_0 %uint_0
+         %33 = OpLabel
+         %35 = OpUMod %uint %22 %uint_2
+         %36 = OpUDiv %uint %22 %uint_2
+         %37 = OpAccessChain %_ptr_Workgroup_uint %wg %36 %35 %uint_0
+               OpAtomicStore %37 %uint_2 %uint_0 %uint_0
                OpBranch %19
          %19 = OpLabel
          %23 = OpIAdd %uint %22 %uint_1
                OpBranch %20
          %21 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %37 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2 %uint_1 %uint_0
-               OpAtomicStore %37 %uint_2 %uint_0 %uint_1
+         %26 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2 %uint_1 %uint_0
+               OpAtomicStore %26 %uint_2 %uint_0 %uint_1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/atomicStore/array/array.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/array/array.wgsl.expected.spvasm
index e231df0..5ee51c3 100644
--- a/test/tint/builtins/atomicStore/array/array.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/array/array.wgsl.expected.spvasm
@@ -22,12 +22,12 @@
 %compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %11 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_2 = OpConstant %uint 2
-     %uint_0 = OpConstant %uint 0
-     %uint_1 = OpConstant %uint 1
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
+     %uint_1 = OpConstant %uint 1
+     %uint_0 = OpConstant %uint 0
+       %bool = OpTypeBool
          %35 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %11
 %tint_local_index = OpFunctionParameter %uint
@@ -40,22 +40,22 @@
                OpLoopMerge %17 %15 None
                OpBranch %14
          %14 = OpLabel
-         %20 = OpUGreaterThanEqual %bool %18 %uint_4
-               OpSelectionMerge %22 None
-               OpBranchConditional %20 %23 %22
-         %23 = OpLabel
+         %28 = OpUGreaterThanEqual %bool %18 %uint_4
+               OpSelectionMerge %30 None
+               OpBranchConditional %28 %31 %30
+         %31 = OpLabel
                OpBranch %17
-         %22 = OpLabel
-         %24 = OpAccessChain %_ptr_Workgroup_uint %wg %18
-               OpAtomicStore %24 %uint_2 %uint_0 %uint_0
+         %30 = OpLabel
+         %32 = OpAccessChain %_ptr_Workgroup_uint %wg %18
+               OpAtomicStore %32 %uint_2 %uint_0 %uint_0
                OpBranch %15
          %15 = OpLabel
          %19 = OpIAdd %uint %18 %uint_1
                OpBranch %16
          %17 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
-               OpAtomicStore %32 %uint_2 %uint_0 %uint_1
+         %23 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
+               OpAtomicStore %23 %uint_2 %uint_0 %uint_1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.spvasm
index d8aa928..b6c43bc 100644
--- a/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/array/arrays.wgsl.expected.spvasm
@@ -26,11 +26,11 @@
 %compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %15 = OpTypeFunction %void %uint
-     %uint_6 = OpConstant %uint 6
-       %bool = OpTypeBool
+   %uint_264 = OpConstant %uint 264
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_0 = OpConstant %uint 0
-   %uint_264 = OpConstant %uint 264
+     %uint_6 = OpConstant %uint 6
+       %bool = OpTypeBool
          %40 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %15
 %tint_local_index = OpFunctionParameter %uint
@@ -43,24 +43,24 @@
                OpLoopMerge %21 %19 None
                OpBranch %18
          %18 = OpLabel
-         %24 = OpUGreaterThanEqual %bool %22 %uint_6
-               OpSelectionMerge %27 None
-               OpBranchConditional %24 %28 %27
-         %28 = OpLabel
+         %30 = OpUGreaterThanEqual %bool %22 %uint_6
+               OpSelectionMerge %33 None
+               OpBranchConditional %30 %34 %33
+         %34 = OpLabel
                OpBranch %21
-         %27 = OpLabel
-         %29 = OpUMod %uint %22 %uint_2
-         %30 = OpUDiv %uint %22 %uint_2
-         %31 = OpAccessChain %_ptr_Workgroup_uint %wg %30 %29 %uint_0
-               OpAtomicStore %31 %uint_2 %uint_0 %uint_0
+         %33 = OpLabel
+         %35 = OpUMod %uint %22 %uint_2
+         %36 = OpUDiv %uint %22 %uint_2
+         %37 = OpAccessChain %_ptr_Workgroup_uint %wg %36 %35 %uint_0
+               OpAtomicStore %37 %uint_2 %uint_0 %uint_0
                OpBranch %19
          %19 = OpLabel
          %23 = OpIAdd %uint %22 %uint_1
                OpBranch %20
          %21 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %37 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2 %uint_1 %uint_0
-               OpAtomicStore %37 %uint_2 %uint_0 %uint_1
+         %26 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2 %uint_1 %uint_0
+               OpAtomicStore %26 %uint_2 %uint_0 %uint_1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.spvasm
index efda0e7..82c76be 100644
--- a/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/struct/array_of_struct.wgsl.expected.spvasm
@@ -28,16 +28,16 @@
 %compute_main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %13 = OpTypeFunction %void %uint
+     %uint_2 = OpConstant %uint 2
+   %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
+     %uint_4 = OpConstant %uint 4
+     %uint_1 = OpConstant %uint 1
+     %uint_0 = OpConstant %uint 0
        %bool = OpTypeBool
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
       %int_0 = OpConstant %int 0
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
-     %uint_1 = OpConstant %uint 1
-     %uint_2 = OpConstant %uint 2
 %_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
-   %uint_264 = OpConstant %uint 264
-     %uint_4 = OpConstant %uint 4
          %43 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %13
 %tint_local_index = OpFunctionParameter %uint
@@ -50,26 +50,26 @@
                OpLoopMerge %19 %17 None
                OpBranch %16
          %16 = OpLabel
-         %22 = OpUGreaterThanEqual %bool %20 %uint_10
-               OpSelectionMerge %24 None
-               OpBranchConditional %22 %25 %24
-         %25 = OpLabel
+         %31 = OpUGreaterThanEqual %bool %20 %uint_10
+               OpSelectionMerge %33 None
+               OpBranchConditional %31 %34 %33
+         %34 = OpLabel
                OpBranch %19
-         %24 = OpLabel
-         %26 = OpAccessChain %_ptr_Workgroup_int %wg %20 %uint_0
-               OpStore %26 %int_0 None
-         %30 = OpAccessChain %_ptr_Workgroup_uint %wg %20 %uint_1
-               OpAtomicStore %30 %uint_2 %uint_0 %uint_0
-         %35 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %20 %uint_2
-               OpStore %35 %uint_0 None
+         %33 = OpLabel
+         %35 = OpAccessChain %_ptr_Workgroup_int %wg %20 %uint_0
+               OpStore %35 %int_0 None
+         %38 = OpAccessChain %_ptr_Workgroup_uint %wg %20 %uint_1
+               OpAtomicStore %38 %uint_2 %uint_0 %uint_0
+         %40 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %20 %uint_2
+               OpStore %40 %uint_0 None
                OpBranch %17
          %17 = OpLabel
          %21 = OpIAdd %uint %20 %uint_1
                OpBranch %18
          %19 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_4 %uint_1
-               OpAtomicStore %39 %uint_2 %uint_0 %uint_1
+         %25 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_4 %uint_1
+               OpAtomicStore %25 %uint_2 %uint_0 %uint_1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %43
diff --git a/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.wgsl.expected.spvasm
index 47b7c7b..d2940c8 100644
--- a/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/struct/flat_multiple_atomics.wgsl.expected.spvasm
@@ -28,12 +28,12 @@
          %11 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
+      %int_0 = OpConstant %int 0
          %35 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %11
 %tint_local_index = OpFunctionParameter %uint
@@ -42,19 +42,19 @@
                OpSelectionMerge %16 None
                OpBranchConditional %13 %17 %16
          %17 = OpLabel
-         %18 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
-               OpStore %18 %int_0 None
-         %22 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
-               OpAtomicStore %22 %uint_2 %uint_0 %uint_0
-         %26 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
-               OpAtomicStore %26 %uint_2 %uint_0 %uint_0
+         %27 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
+               OpStore %27 %int_0 None
+         %30 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
+               OpAtomicStore %30 %uint_2 %uint_0 %uint_0
+         %32 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
+               OpAtomicStore %32 %uint_2 %uint_0 %uint_0
                OpBranch %16
          %16 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %30 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
-               OpAtomicStore %30 %uint_2 %uint_0 %uint_1
-         %32 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
-               OpAtomicStore %32 %uint_2 %uint_0 %uint_2
+         %21 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
+               OpAtomicStore %21 %uint_2 %uint_0 %uint_1
+         %25 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
+               OpAtomicStore %25 %uint_2 %uint_0 %uint_2
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/atomicStore/struct/flat_single_atomic.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/struct/flat_single_atomic.wgsl.expected.spvasm
index 1f41b11..1bf41ca 100644
--- a/test/tint/builtins/atomicStore/struct/flat_single_atomic.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/struct/flat_single_atomic.wgsl.expected.spvasm
@@ -28,13 +28,13 @@
          %11 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_2 = OpConstant %uint 2
-%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
+      %int_0 = OpConstant %int 0
+%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
          %33 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %11
 %tint_local_index = OpFunctionParameter %uint
@@ -43,17 +43,17 @@
                OpSelectionMerge %16 None
                OpBranchConditional %13 %17 %16
          %17 = OpLabel
-         %18 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
-               OpStore %18 %int_0 None
-         %22 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
-               OpAtomicStore %22 %uint_2 %uint_0 %uint_0
-         %26 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_2
-               OpStore %26 %uint_0 None
+         %25 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
+               OpStore %25 %int_0 None
+         %28 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
+               OpAtomicStore %28 %uint_2 %uint_0 %uint_0
+         %30 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_2
+               OpStore %30 %uint_0 None
                OpBranch %16
          %16 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %30 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
-               OpAtomicStore %30 %uint_2 %uint_0 %uint_1
+         %21 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
+               OpAtomicStore %21 %uint_2 %uint_0 %uint_1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %33
diff --git a/test/tint/builtins/atomicStore/struct/nested.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/struct/nested.wgsl.expected.spvasm
index f318a78..8668c33 100644
--- a/test/tint/builtins/atomicStore/struct/nested.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/struct/nested.wgsl.expected.spvasm
@@ -41,13 +41,13 @@
          %13 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
-     %uint_3 = OpConstant %uint 3
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
+     %uint_3 = OpConstant %uint 3
+     %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
+      %int_0 = OpConstant %int 0
          %42 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %13
 %tint_local_index = OpFunctionParameter %uint
@@ -56,31 +56,31 @@
                OpSelectionMerge %18 None
                OpBranchConditional %15 %19 %18
          %19 = OpLabel
-         %20 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
-               OpStore %20 %int_0 None
-         %24 = OpAccessChain %_ptr_Workgroup_int %wg %uint_1
-               OpStore %24 %int_0 None
-         %25 = OpAccessChain %_ptr_Workgroup_int %wg %uint_2
-               OpStore %25 %int_0 None
-         %27 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_0
-               OpStore %27 %int_0 None
-         %29 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_1 %uint_0
-               OpStore %29 %int_0 None
-         %30 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_3 %uint_1 %uint_1
-               OpAtomicStore %30 %uint_2 %uint_0 %uint_0
-         %33 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_1 %uint_2
+         %28 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
+               OpStore %28 %int_0 None
+         %31 = OpAccessChain %_ptr_Workgroup_int %wg %uint_1
+               OpStore %31 %int_0 None
+         %32 = OpAccessChain %_ptr_Workgroup_int %wg %uint_2
+               OpStore %32 %int_0 None
+         %33 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_0
                OpStore %33 %int_0 None
-         %34 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_1 %uint_3
+         %34 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_1 %uint_0
                OpStore %34 %int_0 None
-         %35 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_2
-               OpStore %35 %int_0 None
-         %36 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_3
-               OpStore %36 %int_0 None
+         %35 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_3 %uint_1 %uint_1
+               OpAtomicStore %35 %uint_2 %uint_0 %uint_0
+         %37 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_1 %uint_2
+               OpStore %37 %int_0 None
+         %38 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_1 %uint_3
+               OpStore %38 %int_0 None
+         %39 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_2
+               OpStore %39 %int_0 None
+         %40 = OpAccessChain %_ptr_Workgroup_int %wg %uint_3 %uint_3
+               OpStore %40 %int_0 None
                OpBranch %18
          %18 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %39 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_3 %uint_1 %uint_1
-               OpAtomicStore %39 %uint_2 %uint_0 %uint_1
+         %23 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_3 %uint_1 %uint_1
+               OpAtomicStore %23 %uint_2 %uint_0 %uint_1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %42
diff --git a/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.spvasm
index 49a70af..8bb89ea 100644
--- a/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/struct/struct_of_array.wgsl.expected.spvasm
@@ -30,14 +30,14 @@
          %13 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_2 = OpConstant %uint 2
-%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_4 = OpConstant %uint 4
+     %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
+      %int_0 = OpConstant %int 0
+%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
          %46 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %13
 %tint_local_index = OpFunctionParameter %uint
@@ -46,36 +46,36 @@
                OpSelectionMerge %18 None
                OpBranchConditional %15 %19 %18
          %19 = OpLabel
-         %20 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
-               OpStore %20 %int_0 None
-         %24 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_2
-               OpStore %24 %uint_0 None
+         %35 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
+               OpStore %35 %int_0 None
+         %38 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_2
+               OpStore %38 %uint_0 None
                OpBranch %18
          %18 = OpLabel
-               OpBranch %27
-         %27 = OpLabel
-               OpBranch %30
-         %30 = OpLabel
-         %32 = OpPhi %uint %tint_local_index %27 %33 %29
-               OpLoopMerge %31 %29 None
-               OpBranch %28
-         %28 = OpLabel
-         %34 = OpUGreaterThanEqual %bool %32 %uint_10
-               OpSelectionMerge %35 None
-               OpBranchConditional %34 %36 %35
-         %36 = OpLabel
-               OpBranch %31
-         %35 = OpLabel
-         %37 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %32
-               OpAtomicStore %37 %uint_2 %uint_0 %uint_0
-               OpBranch %29
-         %29 = OpLabel
-         %33 = OpIAdd %uint %32 %uint_1
-               OpBranch %30
-         %31 = OpLabel
+               OpBranch %20
+         %20 = OpLabel
+               OpBranch %23
+         %23 = OpLabel
+         %25 = OpPhi %uint %tint_local_index %20 %26 %22
+               OpLoopMerge %24 %22 None
+               OpBranch %21
+         %21 = OpLabel
+         %40 = OpUGreaterThanEqual %bool %25 %uint_10
+               OpSelectionMerge %41 None
+               OpBranchConditional %40 %42 %41
+         %42 = OpLabel
+               OpBranch %24
+         %41 = OpLabel
+         %43 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1 %25
+               OpAtomicStore %43 %uint_2 %uint_0 %uint_0
+               OpBranch %22
+         %22 = OpLabel
+         %26 = OpIAdd %uint %25 %uint_1
+               OpBranch %23
+         %24 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %42 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_1 %uint_4
-               OpAtomicStore %42 %uint_2 %uint_0 %uint_1
+         %30 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1 %uint_4
+               OpAtomicStore %30 %uint_2 %uint_0 %uint_1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %46
diff --git a/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.spvasm b/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.spvasm
index bb19879..60a3de4 100644
--- a/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.spvasm
+++ b/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.spvasm
@@ -30,13 +30,13 @@
          %11 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-     %uint_0 = OpConstant %uint 0
-      %int_0 = OpConstant %int 0
-%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_2 = OpConstant %uint 2
-%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
    %uint_264 = OpConstant %uint 264
+%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
+     %uint_0 = OpConstant %uint 0
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
+      %int_0 = OpConstant %int 0
+%_ptr_Workgroup_uint_0 = OpTypePointer Workgroup %uint
          %33 = OpTypeFunction %void
 %compute_main_inner = OpFunction %void None %11
 %tint_local_index = OpFunctionParameter %uint
@@ -45,12 +45,12 @@
                OpSelectionMerge %16 None
                OpBranchConditional %13 %17 %16
          %17 = OpLabel
-         %18 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
-               OpStore %18 %int_0 None
-         %22 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
-               OpAtomicStore %22 %uint_2 %uint_0 %uint_0
-         %26 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_2
-               OpStore %26 %uint_0 None
+         %25 = OpAccessChain %_ptr_Workgroup_int %wg %uint_0
+               OpStore %25 %int_0 None
+         %28 = OpAccessChain %_ptr_Workgroup_uint %wg %uint_1
+               OpAtomicStore %28 %uint_2 %uint_0 %uint_0
+         %30 = OpAccessChain %_ptr_Workgroup_uint_0 %wg %uint_2
+               OpStore %30 %uint_0 None
                OpBranch %16
          %16 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
diff --git a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm
index f9f170e..fad2574 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAdd/794055.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicAdd_794055 = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicAdd_794055
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicAdd_794055
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm
index 9130bb8..8774b04 100644
--- a/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAdd/d5db1d.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicAdd_d5db1d
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicAdd_d5db1d
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm
index fb2367e..21993e3 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAnd/34edd3.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicAnd_34edd3
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicAnd_34edd3
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm
index 8508d9b..2f28f6a 100644
--- a/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicAnd/45a819.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicAnd_45a819 = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicAnd_45a819
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicAnd_45a819
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm
index 3e79a6d..698bae2 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm
@@ -53,7 +53,7 @@
                OpBranch %25
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %30 = OpFunctionCall %void %atomicCompareExchangeWeak_83580d
+         %29 = OpFunctionCall %void %atomicCompareExchangeWeak_83580d
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %8
diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm
index e41b546..f735984 100644
--- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm
@@ -34,8 +34,8 @@
 %_ptr_Function___atomic_compare_exchange_result_i32 = OpTypePointer Function %__atomic_compare_exchange_result_i32
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
+      %int_0 = OpConstant %int 0
 %atomicCompareExchangeWeak_e88938 = OpFunction %void None %9
          %10 = OpLabel
         %res = OpVariable %_ptr_Function___atomic_compare_exchange_result_i32 Function
@@ -56,7 +56,7 @@
                OpBranch %27
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %void %atomicCompareExchangeWeak_e88938
+         %31 = OpFunctionCall %void %atomicCompareExchangeWeak_e88938
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
diff --git a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm
index b73ab08..08ec546 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicExchange/0a5dca.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicExchange_0a5dca
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicExchange_0a5dca
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm
index b4fda5f..0896b62 100644
--- a/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicExchange/e114ba.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicExchange_e114ba = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicExchange_e114ba
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicExchange_e114ba
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm
index 39ea465..f670ccc 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicLoad/361bf1.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicLoad_361bf1
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicLoad_361bf1
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm
index 8cf5982..1e616e6 100644
--- a/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicLoad/afcc03.wgsl.expected.spvasm
@@ -39,9 +39,9 @@
          %22 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %37 = OpTypeFunction %void
 %atomicLoad_afcc03 = OpFunction %int None %11
          %12 = OpLabel
@@ -62,9 +62,9 @@
                OpBranch %27
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %int %atomicLoad_afcc03
-         %34 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %34 %33 None
+         %31 = OpFunctionCall %int %atomicLoad_afcc03
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %32 %31 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm
index 50b5b26..787bc22 100644
--- a/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMax/a89cc3.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicMax_a89cc3 = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicMax_a89cc3
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicMax_a89cc3
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm
index 939c7fb..04e9d00 100644
--- a/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMax/beccfc.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicMax_beccfc
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicMax_beccfc
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm
index b0490bd..7970eee 100644
--- a/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMin/278235.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicMin_278235 = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicMin_278235
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicMin_278235
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm
index dea9bb8..7c05848 100644
--- a/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicMin/69d383.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicMin_69d383
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicMin_69d383
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm
index a7a67e9..f0fbed2 100644
--- a/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicOr/5e3d61.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicOr_5e3d61
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicOr_5e3d61
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm
index 8b77937..bc16a89 100644
--- a/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicOr/d09248.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicOr_d09248 = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicOr_d09248
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicOr_d09248
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicStore/726882.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicStore/726882.wgsl.expected.spvasm
index f90b191..090ff6c 100644
--- a/test/tint/builtins/gen/literal/atomicStore/726882.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicStore/726882.wgsl.expected.spvasm
@@ -43,7 +43,7 @@
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %25 = OpFunctionCall %void %atomicStore_726882
+         %24 = OpFunctionCall %void %atomicStore_726882
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %8
diff --git a/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl.expected.spvasm
index e0293ef..656d138 100644
--- a/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicStore/8bea94.wgsl.expected.spvasm
@@ -28,8 +28,8 @@
          %17 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
+      %int_0 = OpConstant %int 0
 %atomicStore_8bea94 = OpFunction %void None %9
          %10 = OpLabel
                OpAtomicStore %arg_0 %uint_2 %uint_0 %int_1
@@ -46,7 +46,7 @@
                OpBranch %22
          %22 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicStore_8bea94
+         %26 = OpFunctionCall %void %atomicStore_8bea94
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
diff --git a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm
index f7422f2..9ce6946 100644
--- a/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicSub/0d26c2.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicSub_0d26c2
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicSub_0d26c2
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm
index a287f0d..acd520c 100644
--- a/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicSub/77883a.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicSub_77883a = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicSub_77883a
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicSub_77883a
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm
index d77877a..23d71df 100644
--- a/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicXor/75dc95.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %atomicXor_75dc95 = OpFunction %int None %11
          %12 = OpLabel
@@ -63,9 +63,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %34 = OpFunctionCall %int %atomicXor_75dc95
-         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %35 %34 None
+         %32 = OpFunctionCall %int %atomicXor_75dc95
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm
index 91e4654..c93f2a7 100644
--- a/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/atomicXor/c8e6be.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicXor_c8e6be
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicXor_c8e6be
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm
index ac87385..984748f 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm
@@ -53,12 +53,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_half_uint_1024 = OpTypePointer StorageBuffer %_arr_half_uint_1024
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_0c84dd = OpFunction %15 None %19
          %20 = OpLabel
@@ -80,24 +80,24 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_half %arg_0 %38
-               OpStore %44 %half_0x0p_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_half %arg_0 %38
+               OpStore %53 %half_0x0p_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %15 %subgroupMatrixLoad_0c84dd
-         %50 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_half %50 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %49 %uint_0 %uint_64 NonPrivatePointer
+         %43 = OpFunctionCall %15 %subgroupMatrixLoad_0c84dd
+         %44 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_half %44 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %43 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm
index e119161..e1b9a22 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm
@@ -52,13 +52,13 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %30 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_half_uint_1024 = OpTypePointer StorageBuffer %_arr_half_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_139ad7 = OpFunction %15 None %19
          %20 = OpLabel
@@ -80,24 +80,24 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_64
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %37 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Workgroup_half %arg_0 %37
-               OpStore %43 %half_0x0p_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_half %arg_0 %37
+               OpStore %53 %half_0x0p_0 NonPrivatePointer
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %15 %subgroupMatrixLoad_139ad7
-         %49 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_half %49 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %48 %uint_0 %uint_64 NonPrivatePointer
+         %42 = OpFunctionCall %15 %subgroupMatrixLoad_139ad7
+         %43 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_half %43 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %42 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/37b559.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/37b559.wgsl.expected.spvasm
index 4422d95..448518b 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/37b559.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/37b559.wgsl.expected.spvasm
@@ -49,13 +49,13 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %30 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_float_uint_1024 = OpTypePointer StorageBuffer %_arr_float_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+    %float_0 = OpConstant %float 0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_37b559 = OpFunction %15 None %19
          %20 = OpLabel
@@ -77,24 +77,24 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_64
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %37 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Workgroup_float %arg_0 %37
-               OpStore %43 %float_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_float %arg_0 %37
+               OpStore %53 %float_0 NonPrivatePointer
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %15 %subgroupMatrixLoad_37b559
-         %49 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_float %49 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %48 %uint_0 %uint_64 NonPrivatePointer
+         %42 = OpFunctionCall %15 %subgroupMatrixLoad_37b559
+         %43 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %43 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %42 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm
index 98016b5..09304fc 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm
@@ -50,12 +50,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_int_uint_1024 = OpTypePointer StorageBuffer %_arr_int_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_4c307c = OpFunction %15 None %19
          %20 = OpLabel
@@ -77,24 +77,24 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_int %arg_0 %38
-               OpStore %44 %int_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_int %arg_0 %38
+               OpStore %53 %int_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %15 %subgroupMatrixLoad_4c307c
-         %49 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_int %49 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %48 %uint_0 %uint_64 NonPrivatePointer
+         %42 = OpFunctionCall %15 %subgroupMatrixLoad_4c307c
+         %43 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_int %43 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %42 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/641635.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/641635.wgsl.expected.spvasm
index 9847183..ffae611 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/641635.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/641635.wgsl.expected.spvasm
@@ -49,11 +49,11 @@
 %_ptr_Function_14 = OpTypePointer Function %14
        %void = OpTypeVoid
          %30 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-     %uint_0 = OpConstant %uint 0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_uint_uint_1024 = OpTypePointer StorageBuffer %_arr_uint_uint_1024
+     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+       %bool = OpTypeBool
          %54 = OpTypeFunction %void
 %subgroupMatrixLoad_641635 = OpFunction %14 None %18
          %19 = OpLabel
@@ -75,24 +75,24 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_64
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %48 = OpUGreaterThanEqual %bool %37 %uint_64
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %51 %50
+         %51 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %37
-               OpStore %43 %uint_0 NonPrivatePointer
+         %50 = OpLabel
+         %52 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %37
+               OpStore %52 %uint_0 NonPrivatePointer
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %47 = OpFunctionCall %14 %subgroupMatrixLoad_641635
-         %48 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
-         %50 = OpAccessChain %_ptr_StorageBuffer_uint %48 %uint_0
-               OpCooperativeMatrixStoreKHR %50 %47 %uint_0 %uint_64 NonPrivatePointer
+         %41 = OpFunctionCall %14 %subgroupMatrixLoad_641635
+         %42 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
+         %45 = OpAccessChain %_ptr_StorageBuffer_uint %42 %uint_0
+               OpCooperativeMatrixStoreKHR %45 %41 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %54
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/67af87.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/67af87.wgsl.expected.spvasm
index 7736ece..570fb97 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/67af87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/67af87.wgsl.expected.spvasm
@@ -50,12 +50,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_int_uint_1024 = OpTypePointer StorageBuffer %_arr_int_uint_1024
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_67af87 = OpFunction %15 None %19
          %20 = OpLabel
@@ -77,24 +77,24 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_int %arg_0 %38
-               OpStore %44 %int_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_int %arg_0 %38
+               OpStore %53 %int_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %15 %subgroupMatrixLoad_67af87
-         %50 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_int %50 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %49 %uint_0 %uint_64 NonPrivatePointer
+         %43 = OpFunctionCall %15 %subgroupMatrixLoad_67af87
+         %44 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_int %44 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %43 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm
index 8c46cfa..81a89db 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm
@@ -48,12 +48,12 @@
 %_ptr_Function_14 = OpTypePointer Function %14
        %void = OpTypeVoid
          %29 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-     %uint_0 = OpConstant %uint 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_uint_uint_1024 = OpTypePointer StorageBuffer %_arr_uint_uint_1024
+     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+       %bool = OpTypeBool
          %54 = OpTypeFunction %void
 %subgroupMatrixLoad_93fa82 = OpFunction %14 None %18
          %19 = OpLabel
@@ -75,24 +75,24 @@
                OpLoopMerge %35 %33 None
                OpBranch %32
          %32 = OpLabel
-         %38 = OpUGreaterThanEqual %bool %36 %uint_64
-               OpSelectionMerge %40 None
-               OpBranchConditional %38 %41 %40
-         %41 = OpLabel
+         %48 = OpUGreaterThanEqual %bool %36 %uint_64
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %51 %50
+         %51 = OpLabel
                OpBranch %35
-         %40 = OpLabel
-         %42 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %36
-               OpStore %42 %uint_0 NonPrivatePointer
+         %50 = OpLabel
+         %52 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %36
+               OpStore %52 %uint_0 NonPrivatePointer
                OpBranch %33
          %33 = OpLabel
          %37 = OpIAdd %uint %36 %uint_1
                OpBranch %34
          %35 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %47 = OpFunctionCall %14 %subgroupMatrixLoad_93fa82
-         %48 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
-         %50 = OpAccessChain %_ptr_StorageBuffer_uint %48 %uint_0
-               OpCooperativeMatrixStoreKHR %50 %47 %uint_0 %uint_64 NonPrivatePointer
+         %41 = OpFunctionCall %14 %subgroupMatrixLoad_93fa82
+         %42 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
+         %45 = OpAccessChain %_ptr_StorageBuffer_uint %42 %uint_0
+               OpCooperativeMatrixStoreKHR %45 %41 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %54
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm
index f47d5ec..3e05765 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm
@@ -50,12 +50,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_float_uint_1024 = OpTypePointer StorageBuffer %_arr_float_uint_1024
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+    %float_0 = OpConstant %float 0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_b16d34 = OpFunction %15 None %19
          %20 = OpLabel
@@ -77,24 +77,24 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_float %arg_0 %38
-               OpStore %44 %float_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_float %arg_0 %38
+               OpStore %53 %float_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %15 %subgroupMatrixLoad_b16d34
-         %50 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_float %50 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %49 %uint_0 %uint_64 NonPrivatePointer
+         %43 = OpFunctionCall %15 %subgroupMatrixLoad_b16d34
+         %44 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %44 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %43 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm
index ba44e65..c17955f 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm
@@ -50,12 +50,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_float_uint_1024 = OpTypePointer StorageBuffer %_arr_float_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+    %float_0 = OpConstant %float 0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_c857d1 = OpFunction %15 None %19
          %20 = OpLabel
@@ -77,24 +77,24 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_float %arg_0 %38
-               OpStore %44 %float_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_float %arg_0 %38
+               OpStore %53 %float_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %15 %subgroupMatrixLoad_c857d1
-         %49 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_float %49 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %48 %uint_0 %uint_64 NonPrivatePointer
+         %42 = OpFunctionCall %15 %subgroupMatrixLoad_c857d1
+         %43 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_float %43 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %42 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm
index b847bdd..c435d1e 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm
@@ -49,13 +49,13 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %30 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_int_uint_1024 = OpTypePointer StorageBuffer %_arr_int_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_ea84a8 = OpFunction %15 None %19
          %20 = OpLabel
@@ -77,24 +77,24 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_64
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %37 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Workgroup_int %arg_0 %37
-               OpStore %43 %int_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_int %arg_0 %37
+               OpStore %53 %int_0 NonPrivatePointer
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %15 %subgroupMatrixLoad_ea84a8
-         %49 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_int %49 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %48 %uint_0 %uint_64 NonPrivatePointer
+         %42 = OpFunctionCall %15 %subgroupMatrixLoad_ea84a8
+         %43 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_int %43 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %42 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm
index e14edf0..a0d4826 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm
@@ -49,11 +49,11 @@
 %_ptr_Function_14 = OpTypePointer Function %14
        %void = OpTypeVoid
          %30 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_uint_uint_1024 = OpTypePointer StorageBuffer %_arr_uint_uint_1024
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+       %bool = OpTypeBool
          %54 = OpTypeFunction %void
 %subgroupMatrixLoad_f695fe = OpFunction %14 None %18
          %19 = OpLabel
@@ -75,24 +75,24 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_64
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %48 = OpUGreaterThanEqual %bool %37 %uint_64
+               OpSelectionMerge %50 None
+               OpBranchConditional %48 %51 %50
+         %51 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %37
-               OpStore %43 %uint_0 NonPrivatePointer
+         %50 = OpLabel
+         %52 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %37
+               OpStore %52 %uint_0 NonPrivatePointer
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %47 = OpFunctionCall %14 %subgroupMatrixLoad_f695fe
-         %48 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
-         %50 = OpAccessChain %_ptr_StorageBuffer_uint %48 %uint_0
-               OpCooperativeMatrixStoreKHR %50 %47 %uint_0 %uint_64 NonPrivatePointer
+         %42 = OpFunctionCall %14 %subgroupMatrixLoad_f695fe
+         %43 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
+         %45 = OpAccessChain %_ptr_StorageBuffer_uint %43 %uint_0
+               OpCooperativeMatrixStoreKHR %45 %42 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %54
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm
index 688ea99..b232265 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm
@@ -53,12 +53,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_half_uint_1024 = OpTypePointer StorageBuffer %_arr_half_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %56 = OpTypeFunction %void
 %subgroupMatrixLoad_fd7bd9 = OpFunction %15 None %19
          %20 = OpLabel
@@ -80,24 +80,24 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %49 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %51 None
+               OpBranchConditional %49 %52 %51
+         %52 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_half %arg_0 %38
-               OpStore %44 %half_0x0p_0 NonPrivatePointer
+         %51 = OpLabel
+         %53 = OpAccessChain %_ptr_Workgroup_half %arg_0 %38
+               OpStore %53 %half_0x0p_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %15 %subgroupMatrixLoad_fd7bd9
-         %49 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
-         %52 = OpAccessChain %_ptr_StorageBuffer_half %49 %uint_0
-               OpCooperativeMatrixStoreKHR %52 %48 %uint_0 %uint_64 NonPrivatePointer
+         %42 = OpFunctionCall %15 %subgroupMatrixLoad_fd7bd9
+         %43 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
+         %46 = OpAccessChain %_ptr_StorageBuffer_half %43 %uint_0
+               OpCooperativeMatrixStoreKHR %46 %42 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %56
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/127fb7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/127fb7.wgsl.expected.spvasm
index be6b1cc..99604dc 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/127fb7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/127fb7.wgsl.expected.spvasm
@@ -41,8 +41,8 @@
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
      %uint_1 = OpConstant %uint 1
          %25 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_127fb7 = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_half %arg_0 %uint_1
@@ -60,21 +60,21 @@
                OpLoopMerge %31 %29 None
                OpBranch %28
          %28 = OpLabel
-         %34 = OpUGreaterThanEqual %bool %32 %uint_64
-               OpSelectionMerge %36 None
-               OpBranchConditional %34 %37 %36
-         %37 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %32 %uint_64
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %31
-         %36 = OpLabel
-         %38 = OpAccessChain %_ptr_Workgroup_half %arg_0 %32
-               OpStore %38 %half_0x0p_0 NonPrivatePointer
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_half %arg_0 %32
+               OpStore %41 %half_0x0p_0 NonPrivatePointer
                OpBranch %29
          %29 = OpLabel
          %33 = OpIAdd %uint %32 %uint_1
                OpBranch %30
          %31 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %41 = OpFunctionCall %void %subgroupMatrixStore_127fb7
+         %36 = OpFunctionCall %void %subgroupMatrixStore_127fb7
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm
index f14d03a..0ffc0b2 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm
@@ -36,9 +36,9 @@
          %12 = OpConstantComposite %13 %uint_0
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
          %23 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_2de0b1 = OpFunction %void None %10
          %11 = OpLabel
          %18 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %uint_1
@@ -56,21 +56,21 @@
                OpLoopMerge %29 %27 None
                OpBranch %26
          %26 = OpLabel
-         %32 = OpUGreaterThanEqual %bool %30 %uint_64
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
+         %36 = OpUGreaterThanEqual %bool %30 %uint_64
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %39 %38
+         %39 = OpLabel
                OpBranch %29
-         %34 = OpLabel
-         %36 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %30
-               OpStore %36 %uint_0 NonPrivatePointer
+         %38 = OpLabel
+         %40 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %30
+               OpStore %40 %uint_0 NonPrivatePointer
                OpBranch %27
          %27 = OpLabel
          %31 = OpIAdd %uint %30 %uint_1
                OpBranch %28
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %40 = OpFunctionCall %void %subgroupMatrixStore_2de0b1
+         %35 = OpFunctionCall %void %subgroupMatrixStore_2de0b1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %10
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/49b25b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/49b25b.wgsl.expected.spvasm
index ffe1852..f4cf5b2 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/49b25b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/49b25b.wgsl.expected.spvasm
@@ -37,9 +37,9 @@
          %13 = OpConstantComposite %14 %float_0
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
          %24 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_49b25b = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_float %arg_0 %uint_1
@@ -57,21 +57,21 @@
                OpLoopMerge %30 %28 None
                OpBranch %27
          %27 = OpLabel
-         %33 = OpUGreaterThanEqual %bool %31 %uint_64
-               OpSelectionMerge %35 None
-               OpBranchConditional %33 %36 %35
-         %36 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %31 %uint_64
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %30
-         %35 = OpLabel
-         %37 = OpAccessChain %_ptr_Workgroup_float %arg_0 %31
-               OpStore %37 %float_0 NonPrivatePointer
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_float %arg_0 %31
+               OpStore %41 %float_0 NonPrivatePointer
                OpBranch %28
          %28 = OpLabel
          %32 = OpIAdd %uint %31 %uint_1
                OpBranch %29
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %41 = OpFunctionCall %void %subgroupMatrixStore_49b25b
+         %36 = OpFunctionCall %void %subgroupMatrixStore_49b25b
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/5671e2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/5671e2.wgsl.expected.spvasm
index a0123dd..ce9cc4e 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/5671e2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/5671e2.wgsl.expected.spvasm
@@ -37,9 +37,9 @@
          %13 = OpConstantComposite %14 %int_0
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
          %24 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_5671e2 = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_int %arg_0 %uint_1
@@ -57,21 +57,21 @@
                OpLoopMerge %30 %28 None
                OpBranch %27
          %27 = OpLabel
-         %33 = OpUGreaterThanEqual %bool %31 %uint_64
-               OpSelectionMerge %35 None
-               OpBranchConditional %33 %36 %35
-         %36 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %31 %uint_64
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %30
-         %35 = OpLabel
-         %37 = OpAccessChain %_ptr_Workgroup_int %arg_0 %31
-               OpStore %37 %int_0 NonPrivatePointer
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_int %arg_0 %31
+               OpStore %41 %int_0 NonPrivatePointer
                OpBranch %28
          %28 = OpLabel
          %32 = OpIAdd %uint %31 %uint_1
                OpBranch %29
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %41 = OpFunctionCall %void %subgroupMatrixStore_5671e2
+         %36 = OpFunctionCall %void %subgroupMatrixStore_5671e2
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/5915fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/5915fe.wgsl.expected.spvasm
index db954cf..b9c6ebc 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/5915fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/5915fe.wgsl.expected.spvasm
@@ -36,9 +36,9 @@
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_1 = OpConstant %uint 1
          %23 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_5915fe = OpFunction %void None %10
          %11 = OpLabel
          %17 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %uint_1
@@ -56,21 +56,21 @@
                OpLoopMerge %29 %27 None
                OpBranch %26
          %26 = OpLabel
-         %32 = OpUGreaterThanEqual %bool %30 %uint_64
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
+         %36 = OpUGreaterThanEqual %bool %30 %uint_64
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %39 %38
+         %39 = OpLabel
                OpBranch %29
-         %34 = OpLabel
-         %36 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %30
-               OpStore %36 %uint_0 NonPrivatePointer
+         %38 = OpLabel
+         %40 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %30
+               OpStore %40 %uint_0 NonPrivatePointer
                OpBranch %27
          %27 = OpLabel
          %31 = OpIAdd %uint %30 %uint_1
                OpBranch %28
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %40 = OpFunctionCall %void %subgroupMatrixStore_5915fe
+         %35 = OpFunctionCall %void %subgroupMatrixStore_5915fe
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %10
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm
index 42aa260..b9a5e31 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm
@@ -37,8 +37,8 @@
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
      %uint_1 = OpConstant %uint 1
          %24 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_9a7d60 = OpFunction %void None %10
          %11 = OpLabel
          %18 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %uint_1
@@ -56,21 +56,21 @@
                OpLoopMerge %30 %28 None
                OpBranch %27
          %27 = OpLabel
-         %33 = OpUGreaterThanEqual %bool %31 %uint_64
-               OpSelectionMerge %35 None
-               OpBranchConditional %33 %36 %35
-         %36 = OpLabel
+         %36 = OpUGreaterThanEqual %bool %31 %uint_64
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %39 %38
+         %39 = OpLabel
                OpBranch %30
-         %35 = OpLabel
-         %37 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %31
-               OpStore %37 %uint_0 NonPrivatePointer
+         %38 = OpLabel
+         %40 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %31
+               OpStore %40 %uint_0 NonPrivatePointer
                OpBranch %28
          %28 = OpLabel
          %32 = OpIAdd %uint %31 %uint_1
                OpBranch %29
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %40 = OpFunctionCall %void %subgroupMatrixStore_9a7d60
+         %35 = OpFunctionCall %void %subgroupMatrixStore_9a7d60
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %10
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm
index e4e3978..06bc4fb 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm
@@ -38,8 +38,8 @@
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
      %uint_1 = OpConstant %uint 1
          %25 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_b9ff25 = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_float %arg_0 %uint_1
@@ -57,21 +57,21 @@
                OpLoopMerge %31 %29 None
                OpBranch %28
          %28 = OpLabel
-         %34 = OpUGreaterThanEqual %bool %32 %uint_64
-               OpSelectionMerge %36 None
-               OpBranchConditional %34 %37 %36
-         %37 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %32 %uint_64
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %31
-         %36 = OpLabel
-         %38 = OpAccessChain %_ptr_Workgroup_float %arg_0 %32
-               OpStore %38 %float_0 NonPrivatePointer
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_float %arg_0 %32
+               OpStore %41 %float_0 NonPrivatePointer
                OpBranch %29
          %29 = OpLabel
          %33 = OpIAdd %uint %32 %uint_1
                OpBranch %30
          %31 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %41 = OpFunctionCall %void %subgroupMatrixStore_b9ff25
+         %36 = OpFunctionCall %void %subgroupMatrixStore_b9ff25
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm
index 8f1c0b0..d311081 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm
@@ -38,9 +38,9 @@
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
      %uint_1 = OpConstant %uint 1
          %25 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_bfd0a4 = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_int %arg_0 %uint_1
@@ -58,21 +58,21 @@
                OpLoopMerge %31 %29 None
                OpBranch %28
          %28 = OpLabel
-         %34 = OpUGreaterThanEqual %bool %32 %uint_64
-               OpSelectionMerge %36 None
-               OpBranchConditional %34 %37 %36
-         %37 = OpLabel
+         %38 = OpUGreaterThanEqual %bool %32 %uint_64
+               OpSelectionMerge %40 None
+               OpBranchConditional %38 %41 %40
+         %41 = OpLabel
                OpBranch %31
-         %36 = OpLabel
-         %38 = OpAccessChain %_ptr_Workgroup_int %arg_0 %32
-               OpStore %38 %int_0 NonPrivatePointer
+         %40 = OpLabel
+         %42 = OpAccessChain %_ptr_Workgroup_int %arg_0 %32
+               OpStore %42 %int_0 NonPrivatePointer
                OpBranch %29
          %29 = OpLabel
          %33 = OpIAdd %uint %32 %uint_1
                OpBranch %30
          %31 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %42 = OpFunctionCall %void %subgroupMatrixStore_bfd0a4
+         %37 = OpFunctionCall %void %subgroupMatrixStore_bfd0a4
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/d07581.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/d07581.wgsl.expected.spvasm
index 7b4f315..ab9a9d0 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/d07581.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/d07581.wgsl.expected.spvasm
@@ -40,9 +40,9 @@
          %13 = OpConstantComposite %14 %half_0x0p_0
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
          %24 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_d07581 = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_half %arg_0 %uint_1
@@ -60,21 +60,21 @@
                OpLoopMerge %30 %28 None
                OpBranch %27
          %27 = OpLabel
-         %33 = OpUGreaterThanEqual %bool %31 %uint_64
-               OpSelectionMerge %35 None
-               OpBranchConditional %33 %36 %35
-         %36 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %31 %uint_64
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %30
-         %35 = OpLabel
-         %37 = OpAccessChain %_ptr_Workgroup_half %arg_0 %31
-               OpStore %37 %half_0x0p_0 NonPrivatePointer
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_half %arg_0 %31
+               OpStore %41 %half_0x0p_0 NonPrivatePointer
                OpBranch %28
          %28 = OpLabel
          %32 = OpIAdd %uint %31 %uint_1
                OpBranch %29
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %41 = OpFunctionCall %void %subgroupMatrixStore_d07581
+         %36 = OpFunctionCall %void %subgroupMatrixStore_d07581
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm
index 6098dc1..9e28b92 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm
@@ -38,9 +38,9 @@
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
      %uint_1 = OpConstant %uint 1
          %25 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_dc92cf = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_float %arg_0 %uint_1
@@ -58,21 +58,21 @@
                OpLoopMerge %31 %29 None
                OpBranch %28
          %28 = OpLabel
-         %34 = OpUGreaterThanEqual %bool %32 %uint_64
-               OpSelectionMerge %36 None
-               OpBranchConditional %34 %37 %36
-         %37 = OpLabel
+         %38 = OpUGreaterThanEqual %bool %32 %uint_64
+               OpSelectionMerge %40 None
+               OpBranchConditional %38 %41 %40
+         %41 = OpLabel
                OpBranch %31
-         %36 = OpLabel
-         %38 = OpAccessChain %_ptr_Workgroup_float %arg_0 %32
-               OpStore %38 %float_0 NonPrivatePointer
+         %40 = OpLabel
+         %42 = OpAccessChain %_ptr_Workgroup_float %arg_0 %32
+               OpStore %42 %float_0 NonPrivatePointer
                OpBranch %29
          %29 = OpLabel
          %33 = OpIAdd %uint %32 %uint_1
                OpBranch %30
          %31 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %42 = OpFunctionCall %void %subgroupMatrixStore_dc92cf
+         %37 = OpFunctionCall %void %subgroupMatrixStore_dc92cf
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/ee1195.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/ee1195.wgsl.expected.spvasm
index 54aa05f..8851203 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/ee1195.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/ee1195.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
      %uint_1 = OpConstant %uint 1
          %25 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_ee1195 = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_half %arg_0 %uint_1
@@ -61,21 +61,21 @@
                OpLoopMerge %31 %29 None
                OpBranch %28
          %28 = OpLabel
-         %34 = OpUGreaterThanEqual %bool %32 %uint_64
-               OpSelectionMerge %36 None
-               OpBranchConditional %34 %37 %36
-         %37 = OpLabel
+         %38 = OpUGreaterThanEqual %bool %32 %uint_64
+               OpSelectionMerge %40 None
+               OpBranchConditional %38 %41 %40
+         %41 = OpLabel
                OpBranch %31
-         %36 = OpLabel
-         %38 = OpAccessChain %_ptr_Workgroup_half %arg_0 %32
-               OpStore %38 %half_0x0p_0 NonPrivatePointer
+         %40 = OpLabel
+         %42 = OpAccessChain %_ptr_Workgroup_half %arg_0 %32
+               OpStore %42 %half_0x0p_0 NonPrivatePointer
                OpBranch %29
          %29 = OpLabel
          %33 = OpIAdd %uint %32 %uint_1
                OpBranch %30
          %31 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %42 = OpFunctionCall %void %subgroupMatrixStore_ee1195
+         %37 = OpFunctionCall %void %subgroupMatrixStore_ee1195
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/subgroupMatrixStore/f04d67.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/subgroupMatrixStore/f04d67.wgsl.expected.spvasm
index d9aa4b9..32a014d 100644
--- a/test/tint/builtins/gen/literal/subgroupMatrixStore/f04d67.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/subgroupMatrixStore/f04d67.wgsl.expected.spvasm
@@ -38,8 +38,8 @@
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
      %uint_1 = OpConstant %uint 1
          %25 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_f04d67 = OpFunction %void None %11
          %12 = OpLabel
          %19 = OpAccessChain %_ptr_Workgroup_int %arg_0 %uint_1
@@ -57,21 +57,21 @@
                OpLoopMerge %31 %29 None
                OpBranch %28
          %28 = OpLabel
-         %34 = OpUGreaterThanEqual %bool %32 %uint_64
-               OpSelectionMerge %36 None
-               OpBranchConditional %34 %37 %36
-         %37 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %32 %uint_64
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %31
-         %36 = OpLabel
-         %38 = OpAccessChain %_ptr_Workgroup_int %arg_0 %32
-               OpStore %38 %int_0 NonPrivatePointer
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_int %arg_0 %32
+               OpStore %41 %int_0 NonPrivatePointer
                OpBranch %29
          %29 = OpLabel
          %33 = OpIAdd %uint %32 %uint_1
                OpBranch %30
          %31 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %41 = OpFunctionCall %void %subgroupMatrixStore_f04d67
+         %36 = OpFunctionCall %void %subgroupMatrixStore_f04d67
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
index 407dd06..f9cd212 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.spvasm
@@ -202,40 +202,40 @@
                OpSelectionMerge %74 None
                OpBranchConditional %72 %75 %76
          %75 = OpLabel
-         %77 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
-         %78 = OpVectorShuffle %v3float %77 %77 0 1 2
-         %79 = OpCompositeExtract %float %77 3
+         %89 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
+         %78 = OpVectorShuffle %v3float %89 %89 0 1 2
+         %81 = OpCompositeExtract %float %89 3
                OpBranch %74
          %76 = OpLabel
-         %80 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
-         %81 = OpCompositeExtract %float %80 0
-         %82 = OpFMul %v2float %69 %63
-         %83 = OpConvertFToU %v2uint %82
-         %84 = OpImageFetch %v4float %plane_1 %83 Lod %uint_0
-         %85 = OpVectorShuffle %v2float %84 %84 0 1
-         %86 = OpCompositeConstruct %v4float %81 %85 %float_1
-         %87 = OpVectorTimesMatrix %v3float %86 %60
+         %90 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
+         %91 = OpCompositeExtract %float %90 0
+         %92 = OpFMul %v2float %69 %63
+         %93 = OpConvertFToU %v2uint %92
+         %94 = OpImageFetch %v4float %plane_1 %93 Lod %uint_0
+         %95 = OpVectorShuffle %v2float %94 %94 0 1
+         %96 = OpCompositeConstruct %v4float %91 %95 %float_1
+         %79 = OpVectorTimesMatrix %v3float %96 %60
                OpBranch %74
          %74 = OpLabel
-         %88 = OpPhi %v3float %78 %75 %87 %76
-         %89 = OpPhi %float %79 %75 %float_1 %76
-         %90 = OpIEqual %bool %59 %uint_0
-               OpSelectionMerge %91 None
-               OpBranchConditional %90 %92 %93
-         %92 = OpLabel
-         %94 = OpCompositeExtract %tint_GammaTransferParams %params 3
-         %95 = OpCompositeExtract %tint_GammaTransferParams %params 4
-         %96 = OpCompositeExtract %mat3v3float %params 5
-         %97 = OpFunctionCall %v3float %tint_GammaCorrection %88 %94
-         %99 = OpMatrixTimesVector %v3float %96 %97
-        %100 = OpFunctionCall %v3float %tint_GammaCorrection %99 %95
-               OpBranch %91
-         %93 = OpLabel
-               OpBranch %91
-         %91 = OpLabel
-        %101 = OpPhi %v3float %100 %92 %88 %93
-        %102 = OpCompositeConstruct %v4float %101 %89
-               OpReturnValue %102
+         %77 = OpPhi %v3float %78 %75 %79 %76
+         %80 = OpPhi %float %81 %75 %float_1 %76
+         %82 = OpIEqual %bool %59 %uint_0
+               OpSelectionMerge %83 None
+               OpBranchConditional %82 %84 %85
+         %84 = OpLabel
+         %97 = OpCompositeExtract %tint_GammaTransferParams %params 3
+         %98 = OpCompositeExtract %tint_GammaTransferParams %params 4
+         %99 = OpCompositeExtract %mat3v3float %params 5
+        %100 = OpFunctionCall %v3float %tint_GammaCorrection %77 %97
+        %102 = OpMatrixTimesVector %v3float %99 %100
+         %87 = OpFunctionCall %v3float %tint_GammaCorrection %102 %98
+               OpBranch %83
+         %85 = OpLabel
+               OpBranch %83
+         %83 = OpLabel
+         %86 = OpPhi %v3float %87 %84 %77 %85
+         %88 = OpCompositeConstruct %v4float %86 %80
+               OpReturnValue %88
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %105
           %v = OpFunctionParameter %v3float
@@ -500,40 +500,40 @@
                OpSelectionMerge %74 None
                OpBranchConditional %72 %75 %76
          %75 = OpLabel
-         %77 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
-         %78 = OpVectorShuffle %v3float %77 %77 0 1 2
-         %79 = OpCompositeExtract %float %77 3
+         %89 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
+         %78 = OpVectorShuffle %v3float %89 %89 0 1 2
+         %81 = OpCompositeExtract %float %89 3
                OpBranch %74
          %76 = OpLabel
-         %80 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
-         %81 = OpCompositeExtract %float %80 0
-         %82 = OpFMul %v2float %69 %63
-         %83 = OpConvertFToU %v2uint %82
-         %84 = OpImageFetch %v4float %plane_1 %83 Lod %uint_0
-         %85 = OpVectorShuffle %v2float %84 %84 0 1
-         %86 = OpCompositeConstruct %v4float %81 %85 %float_1
-         %87 = OpVectorTimesMatrix %v3float %86 %60
+         %90 = OpImageFetch %v4float %plane_0 %70 Lod %uint_0
+         %91 = OpCompositeExtract %float %90 0
+         %92 = OpFMul %v2float %69 %63
+         %93 = OpConvertFToU %v2uint %92
+         %94 = OpImageFetch %v4float %plane_1 %93 Lod %uint_0
+         %95 = OpVectorShuffle %v2float %94 %94 0 1
+         %96 = OpCompositeConstruct %v4float %91 %95 %float_1
+         %79 = OpVectorTimesMatrix %v3float %96 %60
                OpBranch %74
          %74 = OpLabel
-         %88 = OpPhi %v3float %78 %75 %87 %76
-         %89 = OpPhi %float %79 %75 %float_1 %76
-         %90 = OpIEqual %bool %59 %uint_0
-               OpSelectionMerge %91 None
-               OpBranchConditional %90 %92 %93
-         %92 = OpLabel
-         %94 = OpCompositeExtract %tint_GammaTransferParams %params 3
-         %95 = OpCompositeExtract %tint_GammaTransferParams %params 4
-         %96 = OpCompositeExtract %mat3v3float %params 5
-         %97 = OpFunctionCall %v3float %tint_GammaCorrection %88 %94
-         %99 = OpMatrixTimesVector %v3float %96 %97
-        %100 = OpFunctionCall %v3float %tint_GammaCorrection %99 %95
-               OpBranch %91
-         %93 = OpLabel
-               OpBranch %91
-         %91 = OpLabel
-        %101 = OpPhi %v3float %100 %92 %88 %93
-        %102 = OpCompositeConstruct %v4float %101 %89
-               OpReturnValue %102
+         %77 = OpPhi %v3float %78 %75 %79 %76
+         %80 = OpPhi %float %81 %75 %float_1 %76
+         %82 = OpIEqual %bool %59 %uint_0
+               OpSelectionMerge %83 None
+               OpBranchConditional %82 %84 %85
+         %84 = OpLabel
+         %97 = OpCompositeExtract %tint_GammaTransferParams %params 3
+         %98 = OpCompositeExtract %tint_GammaTransferParams %params 4
+         %99 = OpCompositeExtract %mat3v3float %params 5
+        %100 = OpFunctionCall %v3float %tint_GammaCorrection %77 %97
+        %102 = OpMatrixTimesVector %v3float %99 %100
+         %87 = OpFunctionCall %v3float %tint_GammaCorrection %102 %98
+               OpBranch %83
+         %85 = OpLabel
+               OpBranch %83
+         %83 = OpLabel
+         %86 = OpPhi %v3float %87 %84 %77 %85
+         %88 = OpCompositeConstruct %v4float %86 %80
+               OpReturnValue %88
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %105
           %v = OpFunctionParameter %v3float
@@ -812,40 +812,40 @@
                OpSelectionMerge %81 None
                OpBranchConditional %79 %82 %83
          %82 = OpLabel
-         %84 = OpImageFetch %v4float %plane_0 %77 Lod %uint_0
-         %85 = OpVectorShuffle %v3float %84 %84 0 1 2
-         %86 = OpCompositeExtract %float %84 3
+         %96 = OpImageFetch %v4float %plane_0 %77 Lod %uint_0
+         %85 = OpVectorShuffle %v3float %96 %96 0 1 2
+         %88 = OpCompositeExtract %float %96 3
                OpBranch %81
          %83 = OpLabel
-         %87 = OpImageFetch %v4float %plane_0 %77 Lod %uint_0
-         %88 = OpCompositeExtract %float %87 0
-         %89 = OpFMul %v2float %76 %70
-         %90 = OpConvertFToU %v2uint %89
-         %91 = OpImageFetch %v4float %plane_1 %90 Lod %uint_0
-         %92 = OpVectorShuffle %v2float %91 %91 0 1
-         %93 = OpCompositeConstruct %v4float %88 %92 %float_1
-         %94 = OpVectorTimesMatrix %v3float %93 %67
+         %97 = OpImageFetch %v4float %plane_0 %77 Lod %uint_0
+         %98 = OpCompositeExtract %float %97 0
+         %99 = OpFMul %v2float %76 %70
+        %100 = OpConvertFToU %v2uint %99
+        %101 = OpImageFetch %v4float %plane_1 %100 Lod %uint_0
+        %102 = OpVectorShuffle %v2float %101 %101 0 1
+        %103 = OpCompositeConstruct %v4float %98 %102 %float_1
+         %86 = OpVectorTimesMatrix %v3float %103 %67
                OpBranch %81
          %81 = OpLabel
-         %95 = OpPhi %v3float %85 %82 %94 %83
-         %96 = OpPhi %float %86 %82 %float_1 %83
-         %97 = OpIEqual %bool %66 %uint_0
-               OpSelectionMerge %98 None
-               OpBranchConditional %97 %99 %100
-         %99 = OpLabel
-        %101 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %102 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %103 = OpCompositeExtract %mat3v3float %params 5
-        %104 = OpFunctionCall %v3float %tint_GammaCorrection %95 %101
-        %106 = OpMatrixTimesVector %v3float %103 %104
-        %107 = OpFunctionCall %v3float %tint_GammaCorrection %106 %102
-               OpBranch %98
-        %100 = OpLabel
-               OpBranch %98
-         %98 = OpLabel
-        %108 = OpPhi %v3float %107 %99 %95 %100
-        %109 = OpCompositeConstruct %v4float %108 %96
-               OpReturnValue %109
+         %84 = OpPhi %v3float %85 %82 %86 %83
+         %87 = OpPhi %float %88 %82 %float_1 %83
+         %89 = OpIEqual %bool %66 %uint_0
+               OpSelectionMerge %90 None
+               OpBranchConditional %89 %91 %92
+         %91 = OpLabel
+        %104 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %105 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %106 = OpCompositeExtract %mat3v3float %params 5
+        %107 = OpFunctionCall %v3float %tint_GammaCorrection %84 %104
+        %109 = OpMatrixTimesVector %v3float %106 %107
+         %94 = OpFunctionCall %v3float %tint_GammaCorrection %109 %105
+               OpBranch %90
+         %92 = OpLabel
+               OpBranch %90
+         %90 = OpLabel
+         %93 = OpPhi %v3float %94 %91 %84 %92
+         %95 = OpCompositeConstruct %v4float %93 %87
+               OpReturnValue %95
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %112
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
index 14bc971..81c854c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.spvasm
@@ -207,40 +207,40 @@
                OpSelectionMerge %79 None
                OpBranchConditional %77 %80 %81
          %80 = OpLabel
-         %82 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %83 = OpVectorShuffle %v3float %82 %82 0 1 2
-         %84 = OpCompositeExtract %float %82 3
+         %94 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %83 = OpVectorShuffle %v3float %94 %94 0 1 2
+         %86 = OpCompositeExtract %float %94 3
                OpBranch %79
          %81 = OpLabel
-         %85 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %86 = OpCompositeExtract %float %85 0
-         %87 = OpFMul %v2float %74 %68
-         %88 = OpConvertFToU %v2uint %87
-         %89 = OpImageFetch %v4float %plane_1 %88 Lod %uint_0
-         %90 = OpVectorShuffle %v2float %89 %89 0 1
-         %91 = OpCompositeConstruct %v4float %86 %90 %float_1
-         %92 = OpVectorTimesMatrix %v3float %91 %65
+         %95 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %96 = OpCompositeExtract %float %95 0
+         %97 = OpFMul %v2float %74 %68
+         %98 = OpConvertFToU %v2uint %97
+         %99 = OpImageFetch %v4float %plane_1 %98 Lod %uint_0
+        %100 = OpVectorShuffle %v2float %99 %99 0 1
+        %101 = OpCompositeConstruct %v4float %96 %100 %float_1
+         %84 = OpVectorTimesMatrix %v3float %101 %65
                OpBranch %79
          %79 = OpLabel
-         %93 = OpPhi %v3float %83 %80 %92 %81
-         %94 = OpPhi %float %84 %80 %float_1 %81
-         %95 = OpIEqual %bool %64 %uint_0
-               OpSelectionMerge %96 None
-               OpBranchConditional %95 %97 %98
-         %97 = OpLabel
-         %99 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %100 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %101 = OpCompositeExtract %mat3v3float %params 5
-        %102 = OpFunctionCall %v3float %tint_GammaCorrection %93 %99
-        %104 = OpMatrixTimesVector %v3float %101 %102
-        %105 = OpFunctionCall %v3float %tint_GammaCorrection %104 %100
-               OpBranch %96
-         %98 = OpLabel
-               OpBranch %96
-         %96 = OpLabel
-        %106 = OpPhi %v3float %105 %97 %93 %98
-        %107 = OpCompositeConstruct %v4float %106 %94
-               OpReturnValue %107
+         %82 = OpPhi %v3float %83 %80 %84 %81
+         %85 = OpPhi %float %86 %80 %float_1 %81
+         %87 = OpIEqual %bool %64 %uint_0
+               OpSelectionMerge %88 None
+               OpBranchConditional %87 %89 %90
+         %89 = OpLabel
+        %102 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %103 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %104 = OpCompositeExtract %mat3v3float %params 5
+        %105 = OpFunctionCall %v3float %tint_GammaCorrection %82 %102
+        %107 = OpMatrixTimesVector %v3float %104 %105
+         %92 = OpFunctionCall %v3float %tint_GammaCorrection %107 %103
+               OpBranch %88
+         %90 = OpLabel
+               OpBranch %88
+         %88 = OpLabel
+         %91 = OpPhi %v3float %92 %89 %82 %90
+         %93 = OpCompositeConstruct %v4float %91 %85
+               OpReturnValue %93
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %110
           %v = OpFunctionParameter %v3float
@@ -510,40 +510,40 @@
                OpSelectionMerge %79 None
                OpBranchConditional %77 %80 %81
          %80 = OpLabel
-         %82 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %83 = OpVectorShuffle %v3float %82 %82 0 1 2
-         %84 = OpCompositeExtract %float %82 3
+         %94 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %83 = OpVectorShuffle %v3float %94 %94 0 1 2
+         %86 = OpCompositeExtract %float %94 3
                OpBranch %79
          %81 = OpLabel
-         %85 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %86 = OpCompositeExtract %float %85 0
-         %87 = OpFMul %v2float %74 %68
-         %88 = OpConvertFToU %v2uint %87
-         %89 = OpImageFetch %v4float %plane_1 %88 Lod %uint_0
-         %90 = OpVectorShuffle %v2float %89 %89 0 1
-         %91 = OpCompositeConstruct %v4float %86 %90 %float_1
-         %92 = OpVectorTimesMatrix %v3float %91 %65
+         %95 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %96 = OpCompositeExtract %float %95 0
+         %97 = OpFMul %v2float %74 %68
+         %98 = OpConvertFToU %v2uint %97
+         %99 = OpImageFetch %v4float %plane_1 %98 Lod %uint_0
+        %100 = OpVectorShuffle %v2float %99 %99 0 1
+        %101 = OpCompositeConstruct %v4float %96 %100 %float_1
+         %84 = OpVectorTimesMatrix %v3float %101 %65
                OpBranch %79
          %79 = OpLabel
-         %93 = OpPhi %v3float %83 %80 %92 %81
-         %94 = OpPhi %float %84 %80 %float_1 %81
-         %95 = OpIEqual %bool %64 %uint_0
-               OpSelectionMerge %96 None
-               OpBranchConditional %95 %97 %98
-         %97 = OpLabel
-         %99 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %100 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %101 = OpCompositeExtract %mat3v3float %params 5
-        %102 = OpFunctionCall %v3float %tint_GammaCorrection %93 %99
-        %104 = OpMatrixTimesVector %v3float %101 %102
-        %105 = OpFunctionCall %v3float %tint_GammaCorrection %104 %100
-               OpBranch %96
-         %98 = OpLabel
-               OpBranch %96
-         %96 = OpLabel
-        %106 = OpPhi %v3float %105 %97 %93 %98
-        %107 = OpCompositeConstruct %v4float %106 %94
-               OpReturnValue %107
+         %82 = OpPhi %v3float %83 %80 %84 %81
+         %85 = OpPhi %float %86 %80 %float_1 %81
+         %87 = OpIEqual %bool %64 %uint_0
+               OpSelectionMerge %88 None
+               OpBranchConditional %87 %89 %90
+         %89 = OpLabel
+        %102 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %103 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %104 = OpCompositeExtract %mat3v3float %params 5
+        %105 = OpFunctionCall %v3float %tint_GammaCorrection %82 %102
+        %107 = OpMatrixTimesVector %v3float %104 %105
+         %92 = OpFunctionCall %v3float %tint_GammaCorrection %107 %103
+               OpBranch %88
+         %90 = OpLabel
+               OpBranch %88
+         %88 = OpLabel
+         %91 = OpPhi %v3float %92 %89 %82 %90
+         %93 = OpCompositeConstruct %v4float %91 %85
+               OpReturnValue %93
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %110
           %v = OpFunctionParameter %v3float
@@ -827,40 +827,40 @@
                OpSelectionMerge %86 None
                OpBranchConditional %84 %87 %88
          %87 = OpLabel
-         %89 = OpImageFetch %v4float %plane_0 %82 Lod %uint_0
-         %90 = OpVectorShuffle %v3float %89 %89 0 1 2
-         %91 = OpCompositeExtract %float %89 3
+        %101 = OpImageFetch %v4float %plane_0 %82 Lod %uint_0
+         %90 = OpVectorShuffle %v3float %101 %101 0 1 2
+         %93 = OpCompositeExtract %float %101 3
                OpBranch %86
          %88 = OpLabel
-         %92 = OpImageFetch %v4float %plane_0 %82 Lod %uint_0
-         %93 = OpCompositeExtract %float %92 0
-         %94 = OpFMul %v2float %81 %75
-         %95 = OpConvertFToU %v2uint %94
-         %96 = OpImageFetch %v4float %plane_1 %95 Lod %uint_0
-         %97 = OpVectorShuffle %v2float %96 %96 0 1
-         %98 = OpCompositeConstruct %v4float %93 %97 %float_1
-         %99 = OpVectorTimesMatrix %v3float %98 %72
+        %102 = OpImageFetch %v4float %plane_0 %82 Lod %uint_0
+        %103 = OpCompositeExtract %float %102 0
+        %104 = OpFMul %v2float %81 %75
+        %105 = OpConvertFToU %v2uint %104
+        %106 = OpImageFetch %v4float %plane_1 %105 Lod %uint_0
+        %107 = OpVectorShuffle %v2float %106 %106 0 1
+        %108 = OpCompositeConstruct %v4float %103 %107 %float_1
+         %91 = OpVectorTimesMatrix %v3float %108 %72
                OpBranch %86
          %86 = OpLabel
-        %100 = OpPhi %v3float %90 %87 %99 %88
-        %101 = OpPhi %float %91 %87 %float_1 %88
-        %102 = OpIEqual %bool %71 %uint_0
-               OpSelectionMerge %103 None
-               OpBranchConditional %102 %104 %105
-        %104 = OpLabel
-        %106 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %107 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %108 = OpCompositeExtract %mat3v3float %params 5
-        %109 = OpFunctionCall %v3float %tint_GammaCorrection %100 %106
-        %111 = OpMatrixTimesVector %v3float %108 %109
-        %112 = OpFunctionCall %v3float %tint_GammaCorrection %111 %107
-               OpBranch %103
-        %105 = OpLabel
-               OpBranch %103
-        %103 = OpLabel
-        %113 = OpPhi %v3float %112 %104 %100 %105
-        %114 = OpCompositeConstruct %v4float %113 %101
-               OpReturnValue %114
+         %89 = OpPhi %v3float %90 %87 %91 %88
+         %92 = OpPhi %float %93 %87 %float_1 %88
+         %94 = OpIEqual %bool %71 %uint_0
+               OpSelectionMerge %95 None
+               OpBranchConditional %94 %96 %97
+         %96 = OpLabel
+        %109 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %110 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %111 = OpCompositeExtract %mat3v3float %params 5
+        %112 = OpFunctionCall %v3float %tint_GammaCorrection %89 %109
+        %114 = OpMatrixTimesVector %v3float %111 %112
+         %99 = OpFunctionCall %v3float %tint_GammaCorrection %114 %110
+               OpBranch %95
+         %97 = OpLabel
+               OpBranch %95
+         %95 = OpLabel
+         %98 = OpPhi %v3float %99 %96 %89 %97
+        %100 = OpCompositeConstruct %v4float %98 %92
+               OpReturnValue %100
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %117
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index ac11499..4a5c308 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -160,7 +160,7 @@
          %57 = OpTypeFunction %v4float %8 %8 %tint_ExternalTextureParams %22 %v2float
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %78 = OpTypeSampledImage %8
+         %90 = OpTypeSampledImage %8
     %float_0 = OpConstant %float 0
         %109 = OpTypeFunction %v3float %v3float %tint_GammaTransferParams
      %v3bool = OpTypeVector %bool 3
@@ -208,42 +208,42 @@
                OpSelectionMerge %74 None
                OpBranchConditional %71 %75 %76
          %75 = OpLabel
-         %77 = OpSampledImage %78 %plane_0 %tint_sampler
-         %79 = OpImageSampleExplicitLod %v4float %77 %68 Lod %float_0
-         %81 = OpVectorShuffle %v3float %79 %79 0 1 2
-         %82 = OpCompositeExtract %float %79 3
+         %89 = OpSampledImage %90 %plane_0 %tint_sampler
+         %91 = OpImageSampleExplicitLod %v4float %89 %68 Lod %float_0
+         %78 = OpVectorShuffle %v3float %91 %91 0 1 2
+         %81 = OpCompositeExtract %float %91 3
                OpBranch %74
          %76 = OpLabel
-         %83 = OpSampledImage %78 %plane_0 %tint_sampler
-         %84 = OpImageSampleExplicitLod %v4float %83 %68 Lod %float_0
-         %85 = OpCompositeExtract %float %84 0
-         %86 = OpExtInst %v2float %69 NClamp %67 %64 %65
-         %87 = OpSampledImage %78 %plane_1 %tint_sampler
-         %88 = OpImageSampleExplicitLod %v4float %87 %86 Lod %float_0
-         %89 = OpVectorShuffle %v2float %88 %88 0 1
-         %90 = OpCompositeConstruct %v4float %85 %89 %float_1
-         %91 = OpVectorTimesMatrix %v3float %90 %60
+         %93 = OpSampledImage %90 %plane_0 %tint_sampler
+         %94 = OpImageSampleExplicitLod %v4float %93 %68 Lod %float_0
+         %95 = OpCompositeExtract %float %94 0
+         %96 = OpExtInst %v2float %69 NClamp %67 %64 %65
+         %97 = OpSampledImage %90 %plane_1 %tint_sampler
+         %98 = OpImageSampleExplicitLod %v4float %97 %96 Lod %float_0
+         %99 = OpVectorShuffle %v2float %98 %98 0 1
+        %100 = OpCompositeConstruct %v4float %95 %99 %float_1
+         %79 = OpVectorTimesMatrix %v3float %100 %60
                OpBranch %74
          %74 = OpLabel
-         %92 = OpPhi %v3float %81 %75 %91 %76
-         %93 = OpPhi %float %82 %75 %float_1 %76
-         %94 = OpIEqual %bool %59 %uint_0
-               OpSelectionMerge %95 None
-               OpBranchConditional %94 %96 %97
-         %96 = OpLabel
-         %98 = OpCompositeExtract %tint_GammaTransferParams %params 3
-         %99 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %100 = OpCompositeExtract %mat3v3float %params 5
-        %101 = OpFunctionCall %v3float %tint_GammaCorrection %92 %98
-        %103 = OpMatrixTimesVector %v3float %100 %101
-        %104 = OpFunctionCall %v3float %tint_GammaCorrection %103 %99
-               OpBranch %95
-         %97 = OpLabel
-               OpBranch %95
-         %95 = OpLabel
-        %105 = OpPhi %v3float %104 %96 %92 %97
-        %106 = OpCompositeConstruct %v4float %105 %93
-               OpReturnValue %106
+         %77 = OpPhi %v3float %78 %75 %79 %76
+         %80 = OpPhi %float %81 %75 %float_1 %76
+         %82 = OpIEqual %bool %59 %uint_0
+               OpSelectionMerge %83 None
+               OpBranchConditional %82 %84 %85
+         %84 = OpLabel
+        %101 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %102 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %103 = OpCompositeExtract %mat3v3float %params 5
+        %104 = OpFunctionCall %v3float %tint_GammaCorrection %77 %101
+        %106 = OpMatrixTimesVector %v3float %103 %104
+         %87 = OpFunctionCall %v3float %tint_GammaCorrection %106 %102
+               OpBranch %83
+         %85 = OpLabel
+               OpBranch %83
+         %83 = OpLabel
+         %86 = OpPhi %v3float %87 %84 %77 %85
+         %88 = OpCompositeConstruct %v4float %86 %80
+               OpReturnValue %88
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %109
           %v = OpFunctionParameter %v3float
@@ -466,7 +466,7 @@
          %57 = OpTypeFunction %v4float %8 %8 %tint_ExternalTextureParams %22 %v2float
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %78 = OpTypeSampledImage %8
+         %90 = OpTypeSampledImage %8
     %float_0 = OpConstant %float 0
         %109 = OpTypeFunction %v3float %v3float %tint_GammaTransferParams
      %v3bool = OpTypeVector %bool 3
@@ -514,42 +514,42 @@
                OpSelectionMerge %74 None
                OpBranchConditional %71 %75 %76
          %75 = OpLabel
-         %77 = OpSampledImage %78 %plane_0 %tint_sampler
-         %79 = OpImageSampleExplicitLod %v4float %77 %68 Lod %float_0
-         %81 = OpVectorShuffle %v3float %79 %79 0 1 2
-         %82 = OpCompositeExtract %float %79 3
+         %89 = OpSampledImage %90 %plane_0 %tint_sampler
+         %91 = OpImageSampleExplicitLod %v4float %89 %68 Lod %float_0
+         %78 = OpVectorShuffle %v3float %91 %91 0 1 2
+         %81 = OpCompositeExtract %float %91 3
                OpBranch %74
          %76 = OpLabel
-         %83 = OpSampledImage %78 %plane_0 %tint_sampler
-         %84 = OpImageSampleExplicitLod %v4float %83 %68 Lod %float_0
-         %85 = OpCompositeExtract %float %84 0
-         %86 = OpExtInst %v2float %69 NClamp %67 %64 %65
-         %87 = OpSampledImage %78 %plane_1 %tint_sampler
-         %88 = OpImageSampleExplicitLod %v4float %87 %86 Lod %float_0
-         %89 = OpVectorShuffle %v2float %88 %88 0 1
-         %90 = OpCompositeConstruct %v4float %85 %89 %float_1
-         %91 = OpVectorTimesMatrix %v3float %90 %60
+         %93 = OpSampledImage %90 %plane_0 %tint_sampler
+         %94 = OpImageSampleExplicitLod %v4float %93 %68 Lod %float_0
+         %95 = OpCompositeExtract %float %94 0
+         %96 = OpExtInst %v2float %69 NClamp %67 %64 %65
+         %97 = OpSampledImage %90 %plane_1 %tint_sampler
+         %98 = OpImageSampleExplicitLod %v4float %97 %96 Lod %float_0
+         %99 = OpVectorShuffle %v2float %98 %98 0 1
+        %100 = OpCompositeConstruct %v4float %95 %99 %float_1
+         %79 = OpVectorTimesMatrix %v3float %100 %60
                OpBranch %74
          %74 = OpLabel
-         %92 = OpPhi %v3float %81 %75 %91 %76
-         %93 = OpPhi %float %82 %75 %float_1 %76
-         %94 = OpIEqual %bool %59 %uint_0
-               OpSelectionMerge %95 None
-               OpBranchConditional %94 %96 %97
-         %96 = OpLabel
-         %98 = OpCompositeExtract %tint_GammaTransferParams %params 3
-         %99 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %100 = OpCompositeExtract %mat3v3float %params 5
-        %101 = OpFunctionCall %v3float %tint_GammaCorrection %92 %98
-        %103 = OpMatrixTimesVector %v3float %100 %101
-        %104 = OpFunctionCall %v3float %tint_GammaCorrection %103 %99
-               OpBranch %95
-         %97 = OpLabel
-               OpBranch %95
-         %95 = OpLabel
-        %105 = OpPhi %v3float %104 %96 %92 %97
-        %106 = OpCompositeConstruct %v4float %105 %93
-               OpReturnValue %106
+         %77 = OpPhi %v3float %78 %75 %79 %76
+         %80 = OpPhi %float %81 %75 %float_1 %76
+         %82 = OpIEqual %bool %59 %uint_0
+               OpSelectionMerge %83 None
+               OpBranchConditional %82 %84 %85
+         %84 = OpLabel
+        %101 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %102 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %103 = OpCompositeExtract %mat3v3float %params 5
+        %104 = OpFunctionCall %v3float %tint_GammaCorrection %77 %101
+        %106 = OpMatrixTimesVector %v3float %103 %104
+         %87 = OpFunctionCall %v3float %tint_GammaCorrection %106 %102
+               OpBranch %83
+         %85 = OpLabel
+               OpBranch %83
+         %83 = OpLabel
+         %86 = OpPhi %v3float %87 %84 %77 %85
+         %88 = OpCompositeConstruct %v4float %86 %80
+               OpReturnValue %88
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %109
           %v = OpFunctionParameter %v3float
@@ -780,7 +780,7 @@
      %uint_1 = OpConstant %uint 1
          %65 = OpTypeFunction %v4float %3 %3 %tint_ExternalTextureParams %19 %v2float
        %bool = OpTypeBool
-         %85 = OpTypeSampledImage %3
+         %97 = OpTypeSampledImage %3
     %float_0 = OpConstant %float 0
         %116 = OpTypeFunction %v3float %v3float %tint_GammaTransferParams
      %v3bool = OpTypeVector %bool 3
@@ -834,42 +834,42 @@
                OpSelectionMerge %81 None
                OpBranchConditional %79 %82 %83
          %82 = OpLabel
-         %84 = OpSampledImage %85 %plane_0 %tint_sampler
-         %86 = OpImageSampleExplicitLod %v4float %84 %76 Lod %float_0
-         %88 = OpVectorShuffle %v3float %86 %86 0 1 2
-         %89 = OpCompositeExtract %float %86 3
+         %96 = OpSampledImage %97 %plane_0 %tint_sampler
+         %98 = OpImageSampleExplicitLod %v4float %96 %76 Lod %float_0
+         %85 = OpVectorShuffle %v3float %98 %98 0 1 2
+         %88 = OpCompositeExtract %float %98 3
                OpBranch %81
          %83 = OpLabel
-         %90 = OpSampledImage %85 %plane_0 %tint_sampler
-         %91 = OpImageSampleExplicitLod %v4float %90 %76 Lod %float_0
-         %92 = OpCompositeExtract %float %91 0
-         %93 = OpExtInst %v2float %77 NClamp %75 %72 %73
-         %94 = OpSampledImage %85 %plane_1 %tint_sampler
-         %95 = OpImageSampleExplicitLod %v4float %94 %93 Lod %float_0
-         %96 = OpVectorShuffle %v2float %95 %95 0 1
-         %97 = OpCompositeConstruct %v4float %92 %96 %float_1
-         %98 = OpVectorTimesMatrix %v3float %97 %68
+        %100 = OpSampledImage %97 %plane_0 %tint_sampler
+        %101 = OpImageSampleExplicitLod %v4float %100 %76 Lod %float_0
+        %102 = OpCompositeExtract %float %101 0
+        %103 = OpExtInst %v2float %77 NClamp %75 %72 %73
+        %104 = OpSampledImage %97 %plane_1 %tint_sampler
+        %105 = OpImageSampleExplicitLod %v4float %104 %103 Lod %float_0
+        %106 = OpVectorShuffle %v2float %105 %105 0 1
+        %107 = OpCompositeConstruct %v4float %102 %106 %float_1
+         %86 = OpVectorTimesMatrix %v3float %107 %68
                OpBranch %81
          %81 = OpLabel
-         %99 = OpPhi %v3float %88 %82 %98 %83
-        %100 = OpPhi %float %89 %82 %float_1 %83
-        %101 = OpIEqual %bool %67 %uint_0
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %104
-        %103 = OpLabel
-        %105 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %106 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %107 = OpCompositeExtract %mat3v3float %params 5
-        %108 = OpFunctionCall %v3float %tint_GammaCorrection %99 %105
-        %110 = OpMatrixTimesVector %v3float %107 %108
-        %111 = OpFunctionCall %v3float %tint_GammaCorrection %110 %106
-               OpBranch %102
-        %104 = OpLabel
-               OpBranch %102
-        %102 = OpLabel
-        %112 = OpPhi %v3float %111 %103 %99 %104
-        %113 = OpCompositeConstruct %v4float %112 %100
-               OpReturnValue %113
+         %84 = OpPhi %v3float %85 %82 %86 %83
+         %87 = OpPhi %float %88 %82 %float_1 %83
+         %89 = OpIEqual %bool %67 %uint_0
+               OpSelectionMerge %90 None
+               OpBranchConditional %89 %91 %92
+         %91 = OpLabel
+        %108 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %109 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %110 = OpCompositeExtract %mat3v3float %params 5
+        %111 = OpFunctionCall %v3float %tint_GammaCorrection %84 %108
+        %113 = OpMatrixTimesVector %v3float %110 %111
+         %94 = OpFunctionCall %v3float %tint_GammaCorrection %113 %109
+               OpBranch %90
+         %92 = OpLabel
+               OpBranch %90
+         %90 = OpLabel
+         %93 = OpPhi %v3float %94 %91 %84 %92
+         %95 = OpCompositeConstruct %v4float %93 %87
+               OpReturnValue %95
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %116
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm
index 28446a3..8d1f93f 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/37307c.wgsl.expected.spvasm
@@ -38,8 +38,8 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+     %uint_0 = OpConstant %uint 0
          %36 = OpTypeFunction %void
 %workgroupUniformLoad_37307c = OpFunction %uint None %10
          %11 = OpLabel
@@ -62,9 +62,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpFunctionCall %uint %workgroupUniformLoad_37307c
-         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %33 %32 None
+         %31 = OpFunctionCall %uint %workgroupUniformLoad_37307c
+         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %32 %31 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %36
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
index a6ae6d6..e3ebddd 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
@@ -39,9 +39,9 @@
          %24 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
      %uint_0 = OpConstant %uint 0
+    %float_0 = OpConstant %float 0
          %38 = OpTypeFunction %void
 %workgroupUniformLoad_7a857c = OpFunction %float None %11
          %12 = OpLabel
@@ -64,9 +64,9 @@
                OpBranch %29
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %float %workgroupUniformLoad_7a857c
-         %34 = OpAccessChain %_ptr_StorageBuffer_float %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %float %workgroupUniformLoad_7a857c
+         %33 = OpAccessChain %_ptr_StorageBuffer_float %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
index 70a60b3..e7edf27 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
@@ -39,9 +39,9 @@
          %24 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
      %uint_0 = OpConstant %uint 0
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %workgroupUniformLoad_9d33de = OpFunction %int None %11
          %12 = OpLabel
@@ -64,9 +64,9 @@
                OpBranch %29
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %int %workgroupUniformLoad_9d33de
-         %34 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %int %workgroupUniformLoad_9d33de
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
index 1e46f83..ed4fca5 100644
--- a/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
@@ -42,9 +42,9 @@
          %24 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
      %uint_0 = OpConstant %uint 0
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %38 = OpTypeFunction %void
 %workgroupUniformLoad_e07d08 = OpFunction %half None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %29
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %half %workgroupUniformLoad_e07d08
-         %34 = OpAccessChain %_ptr_StorageBuffer_half %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %half %workgroupUniformLoad_e07d08
+         %33 = OpAccessChain %_ptr_StorageBuffer_half %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm
index 12e7a91..8a07edb 100644
--- a/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAdd/794055.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicAdd_794055 = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicAdd_794055
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicAdd_794055
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm
index 88b21eb..9eb8c14 100644
--- a/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAdd/d5db1d.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicAdd_d5db1d
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicAdd_d5db1d
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm
index fe65f03..fa24e39 100644
--- a/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAnd/34edd3.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicAnd_34edd3
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicAnd_34edd3
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm
index f3b38e1..bf4b02a 100644
--- a/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicAnd/45a819.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicAnd_45a819 = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicAnd_45a819
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicAnd_45a819
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm
index d22b55f..4c522b9 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/83580d.wgsl.expected.spvasm
@@ -62,7 +62,7 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %35 = OpFunctionCall %void %atomicCompareExchangeWeak_83580d
+         %34 = OpFunctionCall %void %atomicCompareExchangeWeak_83580d
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %8
diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm
index cf682ba..e02a1fa 100644
--- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/e88938.wgsl.expected.spvasm
@@ -37,8 +37,8 @@
 %_ptr_Function___atomic_compare_exchange_result_i32 = OpTypePointer Function %__atomic_compare_exchange_result_i32
          %28 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
+      %int_0 = OpConstant %int 0
 %atomicCompareExchangeWeak_e88938 = OpFunction %void None %9
          %10 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_int Function
@@ -65,7 +65,7 @@
                OpBranch %32
          %32 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %38 = OpFunctionCall %void %atomicCompareExchangeWeak_e88938
+         %36 = OpFunctionCall %void %atomicCompareExchangeWeak_e88938
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
diff --git a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm
index 8b541e9..8a59dac 100644
--- a/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicExchange/0a5dca.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicExchange_0a5dca
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicExchange_0a5dca
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm
index e580d17..0e32c4a 100644
--- a/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicExchange/e114ba.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicExchange_e114ba = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicExchange_e114ba
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicExchange_e114ba
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm
index 39ea465..f670ccc 100644
--- a/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicLoad/361bf1.wgsl.expected.spvasm
@@ -60,9 +60,9 @@
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %uint %atomicLoad_361bf1
-         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %32 %31 None
+         %30 = OpFunctionCall %uint %atomicLoad_361bf1
+         %31 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %31 %30 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %35
diff --git a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm
index 8cf5982..1e616e6 100644
--- a/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicLoad/afcc03.wgsl.expected.spvasm
@@ -39,9 +39,9 @@
          %22 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %37 = OpTypeFunction %void
 %atomicLoad_afcc03 = OpFunction %int None %11
          %12 = OpLabel
@@ -62,9 +62,9 @@
                OpBranch %27
          %27 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %int %atomicLoad_afcc03
-         %34 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %34 %33 None
+         %31 = OpFunctionCall %int %atomicLoad_afcc03
+         %32 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %32 %31 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm
index 478bfaf..eb7e0b8 100644
--- a/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMax/a89cc3.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicMax_a89cc3 = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicMax_a89cc3
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicMax_a89cc3
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm
index 7706356..4b69789 100644
--- a/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMax/beccfc.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicMax_beccfc
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicMax_beccfc
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm
index 19aded5..2e4dd70 100644
--- a/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMin/278235.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicMin_278235 = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicMin_278235
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicMin_278235
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm
index 0d29b9b..0723e8d 100644
--- a/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicMin/69d383.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicMin_69d383
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicMin_69d383
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm
index e8f52cb..0765b40 100644
--- a/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicOr/5e3d61.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicOr_5e3d61
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicOr_5e3d61
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm
index 4544a19..17a718f 100644
--- a/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicOr/d09248.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicOr_d09248 = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicOr_d09248
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicOr_d09248
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicStore/726882.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicStore/726882.wgsl.expected.spvasm
index 0c60f9b..e69f756 100644
--- a/test/tint/builtins/gen/var/atomicStore/726882.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicStore/726882.wgsl.expected.spvasm
@@ -48,7 +48,7 @@
                OpBranch %23
          %23 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %28 = OpFunctionCall %void %atomicStore_726882
+         %27 = OpFunctionCall %void %atomicStore_726882
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %8
diff --git a/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl.expected.spvasm
index 02e471a..1d07d17 100644
--- a/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicStore/8bea94.wgsl.expected.spvasm
@@ -30,8 +30,8 @@
          %20 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
+      %int_0 = OpConstant %int 0
 %atomicStore_8bea94 = OpFunction %void None %9
          %10 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_int Function
@@ -51,7 +51,7 @@
                OpBranch %25
          %25 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %31 = OpFunctionCall %void %atomicStore_8bea94
+         %29 = OpFunctionCall %void %atomicStore_8bea94
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
diff --git a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm
index 8fa3688..ff06e43 100644
--- a/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicSub/0d26c2.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicSub_0d26c2
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicSub_0d26c2
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm
index 2f18c54..34068e7 100644
--- a/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicSub/77883a.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicSub_77883a = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicSub_77883a
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicSub_77883a
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm
index bb6444e..01a4547 100644
--- a/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicXor/75dc95.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
          %25 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
    %uint_264 = OpConstant %uint 264
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+      %int_0 = OpConstant %int 0
          %40 = OpTypeFunction %void
 %atomicXor_75dc95 = OpFunction %int None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %30
          %30 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpFunctionCall %int %atomicXor_75dc95
-         %37 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %37 %36 None
+         %34 = OpFunctionCall %int %atomicXor_75dc95
+         %35 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %35 %34 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %40
diff --git a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm
index a46cfed..bc94d73 100644
--- a/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/atomicXor/c8e6be.wgsl.expected.spvasm
@@ -64,9 +64,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %uint %atomicXor_c8e6be
-         %34 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %uint %atomicXor_c8e6be
+         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %37
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm
index 997be39..4c42c05 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/0c84dd.wgsl.expected.spvasm
@@ -56,12 +56,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %36 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_half_uint_1024 = OpTypePointer StorageBuffer %_arr_half_uint_1024
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_0c84dd = OpFunction %15 None %19
          %20 = OpLabel
@@ -89,24 +89,24 @@
                OpLoopMerge %42 %40 None
                OpBranch %39
          %39 = OpLabel
-         %45 = OpUGreaterThanEqual %bool %43 %uint_64
-               OpSelectionMerge %47 None
-               OpBranchConditional %45 %48 %47
-         %48 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %43 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %42
-         %47 = OpLabel
-         %49 = OpAccessChain %_ptr_Workgroup_half %arg_0 %43
-               OpStore %49 %half_0x0p_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_half %arg_0 %43
+               OpStore %58 %half_0x0p_0 NonPrivatePointer
                OpBranch %40
          %40 = OpLabel
          %44 = OpIAdd %uint %43 %uint_1
                OpBranch %41
          %42 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %54 = OpFunctionCall %15 %subgroupMatrixLoad_0c84dd
-         %55 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_half %55 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %54 %uint_0 %uint_64 NonPrivatePointer
+         %48 = OpFunctionCall %15 %subgroupMatrixLoad_0c84dd
+         %49 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_half %49 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %48 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm
index 735197e..476e685 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/139ad7.wgsl.expected.spvasm
@@ -55,13 +55,13 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %35 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_half_uint_1024 = OpTypePointer StorageBuffer %_arr_half_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_139ad7 = OpFunction %15 None %19
          %20 = OpLabel
@@ -89,24 +89,24 @@
                OpLoopMerge %41 %39 None
                OpBranch %38
          %38 = OpLabel
-         %44 = OpUGreaterThanEqual %bool %42 %uint_64
-               OpSelectionMerge %46 None
-               OpBranchConditional %44 %47 %46
-         %47 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %42 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %41
-         %46 = OpLabel
-         %48 = OpAccessChain %_ptr_Workgroup_half %arg_0 %42
-               OpStore %48 %half_0x0p_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_half %arg_0 %42
+               OpStore %58 %half_0x0p_0 NonPrivatePointer
                OpBranch %39
          %39 = OpLabel
          %43 = OpIAdd %uint %42 %uint_1
                OpBranch %40
          %41 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %53 = OpFunctionCall %15 %subgroupMatrixLoad_139ad7
-         %54 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_half %54 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %53 %uint_0 %uint_64 NonPrivatePointer
+         %47 = OpFunctionCall %15 %subgroupMatrixLoad_139ad7
+         %48 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_half %48 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %47 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/37b559.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/37b559.wgsl.expected.spvasm
index d9bc968..0d27aac 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/37b559.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/37b559.wgsl.expected.spvasm
@@ -52,13 +52,13 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %35 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_float_uint_1024 = OpTypePointer StorageBuffer %_arr_float_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+    %float_0 = OpConstant %float 0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_37b559 = OpFunction %15 None %19
          %20 = OpLabel
@@ -86,24 +86,24 @@
                OpLoopMerge %41 %39 None
                OpBranch %38
          %38 = OpLabel
-         %44 = OpUGreaterThanEqual %bool %42 %uint_64
-               OpSelectionMerge %46 None
-               OpBranchConditional %44 %47 %46
-         %47 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %42 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %41
-         %46 = OpLabel
-         %48 = OpAccessChain %_ptr_Workgroup_float %arg_0 %42
-               OpStore %48 %float_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_float %arg_0 %42
+               OpStore %58 %float_0 NonPrivatePointer
                OpBranch %39
          %39 = OpLabel
          %43 = OpIAdd %uint %42 %uint_1
                OpBranch %40
          %41 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %53 = OpFunctionCall %15 %subgroupMatrixLoad_37b559
-         %54 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_float %54 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %53 %uint_0 %uint_64 NonPrivatePointer
+         %47 = OpFunctionCall %15 %subgroupMatrixLoad_37b559
+         %48 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_float %48 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %47 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm
index 7ff5b22..2649c2b 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/4c307c.wgsl.expected.spvasm
@@ -53,12 +53,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %36 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_int_uint_1024 = OpTypePointer StorageBuffer %_arr_int_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_4c307c = OpFunction %15 None %19
          %20 = OpLabel
@@ -86,24 +86,24 @@
                OpLoopMerge %42 %40 None
                OpBranch %39
          %39 = OpLabel
-         %45 = OpUGreaterThanEqual %bool %43 %uint_64
-               OpSelectionMerge %47 None
-               OpBranchConditional %45 %48 %47
-         %48 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %43 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %42
-         %47 = OpLabel
-         %49 = OpAccessChain %_ptr_Workgroup_int %arg_0 %43
-               OpStore %49 %int_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_int %arg_0 %43
+               OpStore %58 %int_0 NonPrivatePointer
                OpBranch %40
          %40 = OpLabel
          %44 = OpIAdd %uint %43 %uint_1
                OpBranch %41
          %42 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %53 = OpFunctionCall %15 %subgroupMatrixLoad_4c307c
-         %54 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_int %54 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %53 %uint_0 %uint_64 NonPrivatePointer
+         %47 = OpFunctionCall %15 %subgroupMatrixLoad_4c307c
+         %48 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_int %48 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %47 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/641635.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/641635.wgsl.expected.spvasm
index 19e4540..dafc850 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/641635.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/641635.wgsl.expected.spvasm
@@ -52,11 +52,11 @@
 %_ptr_Function_14 = OpTypePointer Function %14
        %void = OpTypeVoid
          %35 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-     %uint_0 = OpConstant %uint 0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_uint_uint_1024 = OpTypePointer StorageBuffer %_arr_uint_uint_1024
+     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+       %bool = OpTypeBool
          %59 = OpTypeFunction %void
 %subgroupMatrixLoad_641635 = OpFunction %14 None %18
          %19 = OpLabel
@@ -84,24 +84,24 @@
                OpLoopMerge %41 %39 None
                OpBranch %38
          %38 = OpLabel
-         %44 = OpUGreaterThanEqual %bool %42 %uint_64
-               OpSelectionMerge %46 None
-               OpBranchConditional %44 %47 %46
-         %47 = OpLabel
+         %53 = OpUGreaterThanEqual %bool %42 %uint_64
+               OpSelectionMerge %55 None
+               OpBranchConditional %53 %56 %55
+         %56 = OpLabel
                OpBranch %41
-         %46 = OpLabel
-         %48 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %42
-               OpStore %48 %uint_0 NonPrivatePointer
+         %55 = OpLabel
+         %57 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %42
+               OpStore %57 %uint_0 NonPrivatePointer
                OpBranch %39
          %39 = OpLabel
          %43 = OpIAdd %uint %42 %uint_1
                OpBranch %40
          %41 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %52 = OpFunctionCall %14 %subgroupMatrixLoad_641635
-         %53 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
-         %55 = OpAccessChain %_ptr_StorageBuffer_uint %53 %uint_0
-               OpCooperativeMatrixStoreKHR %55 %52 %uint_0 %uint_64 NonPrivatePointer
+         %46 = OpFunctionCall %14 %subgroupMatrixLoad_641635
+         %47 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
+         %50 = OpAccessChain %_ptr_StorageBuffer_uint %47 %uint_0
+               OpCooperativeMatrixStoreKHR %50 %46 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %59
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/67af87.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/67af87.wgsl.expected.spvasm
index 39d50b5..a3fc244 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/67af87.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/67af87.wgsl.expected.spvasm
@@ -53,12 +53,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %36 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_int_uint_1024 = OpTypePointer StorageBuffer %_arr_int_uint_1024
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_67af87 = OpFunction %15 None %19
          %20 = OpLabel
@@ -86,24 +86,24 @@
                OpLoopMerge %42 %40 None
                OpBranch %39
          %39 = OpLabel
-         %45 = OpUGreaterThanEqual %bool %43 %uint_64
-               OpSelectionMerge %47 None
-               OpBranchConditional %45 %48 %47
-         %48 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %43 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %42
-         %47 = OpLabel
-         %49 = OpAccessChain %_ptr_Workgroup_int %arg_0 %43
-               OpStore %49 %int_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_int %arg_0 %43
+               OpStore %58 %int_0 NonPrivatePointer
                OpBranch %40
          %40 = OpLabel
          %44 = OpIAdd %uint %43 %uint_1
                OpBranch %41
          %42 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %54 = OpFunctionCall %15 %subgroupMatrixLoad_67af87
-         %55 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_int %55 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %54 %uint_0 %uint_64 NonPrivatePointer
+         %48 = OpFunctionCall %15 %subgroupMatrixLoad_67af87
+         %49 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_int %49 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %48 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm
index bc4263a..75efba4 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/93fa82.wgsl.expected.spvasm
@@ -51,12 +51,12 @@
 %_ptr_Function_14 = OpTypePointer Function %14
        %void = OpTypeVoid
          %34 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-     %uint_0 = OpConstant %uint 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_uint_uint_1024 = OpTypePointer StorageBuffer %_arr_uint_uint_1024
+     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+       %bool = OpTypeBool
          %59 = OpTypeFunction %void
 %subgroupMatrixLoad_93fa82 = OpFunction %14 None %18
          %19 = OpLabel
@@ -84,24 +84,24 @@
                OpLoopMerge %40 %38 None
                OpBranch %37
          %37 = OpLabel
-         %43 = OpUGreaterThanEqual %bool %41 %uint_64
-               OpSelectionMerge %45 None
-               OpBranchConditional %43 %46 %45
-         %46 = OpLabel
+         %53 = OpUGreaterThanEqual %bool %41 %uint_64
+               OpSelectionMerge %55 None
+               OpBranchConditional %53 %56 %55
+         %56 = OpLabel
                OpBranch %40
-         %45 = OpLabel
-         %47 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %41
-               OpStore %47 %uint_0 NonPrivatePointer
+         %55 = OpLabel
+         %57 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %41
+               OpStore %57 %uint_0 NonPrivatePointer
                OpBranch %38
          %38 = OpLabel
          %42 = OpIAdd %uint %41 %uint_1
                OpBranch %39
          %40 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %52 = OpFunctionCall %14 %subgroupMatrixLoad_93fa82
-         %53 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
-         %55 = OpAccessChain %_ptr_StorageBuffer_uint %53 %uint_0
-               OpCooperativeMatrixStoreKHR %55 %52 %uint_0 %uint_64 NonPrivatePointer
+         %46 = OpFunctionCall %14 %subgroupMatrixLoad_93fa82
+         %47 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
+         %50 = OpAccessChain %_ptr_StorageBuffer_uint %47 %uint_0
+               OpCooperativeMatrixStoreKHR %50 %46 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %59
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm
index 31076f5..05bb6f4 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/b16d34.wgsl.expected.spvasm
@@ -53,12 +53,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %36 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_float_uint_1024 = OpTypePointer StorageBuffer %_arr_float_uint_1024
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+    %float_0 = OpConstant %float 0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_b16d34 = OpFunction %15 None %19
          %20 = OpLabel
@@ -86,24 +86,24 @@
                OpLoopMerge %42 %40 None
                OpBranch %39
          %39 = OpLabel
-         %45 = OpUGreaterThanEqual %bool %43 %uint_64
-               OpSelectionMerge %47 None
-               OpBranchConditional %45 %48 %47
-         %48 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %43 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %42
-         %47 = OpLabel
-         %49 = OpAccessChain %_ptr_Workgroup_float %arg_0 %43
-               OpStore %49 %float_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_float %arg_0 %43
+               OpStore %58 %float_0 NonPrivatePointer
                OpBranch %40
          %40 = OpLabel
          %44 = OpIAdd %uint %43 %uint_1
                OpBranch %41
          %42 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %54 = OpFunctionCall %15 %subgroupMatrixLoad_b16d34
-         %55 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_float %55 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %54 %uint_0 %uint_64 NonPrivatePointer
+         %48 = OpFunctionCall %15 %subgroupMatrixLoad_b16d34
+         %49 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_float %49 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %48 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm
index 1b996ee..e4a00b5 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/c857d1.wgsl.expected.spvasm
@@ -53,12 +53,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %36 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_float_uint_1024 = OpTypePointer StorageBuffer %_arr_float_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+       %bool = OpTypeBool
+    %float_0 = OpConstant %float 0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_c857d1 = OpFunction %15 None %19
          %20 = OpLabel
@@ -86,24 +86,24 @@
                OpLoopMerge %42 %40 None
                OpBranch %39
          %39 = OpLabel
-         %45 = OpUGreaterThanEqual %bool %43 %uint_64
-               OpSelectionMerge %47 None
-               OpBranchConditional %45 %48 %47
-         %48 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %43 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %42
-         %47 = OpLabel
-         %49 = OpAccessChain %_ptr_Workgroup_float %arg_0 %43
-               OpStore %49 %float_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_float %arg_0 %43
+               OpStore %58 %float_0 NonPrivatePointer
                OpBranch %40
          %40 = OpLabel
          %44 = OpIAdd %uint %43 %uint_1
                OpBranch %41
          %42 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %53 = OpFunctionCall %15 %subgroupMatrixLoad_c857d1
-         %54 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_float %54 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %53 %uint_0 %uint_64 NonPrivatePointer
+         %47 = OpFunctionCall %15 %subgroupMatrixLoad_c857d1
+         %48 = OpAccessChain %_ptr_StorageBuffer__arr_float_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_float %48 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %47 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm
index a119204..911a1e1 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/ea84a8.wgsl.expected.spvasm
@@ -52,13 +52,13 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %35 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_int_uint_1024 = OpTypePointer StorageBuffer %_arr_int_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+       %bool = OpTypeBool
+      %int_0 = OpConstant %int 0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_ea84a8 = OpFunction %15 None %19
          %20 = OpLabel
@@ -86,24 +86,24 @@
                OpLoopMerge %41 %39 None
                OpBranch %38
          %38 = OpLabel
-         %44 = OpUGreaterThanEqual %bool %42 %uint_64
-               OpSelectionMerge %46 None
-               OpBranchConditional %44 %47 %46
-         %47 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %42 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %41
-         %46 = OpLabel
-         %48 = OpAccessChain %_ptr_Workgroup_int %arg_0 %42
-               OpStore %48 %int_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_int %arg_0 %42
+               OpStore %58 %int_0 NonPrivatePointer
                OpBranch %39
          %39 = OpLabel
          %43 = OpIAdd %uint %42 %uint_1
                OpBranch %40
          %41 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %53 = OpFunctionCall %15 %subgroupMatrixLoad_ea84a8
-         %54 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_int %54 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %53 %uint_0 %uint_64 NonPrivatePointer
+         %47 = OpFunctionCall %15 %subgroupMatrixLoad_ea84a8
+         %48 = OpAccessChain %_ptr_StorageBuffer__arr_int_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_int %48 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %47 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm
index 87a0424..7c0c83e 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/f695fe.wgsl.expected.spvasm
@@ -52,11 +52,11 @@
 %_ptr_Function_14 = OpTypePointer Function %14
        %void = OpTypeVoid
          %35 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_uint_uint_1024 = OpTypePointer StorageBuffer %_arr_uint_uint_1024
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+       %bool = OpTypeBool
          %59 = OpTypeFunction %void
 %subgroupMatrixLoad_f695fe = OpFunction %14 None %18
          %19 = OpLabel
@@ -84,24 +84,24 @@
                OpLoopMerge %41 %39 None
                OpBranch %38
          %38 = OpLabel
-         %44 = OpUGreaterThanEqual %bool %42 %uint_64
-               OpSelectionMerge %46 None
-               OpBranchConditional %44 %47 %46
-         %47 = OpLabel
+         %53 = OpUGreaterThanEqual %bool %42 %uint_64
+               OpSelectionMerge %55 None
+               OpBranchConditional %53 %56 %55
+         %56 = OpLabel
                OpBranch %41
-         %46 = OpLabel
-         %48 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %42
-               OpStore %48 %uint_0 NonPrivatePointer
+         %55 = OpLabel
+         %57 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %42
+               OpStore %57 %uint_0 NonPrivatePointer
                OpBranch %39
          %39 = OpLabel
          %43 = OpIAdd %uint %42 %uint_1
                OpBranch %40
          %41 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %52 = OpFunctionCall %14 %subgroupMatrixLoad_f695fe
-         %53 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
-         %55 = OpAccessChain %_ptr_StorageBuffer_uint %53 %uint_0
-               OpCooperativeMatrixStoreKHR %55 %52 %uint_0 %uint_64 NonPrivatePointer
+         %47 = OpFunctionCall %14 %subgroupMatrixLoad_f695fe
+         %48 = OpAccessChain %_ptr_StorageBuffer__arr_uint_uint_1024 %1 %uint_0
+         %50 = OpAccessChain %_ptr_StorageBuffer_uint %48 %uint_0
+               OpCooperativeMatrixStoreKHR %50 %47 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %59
diff --git a/test/tint/builtins/gen/var/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm
index ef31d18..2375cbb 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixLoad/fd7bd9.wgsl.expected.spvasm
@@ -56,12 +56,12 @@
 %_ptr_Function_15 = OpTypePointer Function %15
        %void = OpTypeVoid
          %36 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
  %uint_24840 = OpConstant %uint 24840
 %_ptr_StorageBuffer__arr_half_uint_1024 = OpTypePointer StorageBuffer %_arr_half_uint_1024
      %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
+       %bool = OpTypeBool
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %61 = OpTypeFunction %void
 %subgroupMatrixLoad_fd7bd9 = OpFunction %15 None %19
          %20 = OpLabel
@@ -89,24 +89,24 @@
                OpLoopMerge %42 %40 None
                OpBranch %39
          %39 = OpLabel
-         %45 = OpUGreaterThanEqual %bool %43 %uint_64
-               OpSelectionMerge %47 None
-               OpBranchConditional %45 %48 %47
-         %48 = OpLabel
+         %54 = OpUGreaterThanEqual %bool %43 %uint_64
+               OpSelectionMerge %56 None
+               OpBranchConditional %54 %57 %56
+         %57 = OpLabel
                OpBranch %42
-         %47 = OpLabel
-         %49 = OpAccessChain %_ptr_Workgroup_half %arg_0 %43
-               OpStore %49 %half_0x0p_0 NonPrivatePointer
+         %56 = OpLabel
+         %58 = OpAccessChain %_ptr_Workgroup_half %arg_0 %43
+               OpStore %58 %half_0x0p_0 NonPrivatePointer
                OpBranch %40
          %40 = OpLabel
          %44 = OpIAdd %uint %43 %uint_1
                OpBranch %41
          %42 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %53 = OpFunctionCall %15 %subgroupMatrixLoad_fd7bd9
-         %54 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
-         %57 = OpAccessChain %_ptr_StorageBuffer_half %54 %uint_0
-               OpCooperativeMatrixStoreKHR %57 %53 %uint_0 %uint_64 NonPrivatePointer
+         %47 = OpFunctionCall %15 %subgroupMatrixLoad_fd7bd9
+         %48 = OpAccessChain %_ptr_StorageBuffer__arr_half_uint_1024 %1 %uint_0
+         %51 = OpAccessChain %_ptr_StorageBuffer_half %48 %uint_0
+               OpCooperativeMatrixStoreKHR %51 %47 %uint_0 %uint_64 NonPrivatePointer
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %61
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/127fb7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/127fb7.wgsl.expected.spvasm
index e2def42..1e23cea 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/127fb7.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/127fb7.wgsl.expected.spvasm
@@ -46,8 +46,8 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
          %33 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_127fb7 = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -74,21 +74,21 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_64
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %45 = OpUGreaterThanEqual %bool %40 %uint_64
+               OpSelectionMerge %47 None
+               OpBranchConditional %45 %48 %47
+         %48 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Workgroup_half %arg_0 %40
-               OpStore %46 %half_0x0p_0 NonPrivatePointer
+         %47 = OpLabel
+         %49 = OpAccessChain %_ptr_Workgroup_half %arg_0 %40
+               OpStore %49 %half_0x0p_0 NonPrivatePointer
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %void %subgroupMatrixStore_127fb7
+         %44 = OpFunctionCall %void %subgroupMatrixStore_127fb7
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm
index 92ad0d3..a3a8903 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/2de0b1.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
 %_ptr_Function_16 = OpTypePointer Function %16
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_2de0b1 = OpFunction %void None %10
          %11 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -70,21 +70,21 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %44 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %46 None
+               OpBranchConditional %44 %47 %46
+         %47 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %38
-               OpStore %44 %uint_0 NonPrivatePointer
+         %46 = OpLabel
+         %48 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %38
+               OpStore %48 %uint_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %void %subgroupMatrixStore_2de0b1
+         %43 = OpFunctionCall %void %subgroupMatrixStore_2de0b1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %10
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/49b25b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/49b25b.wgsl.expected.spvasm
index aea19f8..465e469 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/49b25b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/49b25b.wgsl.expected.spvasm
@@ -42,9 +42,9 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
          %32 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_49b25b = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -71,21 +71,21 @@
                OpLoopMerge %38 %36 None
                OpBranch %35
          %35 = OpLabel
-         %41 = OpUGreaterThanEqual %bool %39 %uint_64
-               OpSelectionMerge %43 None
-               OpBranchConditional %41 %44 %43
-         %44 = OpLabel
+         %45 = OpUGreaterThanEqual %bool %39 %uint_64
+               OpSelectionMerge %47 None
+               OpBranchConditional %45 %48 %47
+         %48 = OpLabel
                OpBranch %38
-         %43 = OpLabel
-         %45 = OpAccessChain %_ptr_Workgroup_float %arg_0 %39
-               OpStore %45 %float_0 NonPrivatePointer
+         %47 = OpLabel
+         %49 = OpAccessChain %_ptr_Workgroup_float %arg_0 %39
+               OpStore %49 %float_0 NonPrivatePointer
                OpBranch %36
          %36 = OpLabel
          %40 = OpIAdd %uint %39 %uint_1
                OpBranch %37
          %38 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %void %subgroupMatrixStore_49b25b
+         %44 = OpFunctionCall %void %subgroupMatrixStore_49b25b
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/5671e2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/5671e2.wgsl.expected.spvasm
index 856baf9..ea64702 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/5671e2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/5671e2.wgsl.expected.spvasm
@@ -42,9 +42,9 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
          %32 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_5671e2 = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -71,21 +71,21 @@
                OpLoopMerge %38 %36 None
                OpBranch %35
          %35 = OpLabel
-         %41 = OpUGreaterThanEqual %bool %39 %uint_64
-               OpSelectionMerge %43 None
-               OpBranchConditional %41 %44 %43
-         %44 = OpLabel
+         %45 = OpUGreaterThanEqual %bool %39 %uint_64
+               OpSelectionMerge %47 None
+               OpBranchConditional %45 %48 %47
+         %48 = OpLabel
                OpBranch %38
-         %43 = OpLabel
-         %45 = OpAccessChain %_ptr_Workgroup_int %arg_0 %39
-               OpStore %45 %int_0 NonPrivatePointer
+         %47 = OpLabel
+         %49 = OpAccessChain %_ptr_Workgroup_int %arg_0 %39
+               OpStore %49 %int_0 NonPrivatePointer
                OpBranch %36
          %36 = OpLabel
          %40 = OpIAdd %uint %39 %uint_1
                OpBranch %37
          %38 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %void %subgroupMatrixStore_5671e2
+         %44 = OpFunctionCall %void %subgroupMatrixStore_5671e2
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/5915fe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/5915fe.wgsl.expected.spvasm
index daf6c7e..d3eb209 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/5915fe.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/5915fe.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
 %_ptr_Function_16 = OpTypePointer Function %16
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
          %31 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_5915fe = OpFunction %void None %10
          %11 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -70,21 +70,21 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_64
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %44 = OpUGreaterThanEqual %bool %38 %uint_64
+               OpSelectionMerge %46 None
+               OpBranchConditional %44 %47 %46
+         %47 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %38
-               OpStore %44 %uint_0 NonPrivatePointer
+         %46 = OpLabel
+         %48 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %38
+               OpStore %48 %uint_0 NonPrivatePointer
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %void %subgroupMatrixStore_5915fe
+         %43 = OpFunctionCall %void %subgroupMatrixStore_5915fe
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %10
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm
index 9d62273..4f85de2 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/9a7d60.wgsl.expected.spvasm
@@ -42,8 +42,8 @@
 %_ptr_Function_16 = OpTypePointer Function %16
 %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint
          %32 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_9a7d60 = OpFunction %void None %10
          %11 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -70,21 +70,21 @@
                OpLoopMerge %38 %36 None
                OpBranch %35
          %35 = OpLabel
-         %41 = OpUGreaterThanEqual %bool %39 %uint_64
-               OpSelectionMerge %43 None
-               OpBranchConditional %41 %44 %43
-         %44 = OpLabel
+         %44 = OpUGreaterThanEqual %bool %39 %uint_64
+               OpSelectionMerge %46 None
+               OpBranchConditional %44 %47 %46
+         %47 = OpLabel
                OpBranch %38
-         %43 = OpLabel
-         %45 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %39
-               OpStore %45 %uint_0 NonPrivatePointer
+         %46 = OpLabel
+         %48 = OpAccessChain %_ptr_Workgroup_uint %arg_0 %39
+               OpStore %48 %uint_0 NonPrivatePointer
                OpBranch %36
          %36 = OpLabel
          %40 = OpIAdd %uint %39 %uint_1
                OpBranch %37
          %38 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %48 = OpFunctionCall %void %subgroupMatrixStore_9a7d60
+         %43 = OpFunctionCall %void %subgroupMatrixStore_9a7d60
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %10
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm
index f7e911a..7d163ca 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/b9ff25.wgsl.expected.spvasm
@@ -43,8 +43,8 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
          %33 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_b9ff25 = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -71,21 +71,21 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_64
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %45 = OpUGreaterThanEqual %bool %40 %uint_64
+               OpSelectionMerge %47 None
+               OpBranchConditional %45 %48 %47
+         %48 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Workgroup_float %arg_0 %40
-               OpStore %46 %float_0 NonPrivatePointer
+         %47 = OpLabel
+         %49 = OpAccessChain %_ptr_Workgroup_float %arg_0 %40
+               OpStore %49 %float_0 NonPrivatePointer
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %void %subgroupMatrixStore_b9ff25
+         %44 = OpFunctionCall %void %subgroupMatrixStore_b9ff25
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm
index cdabd74..958a898 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/bfd0a4.wgsl.expected.spvasm
@@ -43,9 +43,9 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
          %33 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_bfd0a4 = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -72,21 +72,21 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_64
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %46 = OpUGreaterThanEqual %bool %40 %uint_64
+               OpSelectionMerge %48 None
+               OpBranchConditional %46 %49 %48
+         %49 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Workgroup_int %arg_0 %40
-               OpStore %46 %int_0 NonPrivatePointer
+         %48 = OpLabel
+         %50 = OpAccessChain %_ptr_Workgroup_int %arg_0 %40
+               OpStore %50 %int_0 NonPrivatePointer
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %50 = OpFunctionCall %void %subgroupMatrixStore_bfd0a4
+         %45 = OpFunctionCall %void %subgroupMatrixStore_bfd0a4
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/d07581.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/d07581.wgsl.expected.spvasm
index 7996d8c..e35f13a 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/d07581.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/d07581.wgsl.expected.spvasm
@@ -45,9 +45,9 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
          %32 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_d07581 = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -74,21 +74,21 @@
                OpLoopMerge %38 %36 None
                OpBranch %35
          %35 = OpLabel
-         %41 = OpUGreaterThanEqual %bool %39 %uint_64
-               OpSelectionMerge %43 None
-               OpBranchConditional %41 %44 %43
-         %44 = OpLabel
+         %45 = OpUGreaterThanEqual %bool %39 %uint_64
+               OpSelectionMerge %47 None
+               OpBranchConditional %45 %48 %47
+         %48 = OpLabel
                OpBranch %38
-         %43 = OpLabel
-         %45 = OpAccessChain %_ptr_Workgroup_half %arg_0 %39
-               OpStore %45 %half_0x0p_0 NonPrivatePointer
+         %47 = OpLabel
+         %49 = OpAccessChain %_ptr_Workgroup_half %arg_0 %39
+               OpStore %49 %half_0x0p_0 NonPrivatePointer
                OpBranch %36
          %36 = OpLabel
          %40 = OpIAdd %uint %39 %uint_1
                OpBranch %37
          %38 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %void %subgroupMatrixStore_d07581
+         %44 = OpFunctionCall %void %subgroupMatrixStore_d07581
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm
index 31b8428..45623ae 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/dc92cf.wgsl.expected.spvasm
@@ -43,9 +43,9 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
          %33 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_dc92cf = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -72,21 +72,21 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_64
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %46 = OpUGreaterThanEqual %bool %40 %uint_64
+               OpSelectionMerge %48 None
+               OpBranchConditional %46 %49 %48
+         %49 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Workgroup_float %arg_0 %40
-               OpStore %46 %float_0 NonPrivatePointer
+         %48 = OpLabel
+         %50 = OpAccessChain %_ptr_Workgroup_float %arg_0 %40
+               OpStore %50 %float_0 NonPrivatePointer
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %50 = OpFunctionCall %void %subgroupMatrixStore_dc92cf
+         %45 = OpFunctionCall %void %subgroupMatrixStore_dc92cf
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/ee1195.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/ee1195.wgsl.expected.spvasm
index d3254ce..4623fcc 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/ee1195.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/ee1195.wgsl.expected.spvasm
@@ -46,9 +46,9 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_half = OpTypePointer Workgroup %half
          %33 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_ee1195 = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -75,21 +75,21 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_64
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %46 = OpUGreaterThanEqual %bool %40 %uint_64
+               OpSelectionMerge %48 None
+               OpBranchConditional %46 %49 %48
+         %49 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Workgroup_half %arg_0 %40
-               OpStore %46 %half_0x0p_0 NonPrivatePointer
+         %48 = OpLabel
+         %50 = OpAccessChain %_ptr_Workgroup_half %arg_0 %40
+               OpStore %50 %half_0x0p_0 NonPrivatePointer
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %50 = OpFunctionCall %void %subgroupMatrixStore_ee1195
+         %45 = OpFunctionCall %void %subgroupMatrixStore_ee1195
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/subgroupMatrixStore/f04d67.wgsl.expected.spvasm b/test/tint/builtins/gen/var/subgroupMatrixStore/f04d67.wgsl.expected.spvasm
index 6d9c265..0136b94 100644
--- a/test/tint/builtins/gen/var/subgroupMatrixStore/f04d67.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/subgroupMatrixStore/f04d67.wgsl.expected.spvasm
@@ -43,8 +43,8 @@
 %_ptr_Function_17 = OpTypePointer Function %17
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
          %33 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
  %uint_24840 = OpConstant %uint 24840
+       %bool = OpTypeBool
 %subgroupMatrixStore_f04d67 = OpFunction %void None %11
          %12 = OpLabel
       %arg_1 = OpVariable %_ptr_Function_uint Function
@@ -71,21 +71,21 @@
                OpLoopMerge %39 %37 None
                OpBranch %36
          %36 = OpLabel
-         %42 = OpUGreaterThanEqual %bool %40 %uint_64
-               OpSelectionMerge %44 None
-               OpBranchConditional %42 %45 %44
-         %45 = OpLabel
+         %45 = OpUGreaterThanEqual %bool %40 %uint_64
+               OpSelectionMerge %47 None
+               OpBranchConditional %45 %48 %47
+         %48 = OpLabel
                OpBranch %39
-         %44 = OpLabel
-         %46 = OpAccessChain %_ptr_Workgroup_int %arg_0 %40
-               OpStore %46 %int_0 NonPrivatePointer
+         %47 = OpLabel
+         %49 = OpAccessChain %_ptr_Workgroup_int %arg_0 %40
+               OpStore %49 %int_0 NonPrivatePointer
                OpBranch %37
          %37 = OpLabel
          %41 = OpIAdd %uint %40 %uint_1
                OpBranch %38
          %39 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_24840
-         %49 = OpFunctionCall %void %subgroupMatrixStore_f04d67
+         %44 = OpFunctionCall %void %subgroupMatrixStore_f04d67
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %11
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
index d6e8b76..b74ac48 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.spvasm
@@ -207,40 +207,40 @@
                OpSelectionMerge %77 None
                OpBranchConditional %75 %78 %79
          %78 = OpLabel
-         %80 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
-         %81 = OpVectorShuffle %v3float %80 %80 0 1 2
-         %82 = OpCompositeExtract %float %80 3
+         %92 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
+         %81 = OpVectorShuffle %v3float %92 %92 0 1 2
+         %84 = OpCompositeExtract %float %92 3
                OpBranch %77
          %79 = OpLabel
-         %83 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
-         %84 = OpCompositeExtract %float %83 0
-         %85 = OpFMul %v2float %72 %66
-         %86 = OpConvertFToU %v2uint %85
-         %87 = OpImageFetch %v4float %plane_1 %86 Lod %uint_0
-         %88 = OpVectorShuffle %v2float %87 %87 0 1
-         %89 = OpCompositeConstruct %v4float %84 %88 %float_1
-         %90 = OpVectorTimesMatrix %v3float %89 %63
+         %93 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
+         %94 = OpCompositeExtract %float %93 0
+         %95 = OpFMul %v2float %72 %66
+         %96 = OpConvertFToU %v2uint %95
+         %97 = OpImageFetch %v4float %plane_1 %96 Lod %uint_0
+         %98 = OpVectorShuffle %v2float %97 %97 0 1
+         %99 = OpCompositeConstruct %v4float %94 %98 %float_1
+         %82 = OpVectorTimesMatrix %v3float %99 %63
                OpBranch %77
          %77 = OpLabel
-         %91 = OpPhi %v3float %81 %78 %90 %79
-         %92 = OpPhi %float %82 %78 %float_1 %79
-         %93 = OpIEqual %bool %62 %uint_0
-               OpSelectionMerge %94 None
-               OpBranchConditional %93 %95 %96
-         %95 = OpLabel
-         %97 = OpCompositeExtract %tint_GammaTransferParams %params 3
-         %98 = OpCompositeExtract %tint_GammaTransferParams %params 4
-         %99 = OpCompositeExtract %mat3v3float %params 5
-        %100 = OpFunctionCall %v3float %tint_GammaCorrection %91 %97
-        %102 = OpMatrixTimesVector %v3float %99 %100
-        %103 = OpFunctionCall %v3float %tint_GammaCorrection %102 %98
-               OpBranch %94
-         %96 = OpLabel
-               OpBranch %94
-         %94 = OpLabel
-        %104 = OpPhi %v3float %103 %95 %91 %96
-        %105 = OpCompositeConstruct %v4float %104 %92
-               OpReturnValue %105
+         %80 = OpPhi %v3float %81 %78 %82 %79
+         %83 = OpPhi %float %84 %78 %float_1 %79
+         %85 = OpIEqual %bool %62 %uint_0
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %88
+         %87 = OpLabel
+        %100 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %101 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %102 = OpCompositeExtract %mat3v3float %params 5
+        %103 = OpFunctionCall %v3float %tint_GammaCorrection %80 %100
+        %105 = OpMatrixTimesVector %v3float %102 %103
+         %90 = OpFunctionCall %v3float %tint_GammaCorrection %105 %101
+               OpBranch %86
+         %88 = OpLabel
+               OpBranch %86
+         %86 = OpLabel
+         %89 = OpPhi %v3float %90 %87 %80 %88
+         %91 = OpCompositeConstruct %v4float %89 %83
+               OpReturnValue %91
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %108
           %v = OpFunctionParameter %v3float
@@ -510,40 +510,40 @@
                OpSelectionMerge %77 None
                OpBranchConditional %75 %78 %79
          %78 = OpLabel
-         %80 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
-         %81 = OpVectorShuffle %v3float %80 %80 0 1 2
-         %82 = OpCompositeExtract %float %80 3
+         %92 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
+         %81 = OpVectorShuffle %v3float %92 %92 0 1 2
+         %84 = OpCompositeExtract %float %92 3
                OpBranch %77
          %79 = OpLabel
-         %83 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
-         %84 = OpCompositeExtract %float %83 0
-         %85 = OpFMul %v2float %72 %66
-         %86 = OpConvertFToU %v2uint %85
-         %87 = OpImageFetch %v4float %plane_1 %86 Lod %uint_0
-         %88 = OpVectorShuffle %v2float %87 %87 0 1
-         %89 = OpCompositeConstruct %v4float %84 %88 %float_1
-         %90 = OpVectorTimesMatrix %v3float %89 %63
+         %93 = OpImageFetch %v4float %plane_0 %73 Lod %uint_0
+         %94 = OpCompositeExtract %float %93 0
+         %95 = OpFMul %v2float %72 %66
+         %96 = OpConvertFToU %v2uint %95
+         %97 = OpImageFetch %v4float %plane_1 %96 Lod %uint_0
+         %98 = OpVectorShuffle %v2float %97 %97 0 1
+         %99 = OpCompositeConstruct %v4float %94 %98 %float_1
+         %82 = OpVectorTimesMatrix %v3float %99 %63
                OpBranch %77
          %77 = OpLabel
-         %91 = OpPhi %v3float %81 %78 %90 %79
-         %92 = OpPhi %float %82 %78 %float_1 %79
-         %93 = OpIEqual %bool %62 %uint_0
-               OpSelectionMerge %94 None
-               OpBranchConditional %93 %95 %96
-         %95 = OpLabel
-         %97 = OpCompositeExtract %tint_GammaTransferParams %params 3
-         %98 = OpCompositeExtract %tint_GammaTransferParams %params 4
-         %99 = OpCompositeExtract %mat3v3float %params 5
-        %100 = OpFunctionCall %v3float %tint_GammaCorrection %91 %97
-        %102 = OpMatrixTimesVector %v3float %99 %100
-        %103 = OpFunctionCall %v3float %tint_GammaCorrection %102 %98
-               OpBranch %94
-         %96 = OpLabel
-               OpBranch %94
-         %94 = OpLabel
-        %104 = OpPhi %v3float %103 %95 %91 %96
-        %105 = OpCompositeConstruct %v4float %104 %92
-               OpReturnValue %105
+         %80 = OpPhi %v3float %81 %78 %82 %79
+         %83 = OpPhi %float %84 %78 %float_1 %79
+         %85 = OpIEqual %bool %62 %uint_0
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %88
+         %87 = OpLabel
+        %100 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %101 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %102 = OpCompositeExtract %mat3v3float %params 5
+        %103 = OpFunctionCall %v3float %tint_GammaCorrection %80 %100
+        %105 = OpMatrixTimesVector %v3float %102 %103
+         %90 = OpFunctionCall %v3float %tint_GammaCorrection %105 %101
+               OpBranch %86
+         %88 = OpLabel
+               OpBranch %86
+         %86 = OpLabel
+         %89 = OpPhi %v3float %90 %87 %80 %88
+         %91 = OpCompositeConstruct %v4float %89 %83
+               OpReturnValue %91
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %108
           %v = OpFunctionParameter %v3float
@@ -827,40 +827,40 @@
                OpSelectionMerge %84 None
                OpBranchConditional %82 %85 %86
          %85 = OpLabel
-         %87 = OpImageFetch %v4float %plane_0 %80 Lod %uint_0
-         %88 = OpVectorShuffle %v3float %87 %87 0 1 2
-         %89 = OpCompositeExtract %float %87 3
+         %99 = OpImageFetch %v4float %plane_0 %80 Lod %uint_0
+         %88 = OpVectorShuffle %v3float %99 %99 0 1 2
+         %91 = OpCompositeExtract %float %99 3
                OpBranch %84
          %86 = OpLabel
-         %90 = OpImageFetch %v4float %plane_0 %80 Lod %uint_0
-         %91 = OpCompositeExtract %float %90 0
-         %92 = OpFMul %v2float %79 %73
-         %93 = OpConvertFToU %v2uint %92
-         %94 = OpImageFetch %v4float %plane_1 %93 Lod %uint_0
-         %95 = OpVectorShuffle %v2float %94 %94 0 1
-         %96 = OpCompositeConstruct %v4float %91 %95 %float_1
-         %97 = OpVectorTimesMatrix %v3float %96 %70
+        %100 = OpImageFetch %v4float %plane_0 %80 Lod %uint_0
+        %101 = OpCompositeExtract %float %100 0
+        %102 = OpFMul %v2float %79 %73
+        %103 = OpConvertFToU %v2uint %102
+        %104 = OpImageFetch %v4float %plane_1 %103 Lod %uint_0
+        %105 = OpVectorShuffle %v2float %104 %104 0 1
+        %106 = OpCompositeConstruct %v4float %101 %105 %float_1
+         %89 = OpVectorTimesMatrix %v3float %106 %70
                OpBranch %84
          %84 = OpLabel
-         %98 = OpPhi %v3float %88 %85 %97 %86
-         %99 = OpPhi %float %89 %85 %float_1 %86
-        %100 = OpIEqual %bool %69 %uint_0
-               OpSelectionMerge %101 None
-               OpBranchConditional %100 %102 %103
-        %102 = OpLabel
-        %104 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %105 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %106 = OpCompositeExtract %mat3v3float %params 5
-        %107 = OpFunctionCall %v3float %tint_GammaCorrection %98 %104
-        %109 = OpMatrixTimesVector %v3float %106 %107
-        %110 = OpFunctionCall %v3float %tint_GammaCorrection %109 %105
-               OpBranch %101
-        %103 = OpLabel
-               OpBranch %101
-        %101 = OpLabel
-        %111 = OpPhi %v3float %110 %102 %98 %103
-        %112 = OpCompositeConstruct %v4float %111 %99
-               OpReturnValue %112
+         %87 = OpPhi %v3float %88 %85 %89 %86
+         %90 = OpPhi %float %91 %85 %float_1 %86
+         %92 = OpIEqual %bool %69 %uint_0
+               OpSelectionMerge %93 None
+               OpBranchConditional %92 %94 %95
+         %94 = OpLabel
+        %107 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %108 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %109 = OpCompositeExtract %mat3v3float %params 5
+        %110 = OpFunctionCall %v3float %tint_GammaCorrection %87 %107
+        %112 = OpMatrixTimesVector %v3float %109 %110
+         %97 = OpFunctionCall %v3float %tint_GammaCorrection %112 %108
+               OpBranch %93
+         %95 = OpLabel
+               OpBranch %93
+         %93 = OpLabel
+         %96 = OpPhi %v3float %97 %94 %87 %95
+         %98 = OpCompositeConstruct %v4float %96 %90
+               OpReturnValue %98
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %115
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
index c3f4998..ce0d5b4 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.spvasm
@@ -212,40 +212,40 @@
                OpSelectionMerge %82 None
                OpBranchConditional %80 %83 %84
          %83 = OpLabel
-         %85 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
-         %86 = OpVectorShuffle %v3float %85 %85 0 1 2
-         %87 = OpCompositeExtract %float %85 3
+         %97 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
+         %86 = OpVectorShuffle %v3float %97 %97 0 1 2
+         %89 = OpCompositeExtract %float %97 3
                OpBranch %82
          %84 = OpLabel
-         %88 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
-         %89 = OpCompositeExtract %float %88 0
-         %90 = OpFMul %v2float %77 %71
-         %91 = OpConvertFToU %v2uint %90
-         %92 = OpImageFetch %v4float %plane_1 %91 Lod %uint_0
-         %93 = OpVectorShuffle %v2float %92 %92 0 1
-         %94 = OpCompositeConstruct %v4float %89 %93 %float_1
-         %95 = OpVectorTimesMatrix %v3float %94 %68
+         %98 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
+         %99 = OpCompositeExtract %float %98 0
+        %100 = OpFMul %v2float %77 %71
+        %101 = OpConvertFToU %v2uint %100
+        %102 = OpImageFetch %v4float %plane_1 %101 Lod %uint_0
+        %103 = OpVectorShuffle %v2float %102 %102 0 1
+        %104 = OpCompositeConstruct %v4float %99 %103 %float_1
+         %87 = OpVectorTimesMatrix %v3float %104 %68
                OpBranch %82
          %82 = OpLabel
-         %96 = OpPhi %v3float %86 %83 %95 %84
-         %97 = OpPhi %float %87 %83 %float_1 %84
-         %98 = OpIEqual %bool %67 %uint_0
-               OpSelectionMerge %99 None
-               OpBranchConditional %98 %100 %101
-        %100 = OpLabel
-        %102 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %103 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %104 = OpCompositeExtract %mat3v3float %params 5
-        %105 = OpFunctionCall %v3float %tint_GammaCorrection %96 %102
-        %107 = OpMatrixTimesVector %v3float %104 %105
-        %108 = OpFunctionCall %v3float %tint_GammaCorrection %107 %103
-               OpBranch %99
-        %101 = OpLabel
-               OpBranch %99
-         %99 = OpLabel
-        %109 = OpPhi %v3float %108 %100 %96 %101
-        %110 = OpCompositeConstruct %v4float %109 %97
-               OpReturnValue %110
+         %85 = OpPhi %v3float %86 %83 %87 %84
+         %88 = OpPhi %float %89 %83 %float_1 %84
+         %90 = OpIEqual %bool %67 %uint_0
+               OpSelectionMerge %91 None
+               OpBranchConditional %90 %92 %93
+         %92 = OpLabel
+        %105 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %106 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %107 = OpCompositeExtract %mat3v3float %params 5
+        %108 = OpFunctionCall %v3float %tint_GammaCorrection %85 %105
+        %110 = OpMatrixTimesVector %v3float %107 %108
+         %95 = OpFunctionCall %v3float %tint_GammaCorrection %110 %106
+               OpBranch %91
+         %93 = OpLabel
+               OpBranch %91
+         %91 = OpLabel
+         %94 = OpPhi %v3float %95 %92 %85 %93
+         %96 = OpCompositeConstruct %v4float %94 %88
+               OpReturnValue %96
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %113
           %v = OpFunctionParameter %v3float
@@ -520,40 +520,40 @@
                OpSelectionMerge %82 None
                OpBranchConditional %80 %83 %84
          %83 = OpLabel
-         %85 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
-         %86 = OpVectorShuffle %v3float %85 %85 0 1 2
-         %87 = OpCompositeExtract %float %85 3
+         %97 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
+         %86 = OpVectorShuffle %v3float %97 %97 0 1 2
+         %89 = OpCompositeExtract %float %97 3
                OpBranch %82
          %84 = OpLabel
-         %88 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
-         %89 = OpCompositeExtract %float %88 0
-         %90 = OpFMul %v2float %77 %71
-         %91 = OpConvertFToU %v2uint %90
-         %92 = OpImageFetch %v4float %plane_1 %91 Lod %uint_0
-         %93 = OpVectorShuffle %v2float %92 %92 0 1
-         %94 = OpCompositeConstruct %v4float %89 %93 %float_1
-         %95 = OpVectorTimesMatrix %v3float %94 %68
+         %98 = OpImageFetch %v4float %plane_0 %78 Lod %uint_0
+         %99 = OpCompositeExtract %float %98 0
+        %100 = OpFMul %v2float %77 %71
+        %101 = OpConvertFToU %v2uint %100
+        %102 = OpImageFetch %v4float %plane_1 %101 Lod %uint_0
+        %103 = OpVectorShuffle %v2float %102 %102 0 1
+        %104 = OpCompositeConstruct %v4float %99 %103 %float_1
+         %87 = OpVectorTimesMatrix %v3float %104 %68
                OpBranch %82
          %82 = OpLabel
-         %96 = OpPhi %v3float %86 %83 %95 %84
-         %97 = OpPhi %float %87 %83 %float_1 %84
-         %98 = OpIEqual %bool %67 %uint_0
-               OpSelectionMerge %99 None
-               OpBranchConditional %98 %100 %101
-        %100 = OpLabel
-        %102 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %103 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %104 = OpCompositeExtract %mat3v3float %params 5
-        %105 = OpFunctionCall %v3float %tint_GammaCorrection %96 %102
-        %107 = OpMatrixTimesVector %v3float %104 %105
-        %108 = OpFunctionCall %v3float %tint_GammaCorrection %107 %103
-               OpBranch %99
-        %101 = OpLabel
-               OpBranch %99
-         %99 = OpLabel
-        %109 = OpPhi %v3float %108 %100 %96 %101
-        %110 = OpCompositeConstruct %v4float %109 %97
-               OpReturnValue %110
+         %85 = OpPhi %v3float %86 %83 %87 %84
+         %88 = OpPhi %float %89 %83 %float_1 %84
+         %90 = OpIEqual %bool %67 %uint_0
+               OpSelectionMerge %91 None
+               OpBranchConditional %90 %92 %93
+         %92 = OpLabel
+        %105 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %106 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %107 = OpCompositeExtract %mat3v3float %params 5
+        %108 = OpFunctionCall %v3float %tint_GammaCorrection %85 %105
+        %110 = OpMatrixTimesVector %v3float %107 %108
+         %95 = OpFunctionCall %v3float %tint_GammaCorrection %110 %106
+               OpBranch %91
+         %93 = OpLabel
+               OpBranch %91
+         %91 = OpLabel
+         %94 = OpPhi %v3float %95 %92 %85 %93
+         %96 = OpCompositeConstruct %v4float %94 %88
+               OpReturnValue %96
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %113
           %v = OpFunctionParameter %v3float
@@ -842,40 +842,40 @@
                OpSelectionMerge %89 None
                OpBranchConditional %87 %90 %91
          %90 = OpLabel
-         %92 = OpImageFetch %v4float %plane_0 %85 Lod %uint_0
-         %93 = OpVectorShuffle %v3float %92 %92 0 1 2
-         %94 = OpCompositeExtract %float %92 3
+        %104 = OpImageFetch %v4float %plane_0 %85 Lod %uint_0
+         %93 = OpVectorShuffle %v3float %104 %104 0 1 2
+         %96 = OpCompositeExtract %float %104 3
                OpBranch %89
          %91 = OpLabel
-         %95 = OpImageFetch %v4float %plane_0 %85 Lod %uint_0
-         %96 = OpCompositeExtract %float %95 0
-         %97 = OpFMul %v2float %84 %78
-         %98 = OpConvertFToU %v2uint %97
-         %99 = OpImageFetch %v4float %plane_1 %98 Lod %uint_0
-        %100 = OpVectorShuffle %v2float %99 %99 0 1
-        %101 = OpCompositeConstruct %v4float %96 %100 %float_1
-        %102 = OpVectorTimesMatrix %v3float %101 %75
+        %105 = OpImageFetch %v4float %plane_0 %85 Lod %uint_0
+        %106 = OpCompositeExtract %float %105 0
+        %107 = OpFMul %v2float %84 %78
+        %108 = OpConvertFToU %v2uint %107
+        %109 = OpImageFetch %v4float %plane_1 %108 Lod %uint_0
+        %110 = OpVectorShuffle %v2float %109 %109 0 1
+        %111 = OpCompositeConstruct %v4float %106 %110 %float_1
+         %94 = OpVectorTimesMatrix %v3float %111 %75
                OpBranch %89
          %89 = OpLabel
-        %103 = OpPhi %v3float %93 %90 %102 %91
-        %104 = OpPhi %float %94 %90 %float_1 %91
-        %105 = OpIEqual %bool %74 %uint_0
-               OpSelectionMerge %106 None
-               OpBranchConditional %105 %107 %108
-        %107 = OpLabel
-        %109 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %110 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %111 = OpCompositeExtract %mat3v3float %params 5
-        %112 = OpFunctionCall %v3float %tint_GammaCorrection %103 %109
-        %114 = OpMatrixTimesVector %v3float %111 %112
-        %115 = OpFunctionCall %v3float %tint_GammaCorrection %114 %110
-               OpBranch %106
-        %108 = OpLabel
-               OpBranch %106
-        %106 = OpLabel
-        %116 = OpPhi %v3float %115 %107 %103 %108
-        %117 = OpCompositeConstruct %v4float %116 %104
-               OpReturnValue %117
+         %92 = OpPhi %v3float %93 %90 %94 %91
+         %95 = OpPhi %float %96 %90 %float_1 %91
+         %97 = OpIEqual %bool %74 %uint_0
+               OpSelectionMerge %98 None
+               OpBranchConditional %97 %99 %100
+         %99 = OpLabel
+        %112 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %113 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %114 = OpCompositeExtract %mat3v3float %params 5
+        %115 = OpFunctionCall %v3float %tint_GammaCorrection %92 %112
+        %117 = OpMatrixTimesVector %v3float %114 %115
+        %102 = OpFunctionCall %v3float %tint_GammaCorrection %117 %113
+               OpBranch %98
+        %100 = OpLabel
+               OpBranch %98
+         %98 = OpLabel
+        %101 = OpPhi %v3float %102 %99 %92 %100
+        %103 = OpCompositeConstruct %v4float %101 %95
+               OpReturnValue %103
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %120
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
index 46f4e57..7a0f205 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -162,7 +162,7 @@
          %60 = OpTypeFunction %v4float %8 %8 %tint_ExternalTextureParams %22 %v2float
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %81 = OpTypeSampledImage %8
+         %93 = OpTypeSampledImage %8
     %float_0 = OpConstant %float 0
         %112 = OpTypeFunction %v3float %v3float %tint_GammaTransferParams
      %v3bool = OpTypeVector %bool 3
@@ -213,42 +213,42 @@
                OpSelectionMerge %77 None
                OpBranchConditional %74 %78 %79
          %78 = OpLabel
-         %80 = OpSampledImage %81 %plane_0 %tint_sampler
-         %82 = OpImageSampleExplicitLod %v4float %80 %71 Lod %float_0
-         %84 = OpVectorShuffle %v3float %82 %82 0 1 2
-         %85 = OpCompositeExtract %float %82 3
+         %92 = OpSampledImage %93 %plane_0 %tint_sampler
+         %94 = OpImageSampleExplicitLod %v4float %92 %71 Lod %float_0
+         %81 = OpVectorShuffle %v3float %94 %94 0 1 2
+         %84 = OpCompositeExtract %float %94 3
                OpBranch %77
          %79 = OpLabel
-         %86 = OpSampledImage %81 %plane_0 %tint_sampler
-         %87 = OpImageSampleExplicitLod %v4float %86 %71 Lod %float_0
-         %88 = OpCompositeExtract %float %87 0
-         %89 = OpExtInst %v2float %72 NClamp %70 %67 %68
-         %90 = OpSampledImage %81 %plane_1 %tint_sampler
-         %91 = OpImageSampleExplicitLod %v4float %90 %89 Lod %float_0
-         %92 = OpVectorShuffle %v2float %91 %91 0 1
-         %93 = OpCompositeConstruct %v4float %88 %92 %float_1
-         %94 = OpVectorTimesMatrix %v3float %93 %63
+         %96 = OpSampledImage %93 %plane_0 %tint_sampler
+         %97 = OpImageSampleExplicitLod %v4float %96 %71 Lod %float_0
+         %98 = OpCompositeExtract %float %97 0
+         %99 = OpExtInst %v2float %72 NClamp %70 %67 %68
+        %100 = OpSampledImage %93 %plane_1 %tint_sampler
+        %101 = OpImageSampleExplicitLod %v4float %100 %99 Lod %float_0
+        %102 = OpVectorShuffle %v2float %101 %101 0 1
+        %103 = OpCompositeConstruct %v4float %98 %102 %float_1
+         %82 = OpVectorTimesMatrix %v3float %103 %63
                OpBranch %77
          %77 = OpLabel
-         %95 = OpPhi %v3float %84 %78 %94 %79
-         %96 = OpPhi %float %85 %78 %float_1 %79
-         %97 = OpIEqual %bool %62 %uint_0
-               OpSelectionMerge %98 None
-               OpBranchConditional %97 %99 %100
-         %99 = OpLabel
-        %101 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %102 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %103 = OpCompositeExtract %mat3v3float %params 5
-        %104 = OpFunctionCall %v3float %tint_GammaCorrection %95 %101
-        %106 = OpMatrixTimesVector %v3float %103 %104
-        %107 = OpFunctionCall %v3float %tint_GammaCorrection %106 %102
-               OpBranch %98
-        %100 = OpLabel
-               OpBranch %98
-         %98 = OpLabel
-        %108 = OpPhi %v3float %107 %99 %95 %100
-        %109 = OpCompositeConstruct %v4float %108 %96
-               OpReturnValue %109
+         %80 = OpPhi %v3float %81 %78 %82 %79
+         %83 = OpPhi %float %84 %78 %float_1 %79
+         %85 = OpIEqual %bool %62 %uint_0
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %88
+         %87 = OpLabel
+        %104 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %105 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %106 = OpCompositeExtract %mat3v3float %params 5
+        %107 = OpFunctionCall %v3float %tint_GammaCorrection %80 %104
+        %109 = OpMatrixTimesVector %v3float %106 %107
+         %90 = OpFunctionCall %v3float %tint_GammaCorrection %109 %105
+               OpBranch %86
+         %88 = OpLabel
+               OpBranch %86
+         %86 = OpLabel
+         %89 = OpPhi %v3float %90 %87 %80 %88
+         %91 = OpCompositeConstruct %v4float %89 %83
+               OpReturnValue %91
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %112
           %v = OpFunctionParameter %v3float
@@ -473,7 +473,7 @@
          %60 = OpTypeFunction %v4float %8 %8 %tint_ExternalTextureParams %22 %v2float
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %81 = OpTypeSampledImage %8
+         %93 = OpTypeSampledImage %8
     %float_0 = OpConstant %float 0
         %112 = OpTypeFunction %v3float %v3float %tint_GammaTransferParams
      %v3bool = OpTypeVector %bool 3
@@ -524,42 +524,42 @@
                OpSelectionMerge %77 None
                OpBranchConditional %74 %78 %79
          %78 = OpLabel
-         %80 = OpSampledImage %81 %plane_0 %tint_sampler
-         %82 = OpImageSampleExplicitLod %v4float %80 %71 Lod %float_0
-         %84 = OpVectorShuffle %v3float %82 %82 0 1 2
-         %85 = OpCompositeExtract %float %82 3
+         %92 = OpSampledImage %93 %plane_0 %tint_sampler
+         %94 = OpImageSampleExplicitLod %v4float %92 %71 Lod %float_0
+         %81 = OpVectorShuffle %v3float %94 %94 0 1 2
+         %84 = OpCompositeExtract %float %94 3
                OpBranch %77
          %79 = OpLabel
-         %86 = OpSampledImage %81 %plane_0 %tint_sampler
-         %87 = OpImageSampleExplicitLod %v4float %86 %71 Lod %float_0
-         %88 = OpCompositeExtract %float %87 0
-         %89 = OpExtInst %v2float %72 NClamp %70 %67 %68
-         %90 = OpSampledImage %81 %plane_1 %tint_sampler
-         %91 = OpImageSampleExplicitLod %v4float %90 %89 Lod %float_0
-         %92 = OpVectorShuffle %v2float %91 %91 0 1
-         %93 = OpCompositeConstruct %v4float %88 %92 %float_1
-         %94 = OpVectorTimesMatrix %v3float %93 %63
+         %96 = OpSampledImage %93 %plane_0 %tint_sampler
+         %97 = OpImageSampleExplicitLod %v4float %96 %71 Lod %float_0
+         %98 = OpCompositeExtract %float %97 0
+         %99 = OpExtInst %v2float %72 NClamp %70 %67 %68
+        %100 = OpSampledImage %93 %plane_1 %tint_sampler
+        %101 = OpImageSampleExplicitLod %v4float %100 %99 Lod %float_0
+        %102 = OpVectorShuffle %v2float %101 %101 0 1
+        %103 = OpCompositeConstruct %v4float %98 %102 %float_1
+         %82 = OpVectorTimesMatrix %v3float %103 %63
                OpBranch %77
          %77 = OpLabel
-         %95 = OpPhi %v3float %84 %78 %94 %79
-         %96 = OpPhi %float %85 %78 %float_1 %79
-         %97 = OpIEqual %bool %62 %uint_0
-               OpSelectionMerge %98 None
-               OpBranchConditional %97 %99 %100
-         %99 = OpLabel
-        %101 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %102 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %103 = OpCompositeExtract %mat3v3float %params 5
-        %104 = OpFunctionCall %v3float %tint_GammaCorrection %95 %101
-        %106 = OpMatrixTimesVector %v3float %103 %104
-        %107 = OpFunctionCall %v3float %tint_GammaCorrection %106 %102
-               OpBranch %98
-        %100 = OpLabel
-               OpBranch %98
-         %98 = OpLabel
-        %108 = OpPhi %v3float %107 %99 %95 %100
-        %109 = OpCompositeConstruct %v4float %108 %96
-               OpReturnValue %109
+         %80 = OpPhi %v3float %81 %78 %82 %79
+         %83 = OpPhi %float %84 %78 %float_1 %79
+         %85 = OpIEqual %bool %62 %uint_0
+               OpSelectionMerge %86 None
+               OpBranchConditional %85 %87 %88
+         %87 = OpLabel
+        %104 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %105 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %106 = OpCompositeExtract %mat3v3float %params 5
+        %107 = OpFunctionCall %v3float %tint_GammaCorrection %80 %104
+        %109 = OpMatrixTimesVector %v3float %106 %107
+         %90 = OpFunctionCall %v3float %tint_GammaCorrection %109 %105
+               OpBranch %86
+         %88 = OpLabel
+               OpBranch %86
+         %86 = OpLabel
+         %89 = OpPhi %v3float %90 %87 %80 %88
+         %91 = OpCompositeConstruct %v4float %89 %83
+               OpReturnValue %91
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %112
           %v = OpFunctionParameter %v3float
@@ -792,7 +792,7 @@
      %uint_1 = OpConstant %uint 1
          %68 = OpTypeFunction %v4float %3 %3 %tint_ExternalTextureParams %19 %v2float
        %bool = OpTypeBool
-         %88 = OpTypeSampledImage %3
+        %100 = OpTypeSampledImage %3
     %float_0 = OpConstant %float 0
         %119 = OpTypeFunction %v3float %v3float %tint_GammaTransferParams
      %v3bool = OpTypeVector %bool 3
@@ -849,42 +849,42 @@
                OpSelectionMerge %84 None
                OpBranchConditional %82 %85 %86
          %85 = OpLabel
-         %87 = OpSampledImage %88 %plane_0 %tint_sampler
-         %89 = OpImageSampleExplicitLod %v4float %87 %79 Lod %float_0
-         %91 = OpVectorShuffle %v3float %89 %89 0 1 2
-         %92 = OpCompositeExtract %float %89 3
+         %99 = OpSampledImage %100 %plane_0 %tint_sampler
+        %101 = OpImageSampleExplicitLod %v4float %99 %79 Lod %float_0
+         %88 = OpVectorShuffle %v3float %101 %101 0 1 2
+         %91 = OpCompositeExtract %float %101 3
                OpBranch %84
          %86 = OpLabel
-         %93 = OpSampledImage %88 %plane_0 %tint_sampler
-         %94 = OpImageSampleExplicitLod %v4float %93 %79 Lod %float_0
-         %95 = OpCompositeExtract %float %94 0
-         %96 = OpExtInst %v2float %80 NClamp %78 %75 %76
-         %97 = OpSampledImage %88 %plane_1 %tint_sampler
-         %98 = OpImageSampleExplicitLod %v4float %97 %96 Lod %float_0
-         %99 = OpVectorShuffle %v2float %98 %98 0 1
-        %100 = OpCompositeConstruct %v4float %95 %99 %float_1
-        %101 = OpVectorTimesMatrix %v3float %100 %71
+        %103 = OpSampledImage %100 %plane_0 %tint_sampler
+        %104 = OpImageSampleExplicitLod %v4float %103 %79 Lod %float_0
+        %105 = OpCompositeExtract %float %104 0
+        %106 = OpExtInst %v2float %80 NClamp %78 %75 %76
+        %107 = OpSampledImage %100 %plane_1 %tint_sampler
+        %108 = OpImageSampleExplicitLod %v4float %107 %106 Lod %float_0
+        %109 = OpVectorShuffle %v2float %108 %108 0 1
+        %110 = OpCompositeConstruct %v4float %105 %109 %float_1
+         %89 = OpVectorTimesMatrix %v3float %110 %71
                OpBranch %84
          %84 = OpLabel
-        %102 = OpPhi %v3float %91 %85 %101 %86
-        %103 = OpPhi %float %92 %85 %float_1 %86
-        %104 = OpIEqual %bool %70 %uint_0
-               OpSelectionMerge %105 None
-               OpBranchConditional %104 %106 %107
-        %106 = OpLabel
-        %108 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %109 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %110 = OpCompositeExtract %mat3v3float %params 5
-        %111 = OpFunctionCall %v3float %tint_GammaCorrection %102 %108
-        %113 = OpMatrixTimesVector %v3float %110 %111
-        %114 = OpFunctionCall %v3float %tint_GammaCorrection %113 %109
-               OpBranch %105
-        %107 = OpLabel
-               OpBranch %105
-        %105 = OpLabel
-        %115 = OpPhi %v3float %114 %106 %102 %107
-        %116 = OpCompositeConstruct %v4float %115 %103
-               OpReturnValue %116
+         %87 = OpPhi %v3float %88 %85 %89 %86
+         %90 = OpPhi %float %91 %85 %float_1 %86
+         %92 = OpIEqual %bool %70 %uint_0
+               OpSelectionMerge %93 None
+               OpBranchConditional %92 %94 %95
+         %94 = OpLabel
+        %111 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %112 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %113 = OpCompositeExtract %mat3v3float %params 5
+        %114 = OpFunctionCall %v3float %tint_GammaCorrection %87 %111
+        %116 = OpMatrixTimesVector %v3float %113 %114
+         %97 = OpFunctionCall %v3float %tint_GammaCorrection %116 %112
+               OpBranch %93
+         %95 = OpLabel
+               OpBranch %93
+         %93 = OpLabel
+         %96 = OpPhi %v3float %97 %94 %87 %95
+         %98 = OpCompositeConstruct %v4float %96 %90
+               OpReturnValue %98
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %119
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm
index 28446a3..8d1f93f 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/37307c.wgsl.expected.spvasm
@@ -38,8 +38,8 @@
          %23 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-     %uint_0 = OpConstant %uint 0
 %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+     %uint_0 = OpConstant %uint 0
          %36 = OpTypeFunction %void
 %workgroupUniformLoad_37307c = OpFunction %uint None %10
          %11 = OpLabel
@@ -62,9 +62,9 @@
                OpBranch %28
          %28 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpFunctionCall %uint %workgroupUniformLoad_37307c
-         %33 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
-               OpStore %33 %32 None
+         %31 = OpFunctionCall %uint %workgroupUniformLoad_37307c
+         %32 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0
+               OpStore %32 %31 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %36
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
index a6ae6d6..e3ebddd 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/7a857c.wgsl.expected.spvasm
@@ -39,9 +39,9 @@
          %24 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
      %uint_0 = OpConstant %uint 0
+    %float_0 = OpConstant %float 0
          %38 = OpTypeFunction %void
 %workgroupUniformLoad_7a857c = OpFunction %float None %11
          %12 = OpLabel
@@ -64,9 +64,9 @@
                OpBranch %29
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %float %workgroupUniformLoad_7a857c
-         %34 = OpAccessChain %_ptr_StorageBuffer_float %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %float %workgroupUniformLoad_7a857c
+         %33 = OpAccessChain %_ptr_StorageBuffer_float %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
index 70a60b3..e7edf27 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/9d33de.wgsl.expected.spvasm
@@ -39,9 +39,9 @@
          %24 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
      %uint_0 = OpConstant %uint 0
+      %int_0 = OpConstant %int 0
          %38 = OpTypeFunction %void
 %workgroupUniformLoad_9d33de = OpFunction %int None %11
          %12 = OpLabel
@@ -64,9 +64,9 @@
                OpBranch %29
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %int %workgroupUniformLoad_9d33de
-         %34 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %int %workgroupUniformLoad_9d33de
+         %33 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
index 1e46f83..ed4fca5 100644
--- a/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/workgroupUniformLoad/e07d08.wgsl.expected.spvasm
@@ -42,9 +42,9 @@
          %24 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-%half_0x0p_0 = OpConstant %half 0x0p+0
 %_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
      %uint_0 = OpConstant %uint 0
+%half_0x0p_0 = OpConstant %half 0x0p+0
          %38 = OpTypeFunction %void
 %workgroupUniformLoad_e07d08 = OpFunction %half None %11
          %12 = OpLabel
@@ -67,9 +67,9 @@
                OpBranch %29
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %33 = OpFunctionCall %half %workgroupUniformLoad_e07d08
-         %34 = OpAccessChain %_ptr_StorageBuffer_half %1 %uint_0
-               OpStore %34 %33 None
+         %32 = OpFunctionCall %half %workgroupUniformLoad_e07d08
+         %33 = OpAccessChain %_ptr_StorageBuffer_half %1 %uint_0
+               OpStore %33 %32 None
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %38
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm
index 752e34c..a1ffce7 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.spvasm
@@ -216,40 +216,40 @@
                OpSelectionMerge %85 None
                OpBranchConditional %83 %86 %87
          %86 = OpLabel
-         %88 = OpImageFetch %v4float %plane_0 %81 Lod %uint_0
-         %89 = OpVectorShuffle %v3float %88 %88 0 1 2
-         %90 = OpCompositeExtract %float %88 3
+        %100 = OpImageFetch %v4float %plane_0 %81 Lod %uint_0
+         %89 = OpVectorShuffle %v3float %100 %100 0 1 2
+         %92 = OpCompositeExtract %float %100 3
                OpBranch %85
          %87 = OpLabel
-         %91 = OpImageFetch %v4float %plane_0 %81 Lod %uint_0
-         %92 = OpCompositeExtract %float %91 0
-         %93 = OpFMul %v2float %80 %74
-         %94 = OpConvertFToU %v2uint %93
-         %95 = OpImageFetch %v4float %plane_1 %94 Lod %uint_0
-         %96 = OpVectorShuffle %v2float %95 %95 0 1
-         %97 = OpCompositeConstruct %v4float %92 %96 %float_1
-         %98 = OpVectorTimesMatrix %v3float %97 %71
+        %101 = OpImageFetch %v4float %plane_0 %81 Lod %uint_0
+        %102 = OpCompositeExtract %float %101 0
+        %103 = OpFMul %v2float %80 %74
+        %104 = OpConvertFToU %v2uint %103
+        %105 = OpImageFetch %v4float %plane_1 %104 Lod %uint_0
+        %106 = OpVectorShuffle %v2float %105 %105 0 1
+        %107 = OpCompositeConstruct %v4float %102 %106 %float_1
+         %90 = OpVectorTimesMatrix %v3float %107 %71
                OpBranch %85
          %85 = OpLabel
-         %99 = OpPhi %v3float %89 %86 %98 %87
-        %100 = OpPhi %float %90 %86 %float_1 %87
-        %101 = OpIEqual %bool %70 %uint_0
-               OpSelectionMerge %102 None
-               OpBranchConditional %101 %103 %104
-        %103 = OpLabel
-        %105 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %106 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %107 = OpCompositeExtract %mat3v3float %params 5
-        %108 = OpFunctionCall %v3float %tint_GammaCorrection %99 %105
-        %110 = OpMatrixTimesVector %v3float %107 %108
-        %111 = OpFunctionCall %v3float %tint_GammaCorrection %110 %106
-               OpBranch %102
-        %104 = OpLabel
-               OpBranch %102
-        %102 = OpLabel
-        %112 = OpPhi %v3float %111 %103 %99 %104
-        %113 = OpCompositeConstruct %v4float %112 %100
-               OpReturnValue %113
+         %88 = OpPhi %v3float %89 %86 %90 %87
+         %91 = OpPhi %float %92 %86 %float_1 %87
+         %93 = OpIEqual %bool %70 %uint_0
+               OpSelectionMerge %94 None
+               OpBranchConditional %93 %95 %96
+         %95 = OpLabel
+        %108 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %109 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %110 = OpCompositeExtract %mat3v3float %params 5
+        %111 = OpFunctionCall %v3float %tint_GammaCorrection %88 %108
+        %113 = OpMatrixTimesVector %v3float %110 %111
+         %98 = OpFunctionCall %v3float %tint_GammaCorrection %113 %109
+               OpBranch %94
+         %96 = OpLabel
+               OpBranch %94
+         %94 = OpLabel
+         %97 = OpPhi %v3float %98 %95 %88 %96
+         %99 = OpCompositeConstruct %v4float %97 %91
+               OpReturnValue %99
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %116
           %v = OpFunctionParameter %v3float
@@ -525,40 +525,40 @@
                OpSelectionMerge %79 None
                OpBranchConditional %77 %80 %81
          %80 = OpLabel
-         %82 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %83 = OpVectorShuffle %v3float %82 %82 0 1 2
-         %84 = OpCompositeExtract %float %82 3
+         %94 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %83 = OpVectorShuffle %v3float %94 %94 0 1 2
+         %86 = OpCompositeExtract %float %94 3
                OpBranch %79
          %81 = OpLabel
-         %85 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %86 = OpCompositeExtract %float %85 0
-         %87 = OpFMul %v2float %74 %68
-         %88 = OpConvertFToU %v2uint %87
-         %89 = OpImageFetch %v4float %plane_1 %88 Lod %uint_0
-         %90 = OpVectorShuffle %v2float %89 %89 0 1
-         %91 = OpCompositeConstruct %v4float %86 %90 %float_1
-         %92 = OpVectorTimesMatrix %v3float %91 %65
+         %95 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %96 = OpCompositeExtract %float %95 0
+         %97 = OpFMul %v2float %74 %68
+         %98 = OpConvertFToU %v2uint %97
+         %99 = OpImageFetch %v4float %plane_1 %98 Lod %uint_0
+        %100 = OpVectorShuffle %v2float %99 %99 0 1
+        %101 = OpCompositeConstruct %v4float %96 %100 %float_1
+         %84 = OpVectorTimesMatrix %v3float %101 %65
                OpBranch %79
          %79 = OpLabel
-         %93 = OpPhi %v3float %83 %80 %92 %81
-         %94 = OpPhi %float %84 %80 %float_1 %81
-         %95 = OpIEqual %bool %64 %uint_0
-               OpSelectionMerge %96 None
-               OpBranchConditional %95 %97 %98
-         %97 = OpLabel
-         %99 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %100 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %101 = OpCompositeExtract %mat3v3float %params 5
-        %102 = OpFunctionCall %v3float %tint_GammaCorrection %93 %99
-        %104 = OpMatrixTimesVector %v3float %101 %102
-        %105 = OpFunctionCall %v3float %tint_GammaCorrection %104 %100
-               OpBranch %96
-         %98 = OpLabel
-               OpBranch %96
-         %96 = OpLabel
-        %106 = OpPhi %v3float %105 %97 %93 %98
-        %107 = OpCompositeConstruct %v4float %106 %94
-               OpReturnValue %107
+         %82 = OpPhi %v3float %83 %80 %84 %81
+         %85 = OpPhi %float %86 %80 %float_1 %81
+         %87 = OpIEqual %bool %64 %uint_0
+               OpSelectionMerge %88 None
+               OpBranchConditional %87 %89 %90
+         %89 = OpLabel
+        %102 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %103 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %104 = OpCompositeExtract %mat3v3float %params 5
+        %105 = OpFunctionCall %v3float %tint_GammaCorrection %82 %102
+        %107 = OpMatrixTimesVector %v3float %104 %105
+         %92 = OpFunctionCall %v3float %tint_GammaCorrection %107 %103
+               OpBranch %88
+         %90 = OpLabel
+               OpBranch %88
+         %88 = OpLabel
+         %91 = OpPhi %v3float %92 %89 %82 %90
+         %93 = OpCompositeConstruct %v4float %91 %85
+               OpReturnValue %93
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %110
           %v = OpFunctionParameter %v3float
@@ -827,40 +827,40 @@
                OpSelectionMerge %79 None
                OpBranchConditional %77 %80 %81
          %80 = OpLabel
-         %82 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %83 = OpVectorShuffle %v3float %82 %82 0 1 2
-         %84 = OpCompositeExtract %float %82 3
+         %94 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %83 = OpVectorShuffle %v3float %94 %94 0 1 2
+         %86 = OpCompositeExtract %float %94 3
                OpBranch %79
          %81 = OpLabel
-         %85 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
-         %86 = OpCompositeExtract %float %85 0
-         %87 = OpFMul %v2float %74 %68
-         %88 = OpConvertFToU %v2uint %87
-         %89 = OpImageFetch %v4float %plane_1 %88 Lod %uint_0
-         %90 = OpVectorShuffle %v2float %89 %89 0 1
-         %91 = OpCompositeConstruct %v4float %86 %90 %float_1
-         %92 = OpVectorTimesMatrix %v3float %91 %65
+         %95 = OpImageFetch %v4float %plane_0 %75 Lod %uint_0
+         %96 = OpCompositeExtract %float %95 0
+         %97 = OpFMul %v2float %74 %68
+         %98 = OpConvertFToU %v2uint %97
+         %99 = OpImageFetch %v4float %plane_1 %98 Lod %uint_0
+        %100 = OpVectorShuffle %v2float %99 %99 0 1
+        %101 = OpCompositeConstruct %v4float %96 %100 %float_1
+         %84 = OpVectorTimesMatrix %v3float %101 %65
                OpBranch %79
          %79 = OpLabel
-         %93 = OpPhi %v3float %83 %80 %92 %81
-         %94 = OpPhi %float %84 %80 %float_1 %81
-         %95 = OpIEqual %bool %64 %uint_0
-               OpSelectionMerge %96 None
-               OpBranchConditional %95 %97 %98
-         %97 = OpLabel
-         %99 = OpCompositeExtract %tint_GammaTransferParams %params 3
-        %100 = OpCompositeExtract %tint_GammaTransferParams %params 4
-        %101 = OpCompositeExtract %mat3v3float %params 5
-        %102 = OpFunctionCall %v3float %tint_GammaCorrection %93 %99
-        %104 = OpMatrixTimesVector %v3float %101 %102
-        %105 = OpFunctionCall %v3float %tint_GammaCorrection %104 %100
-               OpBranch %96
-         %98 = OpLabel
-               OpBranch %96
-         %96 = OpLabel
-        %106 = OpPhi %v3float %105 %97 %93 %98
-        %107 = OpCompositeConstruct %v4float %106 %94
-               OpReturnValue %107
+         %82 = OpPhi %v3float %83 %80 %84 %81
+         %85 = OpPhi %float %86 %80 %float_1 %81
+         %87 = OpIEqual %bool %64 %uint_0
+               OpSelectionMerge %88 None
+               OpBranchConditional %87 %89 %90
+         %89 = OpLabel
+        %102 = OpCompositeExtract %tint_GammaTransferParams %params 3
+        %103 = OpCompositeExtract %tint_GammaTransferParams %params 4
+        %104 = OpCompositeExtract %mat3v3float %params 5
+        %105 = OpFunctionCall %v3float %tint_GammaCorrection %82 %102
+        %107 = OpMatrixTimesVector %v3float %104 %105
+         %92 = OpFunctionCall %v3float %tint_GammaCorrection %107 %103
+               OpBranch %88
+         %90 = OpLabel
+               OpBranch %88
+         %88 = OpLabel
+         %91 = OpPhi %v3float %92 %89 %82 %90
+         %93 = OpCompositeConstruct %v4float %91 %85
+               OpReturnValue %93
                OpFunctionEnd
 %tint_GammaCorrection = OpFunction %v3float None %110
           %v = OpFunctionParameter %v3float
diff --git a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.spvasm b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.spvasm
index cf9f3b1..9d59da1 100644
--- a/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.spvasm
+++ b/test/tint/builtins/workgroupUniformLoad/if_condition.wgsl.expected.spvasm
@@ -44,15 +44,15 @@
                OpStore %return_value %int_42 None
                OpBranch %21
          %21 = OpLabel
-         %25 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %26 None
-               OpBranchConditional %25 %27 %26
-         %27 = OpLabel
+         %23 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %24 None
+               OpBranchConditional %23 %25 %24
+         %25 = OpLabel
                OpStore %return_value %int_0 None
-               OpBranch %26
-         %26 = OpLabel
-         %29 = OpLoad %int %return_value None
-               OpReturnValue %29
+               OpBranch %24
+         %24 = OpLabel
+         %26 = OpLoad %int %return_value None
+               OpReturnValue %26
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %31
          %32 = OpLabel
diff --git a/test/tint/diagnostic_filtering/case_body_attribute.wgsl.expected.spvasm b/test/tint/diagnostic_filtering/case_body_attribute.wgsl.expected.spvasm
index 7595172..0353a46 100644
--- a/test/tint/diagnostic_filtering/case_body_attribute.wgsl.expected.spvasm
+++ b/test/tint/diagnostic_filtering/case_body_attribute.wgsl.expected.spvasm
@@ -61,14 +61,14 @@
          %15 = OpFunctionCall %int %tint_f32_to_i32 %x
                OpSelectionMerge %20 None
                OpSwitch %15 %18 0 %19
+         %18 = OpLabel
+               OpBranch %20
          %19 = OpLabel
          %21 = OpLoad %3 %t None
          %22 = OpLoad %7 %s None
          %23 = OpSampledImage %24 %21 %22
          %25 = OpImageSampleImplicitLod %v4float %23 %27 None
                OpBranch %20
-         %18 = OpLabel
-               OpBranch %20
          %20 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.spvasm b/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.spvasm
index 28ce4b1..a4c42f8 100644
--- a/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.spvasm
+++ b/test/tint/diagnostic_filtering/for_loop_attribute.wgsl.expected.spvasm
@@ -46,11 +46,11 @@
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_float = OpTypePointer Function %float
      %uint_0 = OpConstant %uint 0
-    %float_1 = OpConstant %float 1
-    %float_0 = OpConstant %float 0
       %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_1 = OpConstant %uint 1
+    %float_1 = OpConstant %float 1
+    %float_0 = OpConstant %float 0
          %61 = OpTypeFunction %void
  %main_inner = OpFunction %void None %7
           %x = OpFunctionParameter %float
@@ -80,32 +80,32 @@
                OpSelectionMerge %37 None
                OpBranchConditional %36 %38 %39
          %38 = OpLabel
-         %40 = OpDPdx %float %float_1
-         %42 = OpFOrdGreaterThan %bool %40 %float_0
+         %57 = OpDPdx %float %float_1
+         %41 = OpFOrdGreaterThan %bool %57 %float_0
                OpBranch %37
          %39 = OpLabel
                OpBranch %37
          %37 = OpLabel
-         %44 = OpPhi %bool %42 %38 %false %39
-               OpSelectionMerge %46 None
-               OpBranchConditional %44 %46 %47
-         %47 = OpLabel
+         %40 = OpPhi %bool %41 %38 %false %39
+               OpSelectionMerge %43 None
+               OpBranchConditional %40 %43 %44
+         %44 = OpLabel
                OpBranch %17
-         %46 = OpLabel
+         %43 = OpLabel
                OpBranch %15
          %15 = OpLabel
-         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %50 = OpLoad %uint %48 None
-%tint_low_inc = OpISub %uint %50 %uint_1
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %53 %tint_low_inc None
-         %54 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %54 %uint_1 %uint_0
+         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %47 = OpLoad %uint %45 None
+%tint_low_inc = OpISub %uint %47 %uint_1
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %50 %tint_low_inc None
+         %51 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %51 %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %54 = OpLoad %uint %53 None
+         %55 = OpISub %uint %54 %tint_carry
          %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %57 = OpLoad %uint %56 None
-         %58 = OpISub %uint %57 %tint_carry
-         %59 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %59 %58 None
+               OpStore %56 %55 None
                OpBranch %16
          %17 = OpLabel
                OpReturn
diff --git a/test/tint/diagnostic_filtering/switch_statement_attribute.wgsl.expected.spvasm b/test/tint/diagnostic_filtering/switch_statement_attribute.wgsl.expected.spvasm
index 4a2c68b..ce683af 100644
--- a/test/tint/diagnostic_filtering/switch_statement_attribute.wgsl.expected.spvasm
+++ b/test/tint/diagnostic_filtering/switch_statement_attribute.wgsl.expected.spvasm
@@ -31,11 +31,11 @@
           %7 = OpTypeFunction %void %float
     %float_0 = OpConstant %float 0
        %bool = OpTypeBool
-    %float_1 = OpConstant %float 1
       %false = OpConstantFalse %bool
         %int = OpTypeInt 32 1
       %int_1 = OpConstant %int 1
       %int_0 = OpConstant %int 0
+    %float_1 = OpConstant %float 1
          %27 = OpTypeFunction %void
  %main_inner = OpFunction %void None %7
           %x = OpFunctionParameter %float
@@ -44,19 +44,19 @@
                OpSelectionMerge %12 None
                OpBranchConditional %9 %13 %14
          %13 = OpLabel
-         %15 = OpDPdx %float %float_1
-         %17 = OpFOrdEqual %bool %15 %float_0
+         %24 = OpDPdx %float %float_1
+         %16 = OpFOrdEqual %bool %24 %float_0
                OpBranch %12
          %14 = OpLabel
                OpBranch %12
          %12 = OpLabel
-         %18 = OpPhi %bool %17 %13 %false %14
-         %21 = OpSelect %int %18 %int_1 %int_0
-               OpSelectionMerge %25 None
-               OpSwitch %21 %24
-         %24 = OpLabel
-               OpBranch %25
-         %25 = OpLabel
+         %15 = OpPhi %bool %16 %13 %false %14
+         %19 = OpSelect %int %15 %int_1 %int_0
+               OpSelectionMerge %23 None
+               OpSwitch %19 %22
+         %22 = OpLabel
+               OpBranch %23
+         %23 = OpLabel
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %27
diff --git a/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.spvasm b/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.spvasm
index 3599b83..e6ab140 100644
--- a/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.spvasm
+++ b/test/tint/diagnostic_filtering/while_loop_attribute.wgsl.expected.spvasm
@@ -45,11 +45,11 @@
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
     %float_0 = OpConstant %float 0
-    %float_1 = OpConstant %float 1
       %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
+    %float_1 = OpConstant %float 1
          %58 = OpTypeFunction %void
  %main_inner = OpFunction %void None %7
           %x = OpFunctionParameter %float
@@ -77,32 +77,32 @@
                OpSelectionMerge %34 None
                OpBranchConditional %32 %35 %36
          %35 = OpLabel
-         %37 = OpDPdx %float %float_1
-         %39 = OpFOrdGreaterThan %bool %37 %float_0
+         %55 = OpDPdx %float %float_1
+         %38 = OpFOrdGreaterThan %bool %55 %float_0
                OpBranch %34
          %36 = OpLabel
                OpBranch %34
          %34 = OpLabel
-         %40 = OpPhi %bool %39 %35 %false %36
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %42 %43
-         %43 = OpLabel
+         %37 = OpPhi %bool %38 %35 %false %36
+               OpSelectionMerge %40 None
+               OpBranchConditional %37 %40 %41
+         %41 = OpLabel
                OpBranch %17
-         %42 = OpLabel
+         %40 = OpLabel
                OpBranch %15
          %15 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %47 = OpLoad %uint %44 None
-%tint_low_inc = OpISub %uint %47 %uint_1
-         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %50 %tint_low_inc None
-         %51 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %51 %uint_1 %uint_0
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %54 = OpLoad %uint %53 None
-         %55 = OpISub %uint %54 %tint_carry
-         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %56 %55 None
+         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %45 = OpLoad %uint %42 None
+%tint_low_inc = OpISub %uint %45 %uint_1
+         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %48 %tint_low_inc None
+         %49 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %49 %uint_1 %uint_0
+         %51 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %52 = OpLoad %uint %51 None
+         %53 = OpISub %uint %52 %tint_carry
+         %54 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %54 %53 None
                OpBranch %16
          %17 = OpLabel
                OpReturn
diff --git a/test/tint/loops/continue_in_switch.wgsl.expected.spvasm b/test/tint/loops/continue_in_switch.wgsl.expected.spvasm
index b7807ce..c129631 100644
--- a/test/tint/loops/continue_in_switch.wgsl.expected.spvasm
+++ b/test/tint/loops/continue_in_switch.wgsl.expected.spvasm
@@ -38,10 +38,10 @@
          %20 = OpLoad %int %i None
                OpSelectionMerge %23 None
                OpSwitch %20 %21 0 %22
-         %22 = OpLabel
-               OpBranch %7
          %21 = OpLabel
                OpBranch %23
+         %22 = OpLabel
+               OpBranch %7
          %23 = OpLabel
                OpBranch %7
           %7 = OpLabel
diff --git a/test/tint/loops/continue_in_switch_robustness.wgsl.expected.spvasm b/test/tint/loops/continue_in_switch_robustness.wgsl.expected.spvasm
index b7807ce..c129631 100644
--- a/test/tint/loops/continue_in_switch_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/continue_in_switch_robustness.wgsl.expected.spvasm
@@ -38,10 +38,10 @@
          %20 = OpLoad %int %i None
                OpSelectionMerge %23 None
                OpSwitch %20 %21 0 %22
-         %22 = OpLabel
-               OpBranch %7
          %21 = OpLabel
                OpBranch %23
+         %22 = OpLabel
+               OpBranch %7
          %23 = OpLabel
                OpBranch %7
           %7 = OpLabel
diff --git a/test/tint/loops/continue_in_switch_with_breakif.wgsl.expected.spvasm b/test/tint/loops/continue_in_switch_with_breakif.wgsl.expected.spvasm
index e731380..4d678b1a 100644
--- a/test/tint/loops/continue_in_switch_with_breakif.wgsl.expected.spvasm
+++ b/test/tint/loops/continue_in_switch_with_breakif.wgsl.expected.spvasm
@@ -54,10 +54,10 @@
          %28 = OpLoad %int %i None
                OpSelectionMerge %31 None
                OpSwitch %28 %29 0 %30
-         %30 = OpLabel
-               OpBranch %11
          %29 = OpLabel
                OpBranch %31
+         %30 = OpLabel
+               OpBranch %11
          %31 = OpLabel
                OpBranch %11
          %11 = OpLabel
diff --git a/test/tint/loops/continue_in_switch_with_breakif_robustness.wgsl.expected.spvasm b/test/tint/loops/continue_in_switch_with_breakif_robustness.wgsl.expected.spvasm
index e731380..4d678b1a 100644
--- a/test/tint/loops/continue_in_switch_with_breakif_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/continue_in_switch_with_breakif_robustness.wgsl.expected.spvasm
@@ -54,10 +54,10 @@
          %28 = OpLoad %int %i None
                OpSelectionMerge %31 None
                OpSwitch %28 %29 0 %30
-         %30 = OpLabel
-               OpBranch %11
          %29 = OpLabel
                OpBranch %31
+         %30 = OpLabel
+               OpBranch %11
          %31 = OpLabel
                OpBranch %11
          %11 = OpLabel
diff --git a/test/tint/loops/loop.wgsl.expected.spvasm b/test/tint/loops/loop.wgsl.expected.spvasm
index 60ea043..c1e1f11 100644
--- a/test/tint/loops/loop.wgsl.expected.spvasm
+++ b/test/tint/loops/loop.wgsl.expected.spvasm
@@ -26,15 +26,15 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %22 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %26 = OpConstantNull %v2uint
+         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %27 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_1 = OpConstant %int 1
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
+      %false = OpConstantFalse %bool
        %void = OpTypeVoid
          %60 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -46,57 +46,57 @@
                OpStore %continue_execution %true
                OpBranch %13
          %13 = OpLabel
-               OpStore %tint_loop_idx %22
+               OpStore %tint_loop_idx %23
                OpBranch %16
          %16 = OpLabel
                OpLoopMerge %17 %15 None
                OpBranch %14
          %14 = OpLabel
-         %24 = OpLoad %v2uint %tint_loop_idx None
-         %25 = OpIEqual %v2bool %24 %26
-         %28 = OpAll %bool %25
-               OpSelectionMerge %29 None
-               OpBranchConditional %28 %30 %29
-         %30 = OpLabel
+         %25 = OpLoad %v2uint %tint_loop_idx None
+         %26 = OpIEqual %v2bool %25 %27
+         %29 = OpAll %bool %26
+               OpSelectionMerge %30 None
+               OpBranchConditional %29 %31 %30
+         %31 = OpLabel
                OpBranch %17
-         %29 = OpLabel
-         %31 = OpLoad %int %i None
-         %32 = OpIAdd %int %31 %int_1
-               OpStore %i %32 None
-         %34 = OpLoad %int %i None
-         %35 = OpSGreaterThan %bool %34 %int_4
-               OpSelectionMerge %37 None
-               OpBranchConditional %35 %38 %37
-         %38 = OpLabel
-         %39 = OpLoad %int %i None
+         %30 = OpLabel
+         %32 = OpLoad %int %i None
+         %33 = OpIAdd %int %32 %int_1
+               OpStore %i %33 None
+         %35 = OpLoad %int %i None
+         %36 = OpSGreaterThan %bool %35 %int_4
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %39 %38
+         %39 = OpLabel
+         %56 = OpLoad %int %i None
                OpStore %continue_execution %false None
-               OpStore %return_value %39 None
-               OpBranch %37
-         %37 = OpLabel
-         %41 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %42 None
-               OpBranchConditional %41 %43 %42
-         %43 = OpLabel
-               OpBranch %15
+               OpStore %return_value %56 None
+               OpBranch %38
+         %38 = OpLabel
+         %40 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %41 None
+               OpBranchConditional %40 %42 %41
          %42 = OpLabel
+               OpBranch %15
+         %41 = OpLabel
                OpBranch %17
          %15 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %47 = OpLoad %uint %44 None
-%tint_low_inc = OpISub %uint %47 %uint_1
-         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %50 %tint_low_inc None
-         %51 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %51 %uint_1 %uint_0
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %54 = OpLoad %uint %53 None
-         %55 = OpISub %uint %54 %tint_carry
-         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %56 %55 None
+         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %46 = OpLoad %uint %43 None
+%tint_low_inc = OpISub %uint %46 %uint_1
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %49 %tint_low_inc None
+         %50 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %50 %uint_1 %uint_0
+         %52 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %53 = OpLoad %uint %52 None
+         %54 = OpISub %uint %53 %tint_carry
+         %55 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %55 %54 None
                OpBranch %16
          %17 = OpLabel
-         %57 = OpLoad %int %return_value None
-               OpReturnValue %57
+         %18 = OpLoad %int %return_value None
+               OpReturnValue %18
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %60
          %61 = OpLabel
diff --git a/test/tint/loops/loop_robustness.wgsl.expected.spvasm b/test/tint/loops/loop_robustness.wgsl.expected.spvasm
index 60ea043..c1e1f11 100644
--- a/test/tint/loops/loop_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/loop_robustness.wgsl.expected.spvasm
@@ -26,15 +26,15 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %22 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %26 = OpConstantNull %v2uint
+         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %27 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_1 = OpConstant %int 1
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
+      %false = OpConstantFalse %bool
        %void = OpTypeVoid
          %60 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -46,57 +46,57 @@
                OpStore %continue_execution %true
                OpBranch %13
          %13 = OpLabel
-               OpStore %tint_loop_idx %22
+               OpStore %tint_loop_idx %23
                OpBranch %16
          %16 = OpLabel
                OpLoopMerge %17 %15 None
                OpBranch %14
          %14 = OpLabel
-         %24 = OpLoad %v2uint %tint_loop_idx None
-         %25 = OpIEqual %v2bool %24 %26
-         %28 = OpAll %bool %25
-               OpSelectionMerge %29 None
-               OpBranchConditional %28 %30 %29
-         %30 = OpLabel
+         %25 = OpLoad %v2uint %tint_loop_idx None
+         %26 = OpIEqual %v2bool %25 %27
+         %29 = OpAll %bool %26
+               OpSelectionMerge %30 None
+               OpBranchConditional %29 %31 %30
+         %31 = OpLabel
                OpBranch %17
-         %29 = OpLabel
-         %31 = OpLoad %int %i None
-         %32 = OpIAdd %int %31 %int_1
-               OpStore %i %32 None
-         %34 = OpLoad %int %i None
-         %35 = OpSGreaterThan %bool %34 %int_4
-               OpSelectionMerge %37 None
-               OpBranchConditional %35 %38 %37
-         %38 = OpLabel
-         %39 = OpLoad %int %i None
+         %30 = OpLabel
+         %32 = OpLoad %int %i None
+         %33 = OpIAdd %int %32 %int_1
+               OpStore %i %33 None
+         %35 = OpLoad %int %i None
+         %36 = OpSGreaterThan %bool %35 %int_4
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %39 %38
+         %39 = OpLabel
+         %56 = OpLoad %int %i None
                OpStore %continue_execution %false None
-               OpStore %return_value %39 None
-               OpBranch %37
-         %37 = OpLabel
-         %41 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %42 None
-               OpBranchConditional %41 %43 %42
-         %43 = OpLabel
-               OpBranch %15
+               OpStore %return_value %56 None
+               OpBranch %38
+         %38 = OpLabel
+         %40 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %41 None
+               OpBranchConditional %40 %42 %41
          %42 = OpLabel
+               OpBranch %15
+         %41 = OpLabel
                OpBranch %17
          %15 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %47 = OpLoad %uint %44 None
-%tint_low_inc = OpISub %uint %47 %uint_1
-         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %50 %tint_low_inc None
-         %51 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %51 %uint_1 %uint_0
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %54 = OpLoad %uint %53 None
-         %55 = OpISub %uint %54 %tint_carry
-         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %56 %55 None
+         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %46 = OpLoad %uint %43 None
+%tint_low_inc = OpISub %uint %46 %uint_1
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %49 %tint_low_inc None
+         %50 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %50 %uint_1 %uint_0
+         %52 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %53 = OpLoad %uint %52 None
+         %54 = OpISub %uint %53 %tint_carry
+         %55 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %55 %54 None
                OpBranch %16
          %17 = OpLabel
-         %57 = OpLoad %int %return_value None
-               OpReturnValue %57
+         %18 = OpLoad %int %return_value None
+               OpReturnValue %18
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %60
          %61 = OpLabel
diff --git a/test/tint/loops/loop_with_break_if.wgsl.expected.spvasm b/test/tint/loops/loop_with_break_if.wgsl.expected.spvasm
index 24c8a4e..897b399 100644
--- a/test/tint/loops/loop_with_break_if.wgsl.expected.spvasm
+++ b/test/tint/loops/loop_with_break_if.wgsl.expected.spvasm
@@ -26,15 +26,15 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %22 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %26 = OpConstantNull %v2uint
+         %26 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %30 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
+      %false = OpConstantFalse %bool
        %void = OpTypeVoid
          %66 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -46,67 +46,67 @@
                OpStore %continue_execution %true
                OpBranch %13
          %13 = OpLabel
-               OpStore %tint_loop_idx %22
+               OpStore %tint_loop_idx %26
                OpBranch %16
          %16 = OpLabel
                OpLoopMerge %17 %15 None
                OpBranch %14
          %14 = OpLabel
-         %24 = OpLoad %v2uint %tint_loop_idx None
-         %25 = OpIEqual %v2bool %24 %26
-         %28 = OpAll %bool %25
-               OpSelectionMerge %29 None
-               OpBranchConditional %28 %30 %29
-         %30 = OpLabel
-               OpBranch %17
-         %29 = OpLabel
-         %31 = OpLoad %int %i None
-         %32 = OpSGreaterThan %bool %31 %int_4
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
-         %36 = OpLoad %int %i None
-               OpStore %continue_execution %false None
-               OpStore %return_value %36 None
-               OpBranch %34
+         %28 = OpLoad %v2uint %tint_loop_idx None
+         %29 = OpIEqual %v2bool %28 %30
+         %32 = OpAll %bool %29
+               OpSelectionMerge %33 None
+               OpBranchConditional %32 %34 %33
          %34 = OpLabel
-         %38 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %39 None
-               OpBranchConditional %38 %40 %39
-         %40 = OpLabel
-               OpBranch %15
+               OpBranch %17
+         %33 = OpLabel
+         %35 = OpLoad %int %i None
+         %36 = OpSGreaterThan %bool %35 %int_4
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %39 %38
          %39 = OpLabel
+         %62 = OpLoad %int %i None
+               OpStore %continue_execution %false None
+               OpStore %return_value %62 None
+               OpBranch %38
+         %38 = OpLabel
+         %40 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %41 None
+               OpBranchConditional %40 %42 %41
+         %42 = OpLabel
+               OpBranch %15
+         %41 = OpLabel
                OpBranch %17
          %15 = OpLabel
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %44 = OpLoad %uint %41 None
-%tint_low_inc = OpISub %uint %44 %uint_1
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %47 %tint_low_inc None
-         %48 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %48 %uint_1 %uint_0
-         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %51 = OpLoad %uint %50 None
-         %52 = OpISub %uint %51 %tint_carry
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %53 %52 None
-         %54 = OpLoad %int %i None
-         %55 = OpIAdd %int %54 %int_1
-               OpStore %i %55 None
-         %57 = OpLoad %int %i None
-         %58 = OpIEqual %bool %57 %int_4
-               OpBranchConditional %58 %17 %16
+         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %46 = OpLoad %uint %43 None
+%tint_low_inc = OpISub %uint %46 %uint_1
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %49 %tint_low_inc None
+         %50 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %50 %uint_1 %uint_0
+         %52 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %53 = OpLoad %uint %52 None
+         %54 = OpISub %uint %53 %tint_carry
+         %55 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %55 %54 None
+         %56 = OpLoad %int %i None
+         %57 = OpIAdd %int %56 %int_1
+               OpStore %i %57 None
+         %59 = OpLoad %int %i None
+         %60 = OpIEqual %bool %59 %int_4
+               OpBranchConditional %60 %17 %16
          %17 = OpLabel
-         %59 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %60 None
-               OpBranchConditional %59 %61 %60
-         %61 = OpLabel
-         %62 = OpLoad %int %i None
-               OpStore %return_value %62 None
-               OpBranch %60
-         %60 = OpLabel
-         %63 = OpLoad %int %return_value None
-               OpReturnValue %63
+         %18 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %19 None
+               OpBranchConditional %18 %20 %19
+         %20 = OpLabel
+         %61 = OpLoad %int %i None
+               OpStore %return_value %61 None
+               OpBranch %19
+         %19 = OpLabel
+         %21 = OpLoad %int %return_value None
+               OpReturnValue %21
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %66
          %67 = OpLabel
diff --git a/test/tint/loops/loop_with_break_if_robustness.wgsl.expected.spvasm b/test/tint/loops/loop_with_break_if_robustness.wgsl.expected.spvasm
index 24c8a4e..897b399 100644
--- a/test/tint/loops/loop_with_break_if_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/loop_with_break_if_robustness.wgsl.expected.spvasm
@@ -26,15 +26,15 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %22 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %26 = OpConstantNull %v2uint
+         %26 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %30 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
+      %false = OpConstantFalse %bool
        %void = OpTypeVoid
          %66 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -46,67 +46,67 @@
                OpStore %continue_execution %true
                OpBranch %13
          %13 = OpLabel
-               OpStore %tint_loop_idx %22
+               OpStore %tint_loop_idx %26
                OpBranch %16
          %16 = OpLabel
                OpLoopMerge %17 %15 None
                OpBranch %14
          %14 = OpLabel
-         %24 = OpLoad %v2uint %tint_loop_idx None
-         %25 = OpIEqual %v2bool %24 %26
-         %28 = OpAll %bool %25
-               OpSelectionMerge %29 None
-               OpBranchConditional %28 %30 %29
-         %30 = OpLabel
-               OpBranch %17
-         %29 = OpLabel
-         %31 = OpLoad %int %i None
-         %32 = OpSGreaterThan %bool %31 %int_4
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
-         %36 = OpLoad %int %i None
-               OpStore %continue_execution %false None
-               OpStore %return_value %36 None
-               OpBranch %34
+         %28 = OpLoad %v2uint %tint_loop_idx None
+         %29 = OpIEqual %v2bool %28 %30
+         %32 = OpAll %bool %29
+               OpSelectionMerge %33 None
+               OpBranchConditional %32 %34 %33
          %34 = OpLabel
-         %38 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %39 None
-               OpBranchConditional %38 %40 %39
-         %40 = OpLabel
-               OpBranch %15
+               OpBranch %17
+         %33 = OpLabel
+         %35 = OpLoad %int %i None
+         %36 = OpSGreaterThan %bool %35 %int_4
+               OpSelectionMerge %38 None
+               OpBranchConditional %36 %39 %38
          %39 = OpLabel
+         %62 = OpLoad %int %i None
+               OpStore %continue_execution %false None
+               OpStore %return_value %62 None
+               OpBranch %38
+         %38 = OpLabel
+         %40 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %41 None
+               OpBranchConditional %40 %42 %41
+         %42 = OpLabel
+               OpBranch %15
+         %41 = OpLabel
                OpBranch %17
          %15 = OpLabel
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %44 = OpLoad %uint %41 None
-%tint_low_inc = OpISub %uint %44 %uint_1
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %47 %tint_low_inc None
-         %48 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %48 %uint_1 %uint_0
-         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %51 = OpLoad %uint %50 None
-         %52 = OpISub %uint %51 %tint_carry
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %53 %52 None
-         %54 = OpLoad %int %i None
-         %55 = OpIAdd %int %54 %int_1
-               OpStore %i %55 None
-         %57 = OpLoad %int %i None
-         %58 = OpIEqual %bool %57 %int_4
-               OpBranchConditional %58 %17 %16
+         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %46 = OpLoad %uint %43 None
+%tint_low_inc = OpISub %uint %46 %uint_1
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %49 %tint_low_inc None
+         %50 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %50 %uint_1 %uint_0
+         %52 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %53 = OpLoad %uint %52 None
+         %54 = OpISub %uint %53 %tint_carry
+         %55 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %55 %54 None
+         %56 = OpLoad %int %i None
+         %57 = OpIAdd %int %56 %int_1
+               OpStore %i %57 None
+         %59 = OpLoad %int %i None
+         %60 = OpIEqual %bool %59 %int_4
+               OpBranchConditional %60 %17 %16
          %17 = OpLabel
-         %59 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %60 None
-               OpBranchConditional %59 %61 %60
-         %61 = OpLabel
-         %62 = OpLoad %int %i None
-               OpStore %return_value %62 None
-               OpBranch %60
-         %60 = OpLabel
-         %63 = OpLoad %int %return_value None
-               OpReturnValue %63
+         %18 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %19 None
+               OpBranchConditional %18 %20 %19
+         %20 = OpLabel
+         %61 = OpLoad %int %i None
+               OpStore %return_value %61 None
+               OpBranch %19
+         %19 = OpLabel
+         %21 = OpLoad %int %return_value None
+               OpReturnValue %21
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %66
          %67 = OpLabel
diff --git a/test/tint/loops/loop_with_continuing.wgsl.expected.spvasm b/test/tint/loops/loop_with_continuing.wgsl.expected.spvasm
index 704b9ee..cc669b5 100644
--- a/test/tint/loops/loop_with_continuing.wgsl.expected.spvasm
+++ b/test/tint/loops/loop_with_continuing.wgsl.expected.spvasm
@@ -26,15 +26,15 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %22 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %26 = OpConstantNull %v2uint
+         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %27 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
+      %false = OpConstantFalse %bool
        %void = OpTypeVoid
          %60 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -46,57 +46,57 @@
                OpStore %continue_execution %true
                OpBranch %13
          %13 = OpLabel
-               OpStore %tint_loop_idx %22
+               OpStore %tint_loop_idx %23
                OpBranch %16
          %16 = OpLabel
                OpLoopMerge %17 %15 None
                OpBranch %14
          %14 = OpLabel
-         %24 = OpLoad %v2uint %tint_loop_idx None
-         %25 = OpIEqual %v2bool %24 %26
-         %28 = OpAll %bool %25
-               OpSelectionMerge %29 None
-               OpBranchConditional %28 %30 %29
-         %30 = OpLabel
+         %25 = OpLoad %v2uint %tint_loop_idx None
+         %26 = OpIEqual %v2bool %25 %27
+         %29 = OpAll %bool %26
+               OpSelectionMerge %30 None
+               OpBranchConditional %29 %31 %30
+         %31 = OpLabel
                OpBranch %17
-         %29 = OpLabel
-         %31 = OpLoad %int %i None
-         %32 = OpSGreaterThan %bool %31 %int_4
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
-         %36 = OpLoad %int %i None
+         %30 = OpLabel
+         %32 = OpLoad %int %i None
+         %33 = OpSGreaterThan %bool %32 %int_4
+               OpSelectionMerge %35 None
+               OpBranchConditional %33 %36 %35
+         %36 = OpLabel
+         %56 = OpLoad %int %i None
                OpStore %continue_execution %false None
-               OpStore %return_value %36 None
-               OpBranch %34
-         %34 = OpLabel
-         %38 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %39 None
-               OpBranchConditional %38 %40 %39
-         %40 = OpLabel
-               OpBranch %15
+               OpStore %return_value %56 None
+               OpBranch %35
+         %35 = OpLabel
+         %37 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %38 None
+               OpBranchConditional %37 %39 %38
          %39 = OpLabel
+               OpBranch %15
+         %38 = OpLabel
                OpBranch %17
          %15 = OpLabel
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %44 = OpLoad %uint %41 None
-%tint_low_inc = OpISub %uint %44 %uint_1
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %47 %tint_low_inc None
-         %48 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %48 %uint_1 %uint_0
-         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %51 = OpLoad %uint %50 None
-         %52 = OpISub %uint %51 %tint_carry
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %53 %52 None
-         %54 = OpLoad %int %i None
-         %55 = OpIAdd %int %54 %int_1
-               OpStore %i %55 None
+         %40 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %43 = OpLoad %uint %40 None
+%tint_low_inc = OpISub %uint %43 %uint_1
+         %46 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %46 %tint_low_inc None
+         %47 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %47 %uint_1 %uint_0
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %50 = OpLoad %uint %49 None
+         %51 = OpISub %uint %50 %tint_carry
+         %52 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %52 %51 None
+         %53 = OpLoad %int %i None
+         %54 = OpIAdd %int %53 %int_1
+               OpStore %i %54 None
                OpBranch %16
          %17 = OpLabel
-         %57 = OpLoad %int %return_value None
-               OpReturnValue %57
+         %18 = OpLoad %int %return_value None
+               OpReturnValue %18
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %60
          %61 = OpLabel
diff --git a/test/tint/loops/loop_with_continuing_robustness.wgsl.expected.spvasm b/test/tint/loops/loop_with_continuing_robustness.wgsl.expected.spvasm
index 704b9ee..cc669b5 100644
--- a/test/tint/loops/loop_with_continuing_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/loop_with_continuing_robustness.wgsl.expected.spvasm
@@ -26,15 +26,15 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %22 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %26 = OpConstantNull %v2uint
+         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %27 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
+      %false = OpConstantFalse %bool
        %void = OpTypeVoid
          %60 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -46,57 +46,57 @@
                OpStore %continue_execution %true
                OpBranch %13
          %13 = OpLabel
-               OpStore %tint_loop_idx %22
+               OpStore %tint_loop_idx %23
                OpBranch %16
          %16 = OpLabel
                OpLoopMerge %17 %15 None
                OpBranch %14
          %14 = OpLabel
-         %24 = OpLoad %v2uint %tint_loop_idx None
-         %25 = OpIEqual %v2bool %24 %26
-         %28 = OpAll %bool %25
-               OpSelectionMerge %29 None
-               OpBranchConditional %28 %30 %29
-         %30 = OpLabel
+         %25 = OpLoad %v2uint %tint_loop_idx None
+         %26 = OpIEqual %v2bool %25 %27
+         %29 = OpAll %bool %26
+               OpSelectionMerge %30 None
+               OpBranchConditional %29 %31 %30
+         %31 = OpLabel
                OpBranch %17
-         %29 = OpLabel
-         %31 = OpLoad %int %i None
-         %32 = OpSGreaterThan %bool %31 %int_4
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
-         %36 = OpLoad %int %i None
+         %30 = OpLabel
+         %32 = OpLoad %int %i None
+         %33 = OpSGreaterThan %bool %32 %int_4
+               OpSelectionMerge %35 None
+               OpBranchConditional %33 %36 %35
+         %36 = OpLabel
+         %56 = OpLoad %int %i None
                OpStore %continue_execution %false None
-               OpStore %return_value %36 None
-               OpBranch %34
-         %34 = OpLabel
-         %38 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %39 None
-               OpBranchConditional %38 %40 %39
-         %40 = OpLabel
-               OpBranch %15
+               OpStore %return_value %56 None
+               OpBranch %35
+         %35 = OpLabel
+         %37 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %38 None
+               OpBranchConditional %37 %39 %38
          %39 = OpLabel
+               OpBranch %15
+         %38 = OpLabel
                OpBranch %17
          %15 = OpLabel
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %44 = OpLoad %uint %41 None
-%tint_low_inc = OpISub %uint %44 %uint_1
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %47 %tint_low_inc None
-         %48 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %48 %uint_1 %uint_0
-         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %51 = OpLoad %uint %50 None
-         %52 = OpISub %uint %51 %tint_carry
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %53 %52 None
-         %54 = OpLoad %int %i None
-         %55 = OpIAdd %int %54 %int_1
-               OpStore %i %55 None
+         %40 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %43 = OpLoad %uint %40 None
+%tint_low_inc = OpISub %uint %43 %uint_1
+         %46 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %46 %tint_low_inc None
+         %47 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %47 %uint_1 %uint_0
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %50 = OpLoad %uint %49 None
+         %51 = OpISub %uint %50 %tint_carry
+         %52 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %52 %51 None
+         %53 = OpLoad %int %i None
+         %54 = OpIAdd %int %53 %int_1
+               OpStore %i %54 None
                OpBranch %16
          %17 = OpLabel
-         %57 = OpLoad %int %return_value None
-               OpReturnValue %57
+         %18 = OpLoad %int %return_value None
+               OpReturnValue %18
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %60
          %61 = OpLabel
diff --git a/test/tint/loops/multiple_continues.wgsl.expected.spvasm b/test/tint/loops/multiple_continues.wgsl.expected.spvasm
index 7e77949..6a5bed9 100644
--- a/test/tint/loops/multiple_continues.wgsl.expected.spvasm
+++ b/test/tint/loops/multiple_continues.wgsl.expected.spvasm
@@ -38,14 +38,14 @@
          %20 = OpLoad %int %i None
                OpSelectionMerge %25 None
                OpSwitch %20 %21 0 %22 1 %23 2 %24
+         %21 = OpLabel
+               OpBranch %25
          %22 = OpLabel
                OpBranch %7
          %23 = OpLabel
                OpBranch %7
          %24 = OpLabel
                OpBranch %7
-         %21 = OpLabel
-               OpBranch %25
          %25 = OpLabel
                OpBranch %7
           %7 = OpLabel
diff --git a/test/tint/loops/multiple_continues_robustness.wgsl.expected.spvasm b/test/tint/loops/multiple_continues_robustness.wgsl.expected.spvasm
index 7e77949..6a5bed9 100644
--- a/test/tint/loops/multiple_continues_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/multiple_continues_robustness.wgsl.expected.spvasm
@@ -38,14 +38,14 @@
          %20 = OpLoad %int %i None
                OpSelectionMerge %25 None
                OpSwitch %20 %21 0 %22 1 %23 2 %24
+         %21 = OpLabel
+               OpBranch %25
          %22 = OpLabel
                OpBranch %7
          %23 = OpLabel
                OpBranch %7
          %24 = OpLabel
                OpBranch %7
-         %21 = OpLabel
-               OpBranch %25
          %25 = OpLabel
                OpBranch %7
           %7 = OpLabel
diff --git a/test/tint/loops/multiple_switch.wgsl.expected.spvasm b/test/tint/loops/multiple_switch.wgsl.expected.spvasm
index 1863d97..688e102 100644
--- a/test/tint/loops/multiple_switch.wgsl.expected.spvasm
+++ b/test/tint/loops/multiple_switch.wgsl.expected.spvasm
@@ -41,18 +41,18 @@
          %21 = OpLoad %int %i_0 None
                OpSelectionMerge %24 None
                OpSwitch %21 %22 0 %23
-         %23 = OpLabel
-               OpBranch %11
          %22 = OpLabel
                OpBranch %24
+         %23 = OpLabel
+               OpBranch %11
          %24 = OpLabel
          %25 = OpLoad %int %i_0 None
                OpSelectionMerge %28 None
                OpSwitch %25 %26 0 %27
-         %27 = OpLabel
-               OpBranch %11
          %26 = OpLabel
                OpBranch %28
+         %27 = OpLabel
+               OpBranch %11
          %28 = OpLabel
                OpBranch %11
          %11 = OpLabel
diff --git a/test/tint/loops/multiple_switch_robustness.wgsl.expected.spvasm b/test/tint/loops/multiple_switch_robustness.wgsl.expected.spvasm
index 1863d97..688e102 100644
--- a/test/tint/loops/multiple_switch_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/multiple_switch_robustness.wgsl.expected.spvasm
@@ -41,18 +41,18 @@
          %21 = OpLoad %int %i_0 None
                OpSelectionMerge %24 None
                OpSwitch %21 %22 0 %23
-         %23 = OpLabel
-               OpBranch %11
          %22 = OpLabel
                OpBranch %24
+         %23 = OpLabel
+               OpBranch %11
          %24 = OpLabel
          %25 = OpLoad %int %i_0 None
                OpSelectionMerge %28 None
                OpSwitch %25 %26 0 %27
-         %27 = OpLabel
-               OpBranch %11
          %26 = OpLabel
                OpBranch %28
+         %27 = OpLabel
+               OpBranch %11
          %28 = OpLabel
                OpBranch %11
          %11 = OpLabel
diff --git a/test/tint/loops/nested_loop_loop_switch.wgsl.expected.spvasm b/test/tint/loops/nested_loop_loop_switch.wgsl.expected.spvasm
index cce3d97..e79293e 100644
--- a/test/tint/loops/nested_loop_loop_switch.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_loop_switch.wgsl.expected.spvasm
@@ -10,12 +10,12 @@
                OpName %main "main"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %j "j"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
@@ -72,65 +72,65 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpLoad %v2uint %tint_loop_idx_0 None
-         %41 = OpIEqual %v2bool %40 %22
-         %42 = OpAll %bool %41
-               OpSelectionMerge %43 None
-               OpBranchConditional %42 %44 %43
-         %44 = OpLabel
+         %55 = OpLoad %v2uint %tint_loop_idx_0 None
+         %56 = OpIEqual %v2bool %55 %22
+         %57 = OpAll %bool %56
+               OpSelectionMerge %58 None
+               OpBranchConditional %57 %59 %58
+         %59 = OpLabel
                OpBranch %37
-         %43 = OpLabel
-         %45 = OpLoad %int %j None
-         %46 = OpSLessThan %bool %45 %int_2
-               OpSelectionMerge %47 None
-               OpBranchConditional %46 %47 %48
-         %48 = OpLabel
+         %58 = OpLabel
+         %60 = OpLoad %int %j None
+         %61 = OpSLessThan %bool %60 %int_2
+               OpSelectionMerge %62 None
+               OpBranchConditional %61 %62 %63
+         %63 = OpLabel
                OpBranch %37
-         %47 = OpLabel
-         %49 = OpLoad %int %i None
-               OpSelectionMerge %52 None
-               OpSwitch %49 %50 0 %51
-         %51 = OpLabel
+         %62 = OpLabel
+         %64 = OpLoad %int %i None
+               OpSelectionMerge %67 None
+               OpSwitch %64 %65 0 %66
+         %65 = OpLabel
+               OpBranch %67
+         %66 = OpLabel
                OpBranch %35
-         %50 = OpLabel
-               OpBranch %52
-         %52 = OpLabel
+         %67 = OpLabel
                OpBranch %35
          %35 = OpLabel
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %56 = OpLoad %uint %53 None
-%tint_low_inc_1 = OpISub %uint %56 %uint_1
-         %59 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %59 %tint_low_inc_1 None
-         %60 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %60 %uint_1 %uint_0
-         %62 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %63 = OpLoad %uint %62 None
-         %64 = OpISub %uint %63 %tint_carry_1
-         %65 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %65 %64 None
-         %66 = OpLoad %int %j None
-         %67 = OpIAdd %int %66 %int_2
-               OpStore %j %67 None
+         %68 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %69 = OpLoad %uint %68 None
+%tint_low_inc_1 = OpISub %uint %69 %uint_1
+         %71 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %71 %tint_low_inc_1 None
+         %72 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %72 %uint_1 %uint_0
+         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %75 = OpLoad %uint %74 None
+         %76 = OpISub %uint %75 %tint_carry_1
+         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %77 %76 None
+         %78 = OpLoad %int %j None
+         %79 = OpIAdd %int %78 %int_2
+               OpStore %j %79 None
                OpBranch %36
          %37 = OpLabel
                OpBranch %7
           %7 = OpLabel
-         %68 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %69 = OpLoad %uint %68 None
-%tint_low_inc = OpISub %uint %69 %uint_1
-         %71 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %71 %tint_low_inc None
-         %72 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %72 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %75 = OpLoad %uint %74 None
-         %76 = OpISub %uint %75 %tint_carry
-         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %77 %76 None
-         %78 = OpLoad %int %i None
-         %79 = OpIAdd %int %78 %int_2
-               OpStore %i %79 None
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %41 = OpLoad %uint %38 None
+%tint_low_inc = OpISub %uint %41 %uint_1
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %44 %tint_low_inc None
+         %45 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %45 %uint_1 %uint_0
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %48 = OpLoad %uint %47 None
+         %49 = OpISub %uint %48 %tint_carry
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %50 %49 None
+         %51 = OpLoad %int %i None
+         %52 = OpIAdd %int %51 %int_2
+               OpStore %i %52 None
                OpBranch %8
           %9 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loop_loop_switch_robustness.wgsl.expected.spvasm b/test/tint/loops/nested_loop_loop_switch_robustness.wgsl.expected.spvasm
index cce3d97..e79293e 100644
--- a/test/tint/loops/nested_loop_loop_switch_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_loop_switch_robustness.wgsl.expected.spvasm
@@ -10,12 +10,12 @@
                OpName %main "main"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %j "j"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
@@ -72,65 +72,65 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpLoad %v2uint %tint_loop_idx_0 None
-         %41 = OpIEqual %v2bool %40 %22
-         %42 = OpAll %bool %41
-               OpSelectionMerge %43 None
-               OpBranchConditional %42 %44 %43
-         %44 = OpLabel
+         %55 = OpLoad %v2uint %tint_loop_idx_0 None
+         %56 = OpIEqual %v2bool %55 %22
+         %57 = OpAll %bool %56
+               OpSelectionMerge %58 None
+               OpBranchConditional %57 %59 %58
+         %59 = OpLabel
                OpBranch %37
-         %43 = OpLabel
-         %45 = OpLoad %int %j None
-         %46 = OpSLessThan %bool %45 %int_2
-               OpSelectionMerge %47 None
-               OpBranchConditional %46 %47 %48
-         %48 = OpLabel
+         %58 = OpLabel
+         %60 = OpLoad %int %j None
+         %61 = OpSLessThan %bool %60 %int_2
+               OpSelectionMerge %62 None
+               OpBranchConditional %61 %62 %63
+         %63 = OpLabel
                OpBranch %37
-         %47 = OpLabel
-         %49 = OpLoad %int %i None
-               OpSelectionMerge %52 None
-               OpSwitch %49 %50 0 %51
-         %51 = OpLabel
+         %62 = OpLabel
+         %64 = OpLoad %int %i None
+               OpSelectionMerge %67 None
+               OpSwitch %64 %65 0 %66
+         %65 = OpLabel
+               OpBranch %67
+         %66 = OpLabel
                OpBranch %35
-         %50 = OpLabel
-               OpBranch %52
-         %52 = OpLabel
+         %67 = OpLabel
                OpBranch %35
          %35 = OpLabel
-         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %56 = OpLoad %uint %53 None
-%tint_low_inc_1 = OpISub %uint %56 %uint_1
-         %59 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %59 %tint_low_inc_1 None
-         %60 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %60 %uint_1 %uint_0
-         %62 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %63 = OpLoad %uint %62 None
-         %64 = OpISub %uint %63 %tint_carry_1
-         %65 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %65 %64 None
-         %66 = OpLoad %int %j None
-         %67 = OpIAdd %int %66 %int_2
-               OpStore %j %67 None
+         %68 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %69 = OpLoad %uint %68 None
+%tint_low_inc_1 = OpISub %uint %69 %uint_1
+         %71 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %71 %tint_low_inc_1 None
+         %72 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %72 %uint_1 %uint_0
+         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %75 = OpLoad %uint %74 None
+         %76 = OpISub %uint %75 %tint_carry_1
+         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %77 %76 None
+         %78 = OpLoad %int %j None
+         %79 = OpIAdd %int %78 %int_2
+               OpStore %j %79 None
                OpBranch %36
          %37 = OpLabel
                OpBranch %7
           %7 = OpLabel
-         %68 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %69 = OpLoad %uint %68 None
-%tint_low_inc = OpISub %uint %69 %uint_1
-         %71 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %71 %tint_low_inc None
-         %72 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %72 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %75 = OpLoad %uint %74 None
-         %76 = OpISub %uint %75 %tint_carry
-         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %77 %76 None
-         %78 = OpLoad %int %i None
-         %79 = OpIAdd %int %78 %int_2
-               OpStore %i %79 None
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %41 = OpLoad %uint %38 None
+%tint_low_inc = OpISub %uint %41 %uint_1
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %44 %tint_low_inc None
+         %45 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %45 %uint_1 %uint_0
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %48 = OpLoad %uint %47 None
+         %49 = OpISub %uint %48 %tint_carry
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %50 %49 None
+         %51 = OpLoad %int %i None
+         %52 = OpIAdd %int %51 %int_2
+               OpStore %i %52 None
                OpBranch %8
           %9 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.spvasm b/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.spvasm
index 595ec2d..7463eab 100644
--- a/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_switch_loop_switch.wgsl.expected.spvasm
@@ -10,12 +10,12 @@
                OpName %main "main"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %j "j"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
@@ -66,79 +66,79 @@
          %33 = OpLoad %int %i None
                OpSelectionMerge %36 None
                OpSwitch %33 %34 0 %35
-         %35 = OpLabel
-               OpBranch %37
-         %37 = OpLabel
-               OpStore %tint_loop_idx_0 %14
-               OpStore %j %int_0
-               OpBranch %40
-         %40 = OpLabel
-               OpLoopMerge %41 %39 None
-               OpBranch %38
-         %38 = OpLabel
-         %44 = OpLoad %v2uint %tint_loop_idx_0 None
-         %45 = OpIEqual %v2bool %44 %22
-         %46 = OpAll %bool %45
-               OpSelectionMerge %47 None
-               OpBranchConditional %46 %48 %47
-         %48 = OpLabel
-               OpBranch %41
-         %47 = OpLabel
-         %49 = OpLoad %int %j None
-         %50 = OpSLessThan %bool %49 %int_2
-               OpSelectionMerge %51 None
-               OpBranchConditional %50 %51 %52
-         %52 = OpLabel
-               OpBranch %41
-         %51 = OpLabel
-         %53 = OpLoad %int %j None
-               OpSelectionMerge %56 None
-               OpSwitch %53 %54 0 %55
-         %55 = OpLabel
-               OpBranch %39
-         %54 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-               OpBranch %39
-         %39 = OpLabel
-         %57 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %60 = OpLoad %uint %57 None
-%tint_low_inc_1 = OpISub %uint %60 %uint_1
-         %63 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %63 %tint_low_inc_1 None
-         %64 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %64 %uint_1 %uint_0
-         %66 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %67 = OpLoad %uint %66 None
-         %68 = OpISub %uint %67 %tint_carry_1
-         %69 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %69 %68 None
-         %70 = OpLoad %int %j None
-         %71 = OpIAdd %int %70 %int_2
-               OpStore %j %71 None
-               OpBranch %40
-         %41 = OpLabel
-               OpBranch %7
          %34 = OpLabel
                OpBranch %36
+         %35 = OpLabel
+               OpBranch %52
+         %52 = OpLabel
+               OpStore %tint_loop_idx_0 %14
+               OpStore %j %int_0
+               OpBranch %55
+         %55 = OpLabel
+               OpLoopMerge %56 %54 None
+               OpBranch %53
+         %53 = OpLabel
+         %59 = OpLoad %v2uint %tint_loop_idx_0 None
+         %60 = OpIEqual %v2bool %59 %22
+         %61 = OpAll %bool %60
+               OpSelectionMerge %62 None
+               OpBranchConditional %61 %63 %62
+         %63 = OpLabel
+               OpBranch %56
+         %62 = OpLabel
+         %64 = OpLoad %int %j None
+         %65 = OpSLessThan %bool %64 %int_2
+               OpSelectionMerge %66 None
+               OpBranchConditional %65 %66 %67
+         %67 = OpLabel
+               OpBranch %56
+         %66 = OpLabel
+         %68 = OpLoad %int %j None
+               OpSelectionMerge %71 None
+               OpSwitch %68 %69 0 %70
+         %69 = OpLabel
+               OpBranch %71
+         %70 = OpLabel
+               OpBranch %54
+         %71 = OpLabel
+               OpBranch %54
+         %54 = OpLabel
+         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %73 = OpLoad %uint %72 None
+%tint_low_inc_1 = OpISub %uint %73 %uint_1
+         %75 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %75 %tint_low_inc_1 None
+         %76 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %76 %uint_1 %uint_0
+         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %79 = OpLoad %uint %78 None
+         %80 = OpISub %uint %79 %tint_carry_1
+         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %81 %80 None
+         %82 = OpLoad %int %j None
+         %83 = OpIAdd %int %82 %int_2
+               OpStore %j %83 None
+               OpBranch %55
+         %56 = OpLabel
+               OpBranch %7
          %36 = OpLabel
                OpBranch %7
           %7 = OpLabel
-         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %73 = OpLoad %uint %72 None
-%tint_low_inc = OpISub %uint %73 %uint_1
-         %75 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %75 %tint_low_inc None
-         %76 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %76 %uint_1 %uint_0
-         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %79 = OpLoad %uint %78 None
-         %80 = OpISub %uint %79 %tint_carry
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %81 %80 None
-         %82 = OpLoad %int %i None
-         %83 = OpIAdd %int %82 %int_2
-               OpStore %i %83 None
+         %37 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %40 = OpLoad %uint %37 None
+%tint_low_inc = OpISub %uint %40 %uint_1
+         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %43 %tint_low_inc None
+         %44 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %44 %uint_1 %uint_0
+         %46 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %47 = OpLoad %uint %46 None
+         %48 = OpISub %uint %47 %tint_carry
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %49 %48 None
+         %50 = OpLoad %int %i None
+         %51 = OpIAdd %int %50 %int_2
+               OpStore %i %51 None
                OpBranch %8
           %9 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loop_switch_loop_switch_robustness.wgsl.expected.spvasm b/test/tint/loops/nested_loop_switch_loop_switch_robustness.wgsl.expected.spvasm
index 595ec2d..7463eab 100644
--- a/test/tint/loops/nested_loop_switch_loop_switch_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_switch_loop_switch_robustness.wgsl.expected.spvasm
@@ -10,12 +10,12 @@
                OpName %main "main"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %j "j"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
        %uint = OpTypeInt 32 0
@@ -66,79 +66,79 @@
          %33 = OpLoad %int %i None
                OpSelectionMerge %36 None
                OpSwitch %33 %34 0 %35
-         %35 = OpLabel
-               OpBranch %37
-         %37 = OpLabel
-               OpStore %tint_loop_idx_0 %14
-               OpStore %j %int_0
-               OpBranch %40
-         %40 = OpLabel
-               OpLoopMerge %41 %39 None
-               OpBranch %38
-         %38 = OpLabel
-         %44 = OpLoad %v2uint %tint_loop_idx_0 None
-         %45 = OpIEqual %v2bool %44 %22
-         %46 = OpAll %bool %45
-               OpSelectionMerge %47 None
-               OpBranchConditional %46 %48 %47
-         %48 = OpLabel
-               OpBranch %41
-         %47 = OpLabel
-         %49 = OpLoad %int %j None
-         %50 = OpSLessThan %bool %49 %int_2
-               OpSelectionMerge %51 None
-               OpBranchConditional %50 %51 %52
-         %52 = OpLabel
-               OpBranch %41
-         %51 = OpLabel
-         %53 = OpLoad %int %j None
-               OpSelectionMerge %56 None
-               OpSwitch %53 %54 0 %55
-         %55 = OpLabel
-               OpBranch %39
-         %54 = OpLabel
-               OpBranch %56
-         %56 = OpLabel
-               OpBranch %39
-         %39 = OpLabel
-         %57 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %60 = OpLoad %uint %57 None
-%tint_low_inc_1 = OpISub %uint %60 %uint_1
-         %63 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %63 %tint_low_inc_1 None
-         %64 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %64 %uint_1 %uint_0
-         %66 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %67 = OpLoad %uint %66 None
-         %68 = OpISub %uint %67 %tint_carry_1
-         %69 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %69 %68 None
-         %70 = OpLoad %int %j None
-         %71 = OpIAdd %int %70 %int_2
-               OpStore %j %71 None
-               OpBranch %40
-         %41 = OpLabel
-               OpBranch %7
          %34 = OpLabel
                OpBranch %36
+         %35 = OpLabel
+               OpBranch %52
+         %52 = OpLabel
+               OpStore %tint_loop_idx_0 %14
+               OpStore %j %int_0
+               OpBranch %55
+         %55 = OpLabel
+               OpLoopMerge %56 %54 None
+               OpBranch %53
+         %53 = OpLabel
+         %59 = OpLoad %v2uint %tint_loop_idx_0 None
+         %60 = OpIEqual %v2bool %59 %22
+         %61 = OpAll %bool %60
+               OpSelectionMerge %62 None
+               OpBranchConditional %61 %63 %62
+         %63 = OpLabel
+               OpBranch %56
+         %62 = OpLabel
+         %64 = OpLoad %int %j None
+         %65 = OpSLessThan %bool %64 %int_2
+               OpSelectionMerge %66 None
+               OpBranchConditional %65 %66 %67
+         %67 = OpLabel
+               OpBranch %56
+         %66 = OpLabel
+         %68 = OpLoad %int %j None
+               OpSelectionMerge %71 None
+               OpSwitch %68 %69 0 %70
+         %69 = OpLabel
+               OpBranch %71
+         %70 = OpLabel
+               OpBranch %54
+         %71 = OpLabel
+               OpBranch %54
+         %54 = OpLabel
+         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %73 = OpLoad %uint %72 None
+%tint_low_inc_1 = OpISub %uint %73 %uint_1
+         %75 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %75 %tint_low_inc_1 None
+         %76 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %76 %uint_1 %uint_0
+         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %79 = OpLoad %uint %78 None
+         %80 = OpISub %uint %79 %tint_carry_1
+         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %81 %80 None
+         %82 = OpLoad %int %j None
+         %83 = OpIAdd %int %82 %int_2
+               OpStore %j %83 None
+               OpBranch %55
+         %56 = OpLabel
+               OpBranch %7
          %36 = OpLabel
                OpBranch %7
           %7 = OpLabel
-         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %73 = OpLoad %uint %72 None
-%tint_low_inc = OpISub %uint %73 %uint_1
-         %75 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %75 %tint_low_inc None
-         %76 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %76 %uint_1 %uint_0
-         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %79 = OpLoad %uint %78 None
-         %80 = OpISub %uint %79 %tint_carry
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %81 %80 None
-         %82 = OpLoad %int %i None
-         %83 = OpIAdd %int %82 %int_2
-               OpStore %i %83 None
+         %37 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %40 = OpLoad %uint %37 None
+%tint_low_inc = OpISub %uint %40 %uint_1
+         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %43 %tint_low_inc None
+         %44 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %44 %uint_1 %uint_0
+         %46 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %47 = OpLoad %uint %46 None
+         %48 = OpISub %uint %47 %tint_carry
+         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %49 %48 None
+         %50 = OpLoad %int %i None
+         %51 = OpIAdd %int %50 %int_2
+               OpStore %i %51 None
                OpBranch %8
           %9 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.spvasm b/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.spvasm
index 93290c9..8484bee 100644
--- a/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_switch_loop_switch_switch.wgsl.expected.spvasm
@@ -11,12 +11,12 @@
                OpName %k "k"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %j "j"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
         %int = OpTypeInt 32 1
@@ -69,89 +69,89 @@
          %34 = OpLoad %int %i None
                OpSelectionMerge %37 None
                OpSwitch %34 %35 0 %36
-         %36 = OpLabel
-               OpBranch %38
-         %38 = OpLabel
-               OpStore %tint_loop_idx_0 %18
-               OpStore %j %int_0
-               OpBranch %41
-         %41 = OpLabel
-               OpLoopMerge %42 %40 None
-               OpBranch %39
-         %39 = OpLabel
-         %45 = OpLoad %v2uint %tint_loop_idx_0 None
-         %46 = OpIEqual %v2bool %45 %23
-         %47 = OpAll %bool %46
-               OpSelectionMerge %48 None
-               OpBranchConditional %47 %49 %48
-         %49 = OpLabel
-               OpBranch %42
-         %48 = OpLabel
-         %50 = OpLoad %int %j None
-         %51 = OpSLessThan %bool %50 %int_2
-               OpSelectionMerge %52 None
-               OpBranchConditional %51 %52 %53
-         %53 = OpLabel
-               OpBranch %42
-         %52 = OpLabel
-         %54 = OpLoad %int %j None
-               OpSelectionMerge %58 None
-               OpSwitch %54 %55 0 %56 1 %57
-         %56 = OpLabel
-               OpBranch %40
-         %57 = OpLabel
-         %59 = OpLoad %int %k None
-               OpSelectionMerge %62 None
-               OpSwitch %59 %60 0 %61
-         %61 = OpLabel
-               OpBranch %40
-         %60 = OpLabel
-               OpBranch %62
-         %62 = OpLabel
-               OpBranch %58
-         %55 = OpLabel
-               OpBranch %58
-         %58 = OpLabel
-               OpBranch %40
-         %40 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %66 = OpLoad %uint %63 None
-%tint_low_inc_1 = OpISub %uint %66 %uint_1
-         %69 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %69 %tint_low_inc_1 None
-         %70 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %70 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %73 = OpLoad %uint %72 None
-         %74 = OpISub %uint %73 %tint_carry_1
-         %75 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %75 %74 None
-         %76 = OpLoad %int %j None
-         %77 = OpIAdd %int %76 %int_2
-               OpStore %j %77 None
-               OpBranch %41
-         %42 = OpLabel
-               OpBranch %11
          %35 = OpLabel
                OpBranch %37
+         %36 = OpLabel
+               OpBranch %53
+         %53 = OpLabel
+               OpStore %tint_loop_idx_0 %18
+               OpStore %j %int_0
+               OpBranch %56
+         %56 = OpLabel
+               OpLoopMerge %57 %55 None
+               OpBranch %54
+         %54 = OpLabel
+         %60 = OpLoad %v2uint %tint_loop_idx_0 None
+         %61 = OpIEqual %v2bool %60 %23
+         %62 = OpAll %bool %61
+               OpSelectionMerge %63 None
+               OpBranchConditional %62 %64 %63
+         %64 = OpLabel
+               OpBranch %57
+         %63 = OpLabel
+         %65 = OpLoad %int %j None
+         %66 = OpSLessThan %bool %65 %int_2
+               OpSelectionMerge %67 None
+               OpBranchConditional %66 %67 %68
+         %68 = OpLabel
+               OpBranch %57
+         %67 = OpLabel
+         %69 = OpLoad %int %j None
+               OpSelectionMerge %73 None
+               OpSwitch %69 %70 0 %71 1 %72
+         %70 = OpLabel
+               OpBranch %73
+         %71 = OpLabel
+               OpBranch %55
+         %72 = OpLabel
+         %86 = OpLoad %int %k None
+               OpSelectionMerge %89 None
+               OpSwitch %86 %87 0 %88
+         %87 = OpLabel
+               OpBranch %89
+         %88 = OpLabel
+               OpBranch %55
+         %89 = OpLabel
+               OpBranch %73
+         %73 = OpLabel
+               OpBranch %55
+         %55 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %75 = OpLoad %uint %74 None
+%tint_low_inc_1 = OpISub %uint %75 %uint_1
+         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %77 %tint_low_inc_1 None
+         %78 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %78 %uint_1 %uint_0
+         %80 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %81 = OpLoad %uint %80 None
+         %82 = OpISub %uint %81 %tint_carry_1
+         %83 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %83 %82 None
+         %84 = OpLoad %int %j None
+         %85 = OpIAdd %int %84 %int_2
+               OpStore %j %85 None
+               OpBranch %56
+         %57 = OpLabel
+               OpBranch %11
          %37 = OpLabel
                OpBranch %11
          %11 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %79 = OpLoad %uint %78 None
-%tint_low_inc = OpISub %uint %79 %uint_1
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %81 %tint_low_inc None
-         %82 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %82 %uint_1 %uint_0
-         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %85 = OpLoad %uint %84 None
-         %86 = OpISub %uint %85 %tint_carry
-         %87 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %87 %86 None
-         %88 = OpLoad %int %i None
-         %89 = OpIAdd %int %88 %int_2
-               OpStore %i %89 None
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %41 = OpLoad %uint %38 None
+%tint_low_inc = OpISub %uint %41 %uint_1
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %44 %tint_low_inc None
+         %45 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %45 %uint_1 %uint_0
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %48 = OpLoad %uint %47 None
+         %49 = OpISub %uint %48 %tint_carry
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %50 %49 None
+         %51 = OpLoad %int %i None
+         %52 = OpIAdd %int %51 %int_2
+               OpStore %i %52 None
                OpBranch %12
          %13 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loop_switch_loop_switch_switch_robustness.wgsl.expected.spvasm b/test/tint/loops/nested_loop_switch_loop_switch_switch_robustness.wgsl.expected.spvasm
index 93290c9..8484bee 100644
--- a/test/tint/loops/nested_loop_switch_loop_switch_switch_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_switch_loop_switch_switch_robustness.wgsl.expected.spvasm
@@ -11,12 +11,12 @@
                OpName %k "k"
                OpName %tint_loop_idx "tint_loop_idx"
                OpName %i "i"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %j "j"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
         %int = OpTypeInt 32 1
@@ -69,89 +69,89 @@
          %34 = OpLoad %int %i None
                OpSelectionMerge %37 None
                OpSwitch %34 %35 0 %36
-         %36 = OpLabel
-               OpBranch %38
-         %38 = OpLabel
-               OpStore %tint_loop_idx_0 %18
-               OpStore %j %int_0
-               OpBranch %41
-         %41 = OpLabel
-               OpLoopMerge %42 %40 None
-               OpBranch %39
-         %39 = OpLabel
-         %45 = OpLoad %v2uint %tint_loop_idx_0 None
-         %46 = OpIEqual %v2bool %45 %23
-         %47 = OpAll %bool %46
-               OpSelectionMerge %48 None
-               OpBranchConditional %47 %49 %48
-         %49 = OpLabel
-               OpBranch %42
-         %48 = OpLabel
-         %50 = OpLoad %int %j None
-         %51 = OpSLessThan %bool %50 %int_2
-               OpSelectionMerge %52 None
-               OpBranchConditional %51 %52 %53
-         %53 = OpLabel
-               OpBranch %42
-         %52 = OpLabel
-         %54 = OpLoad %int %j None
-               OpSelectionMerge %58 None
-               OpSwitch %54 %55 0 %56 1 %57
-         %56 = OpLabel
-               OpBranch %40
-         %57 = OpLabel
-         %59 = OpLoad %int %k None
-               OpSelectionMerge %62 None
-               OpSwitch %59 %60 0 %61
-         %61 = OpLabel
-               OpBranch %40
-         %60 = OpLabel
-               OpBranch %62
-         %62 = OpLabel
-               OpBranch %58
-         %55 = OpLabel
-               OpBranch %58
-         %58 = OpLabel
-               OpBranch %40
-         %40 = OpLabel
-         %63 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %66 = OpLoad %uint %63 None
-%tint_low_inc_1 = OpISub %uint %66 %uint_1
-         %69 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %69 %tint_low_inc_1 None
-         %70 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %70 %uint_1 %uint_0
-         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %73 = OpLoad %uint %72 None
-         %74 = OpISub %uint %73 %tint_carry_1
-         %75 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %75 %74 None
-         %76 = OpLoad %int %j None
-         %77 = OpIAdd %int %76 %int_2
-               OpStore %j %77 None
-               OpBranch %41
-         %42 = OpLabel
-               OpBranch %11
          %35 = OpLabel
                OpBranch %37
+         %36 = OpLabel
+               OpBranch %53
+         %53 = OpLabel
+               OpStore %tint_loop_idx_0 %18
+               OpStore %j %int_0
+               OpBranch %56
+         %56 = OpLabel
+               OpLoopMerge %57 %55 None
+               OpBranch %54
+         %54 = OpLabel
+         %60 = OpLoad %v2uint %tint_loop_idx_0 None
+         %61 = OpIEqual %v2bool %60 %23
+         %62 = OpAll %bool %61
+               OpSelectionMerge %63 None
+               OpBranchConditional %62 %64 %63
+         %64 = OpLabel
+               OpBranch %57
+         %63 = OpLabel
+         %65 = OpLoad %int %j None
+         %66 = OpSLessThan %bool %65 %int_2
+               OpSelectionMerge %67 None
+               OpBranchConditional %66 %67 %68
+         %68 = OpLabel
+               OpBranch %57
+         %67 = OpLabel
+         %69 = OpLoad %int %j None
+               OpSelectionMerge %73 None
+               OpSwitch %69 %70 0 %71 1 %72
+         %70 = OpLabel
+               OpBranch %73
+         %71 = OpLabel
+               OpBranch %55
+         %72 = OpLabel
+         %86 = OpLoad %int %k None
+               OpSelectionMerge %89 None
+               OpSwitch %86 %87 0 %88
+         %87 = OpLabel
+               OpBranch %89
+         %88 = OpLabel
+               OpBranch %55
+         %89 = OpLabel
+               OpBranch %73
+         %73 = OpLabel
+               OpBranch %55
+         %55 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %75 = OpLoad %uint %74 None
+%tint_low_inc_1 = OpISub %uint %75 %uint_1
+         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %77 %tint_low_inc_1 None
+         %78 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %78 %uint_1 %uint_0
+         %80 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %81 = OpLoad %uint %80 None
+         %82 = OpISub %uint %81 %tint_carry_1
+         %83 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %83 %82 None
+         %84 = OpLoad %int %j None
+         %85 = OpIAdd %int %84 %int_2
+               OpStore %j %85 None
+               OpBranch %56
+         %57 = OpLabel
+               OpBranch %11
          %37 = OpLabel
                OpBranch %11
          %11 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %79 = OpLoad %uint %78 None
-%tint_low_inc = OpISub %uint %79 %uint_1
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %81 %tint_low_inc None
-         %82 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %82 %uint_1 %uint_0
-         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %85 = OpLoad %uint %84 None
-         %86 = OpISub %uint %85 %tint_carry
-         %87 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %87 %86 None
-         %88 = OpLoad %int %i None
-         %89 = OpIAdd %int %88 %int_2
-               OpStore %i %89 None
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %41 = OpLoad %uint %38 None
+%tint_low_inc = OpISub %uint %41 %uint_1
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %44 %tint_low_inc None
+         %45 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %45 %uint_1 %uint_0
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %48 = OpLoad %uint %47 None
+         %49 = OpISub %uint %48 %tint_carry
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %50 %49 None
+         %51 = OpLoad %int %i None
+         %52 = OpIAdd %int %51 %int_2
+               OpStore %i %52 None
                OpBranch %12
          %13 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loop_switch_switch.wgsl.expected.spvasm b/test/tint/loops/nested_loop_switch_switch.wgsl.expected.spvasm
index 2b6ba7f..458006a 100644
--- a/test/tint/loops/nested_loop_switch_switch.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_switch_switch.wgsl.expected.spvasm
@@ -63,36 +63,36 @@
          %34 = OpLoad %int %i None
                OpSelectionMerge %37 None
                OpSwitch %34 %35 0 %36
-         %36 = OpLabel
-         %38 = OpLoad %int %j None
-               OpSelectionMerge %41 None
-               OpSwitch %38 %39 0 %40
-         %40 = OpLabel
-               OpBranch %11
-         %39 = OpLabel
-               OpBranch %41
-         %41 = OpLabel
-               OpBranch %37
          %35 = OpLabel
                OpBranch %37
+         %36 = OpLabel
+         %53 = OpLoad %int %j None
+               OpSelectionMerge %56 None
+               OpSwitch %53 %54 0 %55
+         %54 = OpLabel
+               OpBranch %56
+         %55 = OpLabel
+               OpBranch %11
+         %56 = OpLabel
+               OpBranch %37
          %37 = OpLabel
                OpBranch %11
          %11 = OpLabel
-         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %45 = OpLoad %uint %42 None
-%tint_low_inc = OpISub %uint %45 %uint_1
-         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %48 %tint_low_inc None
-         %49 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %49 %uint_1 %uint_0
-         %51 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %52 = OpLoad %uint %51 None
-         %53 = OpISub %uint %52 %tint_carry
-         %54 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %54 %53 None
-         %55 = OpLoad %int %i None
-         %56 = OpIAdd %int %55 %int_2
-               OpStore %i %56 None
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %41 = OpLoad %uint %38 None
+%tint_low_inc = OpISub %uint %41 %uint_1
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %44 %tint_low_inc None
+         %45 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %45 %uint_1 %uint_0
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %48 = OpLoad %uint %47 None
+         %49 = OpISub %uint %48 %tint_carry
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %50 %49 None
+         %51 = OpLoad %int %i None
+         %52 = OpIAdd %int %51 %int_2
+               OpStore %i %52 None
                OpBranch %12
          %13 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loop_switch_switch_robustness.wgsl.expected.spvasm b/test/tint/loops/nested_loop_switch_switch_robustness.wgsl.expected.spvasm
index 2b6ba7f..458006a 100644
--- a/test/tint/loops/nested_loop_switch_switch_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loop_switch_switch_robustness.wgsl.expected.spvasm
@@ -63,36 +63,36 @@
          %34 = OpLoad %int %i None
                OpSelectionMerge %37 None
                OpSwitch %34 %35 0 %36
-         %36 = OpLabel
-         %38 = OpLoad %int %j None
-               OpSelectionMerge %41 None
-               OpSwitch %38 %39 0 %40
-         %40 = OpLabel
-               OpBranch %11
-         %39 = OpLabel
-               OpBranch %41
-         %41 = OpLabel
-               OpBranch %37
          %35 = OpLabel
                OpBranch %37
+         %36 = OpLabel
+         %53 = OpLoad %int %j None
+               OpSelectionMerge %56 None
+               OpSwitch %53 %54 0 %55
+         %54 = OpLabel
+               OpBranch %56
+         %55 = OpLabel
+               OpBranch %11
+         %56 = OpLabel
+               OpBranch %37
          %37 = OpLabel
                OpBranch %11
          %11 = OpLabel
-         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %45 = OpLoad %uint %42 None
-%tint_low_inc = OpISub %uint %45 %uint_1
-         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %48 %tint_low_inc None
-         %49 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %49 %uint_1 %uint_0
-         %51 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %52 = OpLoad %uint %51 None
-         %53 = OpISub %uint %52 %tint_carry
-         %54 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %54 %53 None
-         %55 = OpLoad %int %i None
-         %56 = OpIAdd %int %55 %int_2
-               OpStore %i %56 None
+         %38 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %41 = OpLoad %uint %38 None
+%tint_low_inc = OpISub %uint %41 %uint_1
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %44 %tint_low_inc None
+         %45 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %45 %uint_1 %uint_0
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %48 = OpLoad %uint %47 None
+         %49 = OpISub %uint %48 %tint_carry
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %50 %49 None
+         %51 = OpLoad %int %i None
+         %52 = OpIAdd %int %51 %int_2
+               OpStore %i %52 None
                OpBranch %12
          %13 = OpLabel
                OpReturn
diff --git a/test/tint/loops/nested_loops.wgsl.expected.spvasm b/test/tint/loops/nested_loops.wgsl.expected.spvasm
index d9a5acf..df3b7fa 100644
--- a/test/tint/loops/nested_loops.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loops.wgsl.expected.spvasm
@@ -13,11 +13,11 @@
                OpName %i "i"
                OpName %j "j"
                OpName %tint_loop_idx "tint_loop_idx"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
                OpName %unused_entry_point "unused_entry_point"
         %int = OpTypeInt 32 1
           %3 = OpTypeFunction %int
@@ -30,16 +30,16 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %27 = OpConstantNull %v2uint
+         %24 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %28 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_1 = OpConstant %int 1
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
-      %int_2 = OpConstant %int 2
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
+      %false = OpConstantFalse %bool
+      %int_2 = OpConstant %int 2
        %void = OpTypeVoid
          %91 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -53,106 +53,106 @@
                OpStore %continue_execution %true
                OpBranch %14
          %14 = OpLabel
-               OpStore %tint_loop_idx %23
+               OpStore %tint_loop_idx %24
                OpBranch %17
          %17 = OpLabel
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %25 = OpLoad %v2uint %tint_loop_idx None
-         %26 = OpIEqual %v2bool %25 %27
-         %29 = OpAll %bool %26
-               OpSelectionMerge %30 None
-               OpBranchConditional %29 %31 %30
-         %31 = OpLabel
+         %26 = OpLoad %v2uint %tint_loop_idx None
+         %27 = OpIEqual %v2bool %26 %28
+         %30 = OpAll %bool %27
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
+         %32 = OpLabel
                OpBranch %18
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpIAdd %int %32 %int_1
-               OpStore %i %33 None
-         %35 = OpLoad %int %i None
-         %36 = OpSGreaterThan %bool %35 %int_4
-               OpSelectionMerge %38 None
-               OpBranchConditional %36 %39 %38
-         %39 = OpLabel
+         %31 = OpLabel
+         %33 = OpLoad %int %i None
+         %34 = OpIAdd %int %33 %int_1
+               OpStore %i %34 None
+         %36 = OpLoad %int %i None
+         %37 = OpSGreaterThan %bool %36 %int_4
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpStore %continue_execution %false None
                OpStore %return_value %int_1 None
-               OpBranch %38
-         %38 = OpLabel
+               OpBranch %39
+         %39 = OpLabel
          %41 = OpLoad %bool %continue_execution None
                OpSelectionMerge %42 None
                OpBranchConditional %41 %43 %42
          %43 = OpLabel
-               OpBranch %44
-         %44 = OpLabel
-               OpStore %tint_loop_idx_0 %23
-               OpBranch %47
-         %47 = OpLabel
-               OpLoopMerge %48 %46 None
-               OpBranch %45
-         %45 = OpLabel
-         %50 = OpLoad %v2uint %tint_loop_idx_0 None
-         %51 = OpIEqual %v2bool %50 %27
-         %52 = OpAll %bool %51
-               OpSelectionMerge %53 None
-               OpBranchConditional %52 %54 %53
-         %54 = OpLabel
-               OpBranch %48
-         %53 = OpLabel
-         %55 = OpLoad %int %j None
-         %56 = OpIAdd %int %55 %int_1
-               OpStore %j %56 None
-         %57 = OpLoad %int %j None
-         %58 = OpSGreaterThan %bool %57 %int_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpStore %continue_execution %false None
-               OpStore %return_value %int_2 None
+               OpBranch %58
+         %58 = OpLabel
+               OpStore %tint_loop_idx_0 %24
+               OpBranch %61
+         %61 = OpLabel
+               OpLoopMerge %62 %60 None
                OpBranch %59
          %59 = OpLabel
-         %62 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %63 None
-               OpBranchConditional %62 %64 %63
-         %64 = OpLabel
-               OpBranch %46
-         %63 = OpLabel
-               OpBranch %48
-         %46 = OpLabel
-         %65 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %68 = OpLoad %uint %65 None
-%tint_low_inc_1 = OpISub %uint %68 %uint_1
-         %71 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %71 %tint_low_inc_1 None
-         %72 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %72 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %75 = OpLoad %uint %74 None
-         %76 = OpISub %uint %75 %tint_carry_1
-         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %77 %76 None
-               OpBranch %47
-         %48 = OpLabel
+         %64 = OpLoad %v2uint %tint_loop_idx_0 None
+         %65 = OpIEqual %v2bool %64 %28
+         %66 = OpAll %bool %65
+               OpSelectionMerge %67 None
+               OpBranchConditional %66 %68 %67
+         %68 = OpLabel
+               OpBranch %62
+         %67 = OpLabel
+         %69 = OpLoad %int %j None
+         %70 = OpIAdd %int %69 %int_1
+               OpStore %j %70 None
+         %71 = OpLoad %int %j None
+         %72 = OpSGreaterThan %bool %71 %int_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %72 %74 %73
+         %74 = OpLabel
+               OpStore %continue_execution %false None
+               OpStore %return_value %int_2 None
+               OpBranch %73
+         %73 = OpLabel
+         %75 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %76 None
+               OpBranchConditional %75 %77 %76
+         %77 = OpLabel
+               OpBranch %60
+         %76 = OpLabel
+               OpBranch %62
+         %60 = OpLabel
+         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %79 = OpLoad %uint %78 None
+%tint_low_inc_1 = OpISub %uint %79 %uint_1
+         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %81 %tint_low_inc_1 None
+         %82 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %82 %uint_1 %uint_0
+         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %85 = OpLoad %uint %84 None
+         %86 = OpISub %uint %85 %tint_carry_1
+         %87 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %87 %86 None
+               OpBranch %61
+         %62 = OpLabel
                OpBranch %42
          %42 = OpLabel
                OpBranch %18
          %16 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %79 = OpLoad %uint %78 None
-%tint_low_inc = OpISub %uint %79 %uint_1
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %81 %tint_low_inc None
-         %82 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %82 %uint_1 %uint_0
-         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %85 = OpLoad %uint %84 None
-         %86 = OpISub %uint %85 %tint_carry
-         %87 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %87 %86 None
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %47 = OpLoad %uint %44 None
+%tint_low_inc = OpISub %uint %47 %uint_1
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %50 %tint_low_inc None
+         %51 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %51 %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %54 = OpLoad %uint %53 None
+         %55 = OpISub %uint %54 %tint_carry
+         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %56 %55 None
                OpBranch %17
          %18 = OpLabel
-         %88 = OpLoad %int %return_value None
-               OpReturnValue %88
+         %19 = OpLoad %int %return_value None
+               OpReturnValue %19
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %91
          %92 = OpLabel
diff --git a/test/tint/loops/nested_loops_robustness.wgsl.expected.spvasm b/test/tint/loops/nested_loops_robustness.wgsl.expected.spvasm
index d9a5acf..df3b7fa 100644
--- a/test/tint/loops/nested_loops_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loops_robustness.wgsl.expected.spvasm
@@ -13,11 +13,11 @@
                OpName %i "i"
                OpName %j "j"
                OpName %tint_loop_idx "tint_loop_idx"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
                OpName %unused_entry_point "unused_entry_point"
         %int = OpTypeInt 32 1
           %3 = OpTypeFunction %int
@@ -30,16 +30,16 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %27 = OpConstantNull %v2uint
+         %24 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %28 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_1 = OpConstant %int 1
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
-      %int_2 = OpConstant %int 2
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
+      %false = OpConstantFalse %bool
+      %int_2 = OpConstant %int 2
        %void = OpTypeVoid
          %91 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -53,106 +53,106 @@
                OpStore %continue_execution %true
                OpBranch %14
          %14 = OpLabel
-               OpStore %tint_loop_idx %23
+               OpStore %tint_loop_idx %24
                OpBranch %17
          %17 = OpLabel
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %25 = OpLoad %v2uint %tint_loop_idx None
-         %26 = OpIEqual %v2bool %25 %27
-         %29 = OpAll %bool %26
-               OpSelectionMerge %30 None
-               OpBranchConditional %29 %31 %30
-         %31 = OpLabel
+         %26 = OpLoad %v2uint %tint_loop_idx None
+         %27 = OpIEqual %v2bool %26 %28
+         %30 = OpAll %bool %27
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
+         %32 = OpLabel
                OpBranch %18
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpIAdd %int %32 %int_1
-               OpStore %i %33 None
-         %35 = OpLoad %int %i None
-         %36 = OpSGreaterThan %bool %35 %int_4
-               OpSelectionMerge %38 None
-               OpBranchConditional %36 %39 %38
-         %39 = OpLabel
+         %31 = OpLabel
+         %33 = OpLoad %int %i None
+         %34 = OpIAdd %int %33 %int_1
+               OpStore %i %34 None
+         %36 = OpLoad %int %i None
+         %37 = OpSGreaterThan %bool %36 %int_4
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpStore %continue_execution %false None
                OpStore %return_value %int_1 None
-               OpBranch %38
-         %38 = OpLabel
+               OpBranch %39
+         %39 = OpLabel
          %41 = OpLoad %bool %continue_execution None
                OpSelectionMerge %42 None
                OpBranchConditional %41 %43 %42
          %43 = OpLabel
-               OpBranch %44
-         %44 = OpLabel
-               OpStore %tint_loop_idx_0 %23
-               OpBranch %47
-         %47 = OpLabel
-               OpLoopMerge %48 %46 None
-               OpBranch %45
-         %45 = OpLabel
-         %50 = OpLoad %v2uint %tint_loop_idx_0 None
-         %51 = OpIEqual %v2bool %50 %27
-         %52 = OpAll %bool %51
-               OpSelectionMerge %53 None
-               OpBranchConditional %52 %54 %53
-         %54 = OpLabel
-               OpBranch %48
-         %53 = OpLabel
-         %55 = OpLoad %int %j None
-         %56 = OpIAdd %int %55 %int_1
-               OpStore %j %56 None
-         %57 = OpLoad %int %j None
-         %58 = OpSGreaterThan %bool %57 %int_4
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
-         %60 = OpLabel
-               OpStore %continue_execution %false None
-               OpStore %return_value %int_2 None
+               OpBranch %58
+         %58 = OpLabel
+               OpStore %tint_loop_idx_0 %24
+               OpBranch %61
+         %61 = OpLabel
+               OpLoopMerge %62 %60 None
                OpBranch %59
          %59 = OpLabel
-         %62 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %63 None
-               OpBranchConditional %62 %64 %63
-         %64 = OpLabel
-               OpBranch %46
-         %63 = OpLabel
-               OpBranch %48
-         %46 = OpLabel
-         %65 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %68 = OpLoad %uint %65 None
-%tint_low_inc_1 = OpISub %uint %68 %uint_1
-         %71 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %71 %tint_low_inc_1 None
-         %72 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %72 %uint_1 %uint_0
-         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %75 = OpLoad %uint %74 None
-         %76 = OpISub %uint %75 %tint_carry_1
-         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %77 %76 None
-               OpBranch %47
-         %48 = OpLabel
+         %64 = OpLoad %v2uint %tint_loop_idx_0 None
+         %65 = OpIEqual %v2bool %64 %28
+         %66 = OpAll %bool %65
+               OpSelectionMerge %67 None
+               OpBranchConditional %66 %68 %67
+         %68 = OpLabel
+               OpBranch %62
+         %67 = OpLabel
+         %69 = OpLoad %int %j None
+         %70 = OpIAdd %int %69 %int_1
+               OpStore %j %70 None
+         %71 = OpLoad %int %j None
+         %72 = OpSGreaterThan %bool %71 %int_4
+               OpSelectionMerge %73 None
+               OpBranchConditional %72 %74 %73
+         %74 = OpLabel
+               OpStore %continue_execution %false None
+               OpStore %return_value %int_2 None
+               OpBranch %73
+         %73 = OpLabel
+         %75 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %76 None
+               OpBranchConditional %75 %77 %76
+         %77 = OpLabel
+               OpBranch %60
+         %76 = OpLabel
+               OpBranch %62
+         %60 = OpLabel
+         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %79 = OpLoad %uint %78 None
+%tint_low_inc_1 = OpISub %uint %79 %uint_1
+         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %81 %tint_low_inc_1 None
+         %82 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %82 %uint_1 %uint_0
+         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %85 = OpLoad %uint %84 None
+         %86 = OpISub %uint %85 %tint_carry_1
+         %87 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %87 %86 None
+               OpBranch %61
+         %62 = OpLabel
                OpBranch %42
          %42 = OpLabel
                OpBranch %18
          %16 = OpLabel
-         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %79 = OpLoad %uint %78 None
-%tint_low_inc = OpISub %uint %79 %uint_1
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %81 %tint_low_inc None
-         %82 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %82 %uint_1 %uint_0
-         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %85 = OpLoad %uint %84 None
-         %86 = OpISub %uint %85 %tint_carry
-         %87 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %87 %86 None
+         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %47 = OpLoad %uint %44 None
+%tint_low_inc = OpISub %uint %47 %uint_1
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %50 %tint_low_inc None
+         %51 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %51 %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %54 = OpLoad %uint %53 None
+         %55 = OpISub %uint %54 %tint_carry
+         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %56 %55 None
                OpBranch %17
          %18 = OpLabel
-         %88 = OpLoad %int %return_value None
-               OpReturnValue %88
+         %19 = OpLoad %int %return_value None
+               OpReturnValue %19
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %91
          %92 = OpLabel
diff --git a/test/tint/loops/nested_loops_with_continuing.wgsl.expected.spvasm b/test/tint/loops/nested_loops_with_continuing.wgsl.expected.spvasm
index 69c96e7..99f96c1 100644
--- a/test/tint/loops/nested_loops_with_continuing.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loops_with_continuing.wgsl.expected.spvasm
@@ -13,11 +13,11 @@
                OpName %i "i"
                OpName %j "j"
                OpName %tint_loop_idx "tint_loop_idx"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
                OpName %unused_entry_point "unused_entry_point"
         %int = OpTypeInt 32 1
           %3 = OpTypeFunction %int
@@ -30,16 +30,16 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %27 = OpConstantNull %v2uint
+         %24 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %28 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
-      %int_1 = OpConstant %int 1
-      %int_2 = OpConstant %int 2
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
+      %false = OpConstantFalse %bool
+      %int_1 = OpConstant %int 1
+      %int_2 = OpConstant %int 2
        %void = OpTypeVoid
          %89 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -53,103 +53,103 @@
                OpStore %continue_execution %true
                OpBranch %14
          %14 = OpLabel
-               OpStore %tint_loop_idx %23
+               OpStore %tint_loop_idx %24
                OpBranch %17
          %17 = OpLabel
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %25 = OpLoad %v2uint %tint_loop_idx None
-         %26 = OpIEqual %v2bool %25 %27
-         %29 = OpAll %bool %26
-               OpSelectionMerge %30 None
-               OpBranchConditional %29 %31 %30
-         %31 = OpLabel
+         %26 = OpLoad %v2uint %tint_loop_idx None
+         %27 = OpIEqual %v2bool %26 %28
+         %30 = OpAll %bool %27
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
+         %32 = OpLabel
                OpBranch %18
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpSGreaterThan %bool %32 %int_4
-               OpSelectionMerge %35 None
-               OpBranchConditional %33 %36 %35
-         %36 = OpLabel
+         %31 = OpLabel
+         %33 = OpLoad %int %i None
+         %34 = OpSGreaterThan %bool %33 %int_4
+               OpSelectionMerge %36 None
+               OpBranchConditional %34 %37 %36
+         %37 = OpLabel
                OpStore %continue_execution %false None
                OpStore %return_value %int_1 None
-               OpBranch %35
-         %35 = OpLabel
-         %39 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %40 None
-               OpBranchConditional %39 %41 %40
-         %41 = OpLabel
-               OpBranch %42
-         %42 = OpLabel
-               OpStore %tint_loop_idx_0 %23
-               OpBranch %45
-         %45 = OpLabel
-               OpLoopMerge %46 %44 None
-               OpBranch %43
-         %43 = OpLabel
-         %48 = OpLoad %v2uint %tint_loop_idx_0 None
-         %49 = OpIEqual %v2bool %48 %27
-         %50 = OpAll %bool %49
-               OpSelectionMerge %51 None
-               OpBranchConditional %50 %52 %51
-         %52 = OpLabel
-               OpBranch %46
-         %51 = OpLabel
-         %53 = OpLoad %int %j None
-         %54 = OpSGreaterThan %bool %53 %int_4
-               OpSelectionMerge %55 None
-               OpBranchConditional %54 %56 %55
+               OpBranch %36
+         %36 = OpLabel
+         %38 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %39 None
+               OpBranchConditional %38 %40 %39
+         %40 = OpLabel
+               OpBranch %56
          %56 = OpLabel
+               OpStore %tint_loop_idx_0 %24
+               OpBranch %59
+         %59 = OpLabel
+               OpLoopMerge %60 %58 None
+               OpBranch %57
+         %57 = OpLabel
+         %62 = OpLoad %v2uint %tint_loop_idx_0 None
+         %63 = OpIEqual %v2bool %62 %28
+         %64 = OpAll %bool %63
+               OpSelectionMerge %65 None
+               OpBranchConditional %64 %66 %65
+         %66 = OpLabel
+               OpBranch %60
+         %65 = OpLabel
+         %67 = OpLoad %int %j None
+         %68 = OpSGreaterThan %bool %67 %int_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %68 %70 %69
+         %70 = OpLabel
                OpStore %continue_execution %false None
                OpStore %return_value %int_2 None
-               OpBranch %55
-         %55 = OpLabel
-         %58 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
+               OpBranch %69
+         %69 = OpLabel
+         %71 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %72 None
+               OpBranchConditional %71 %73 %72
+         %73 = OpLabel
+               OpBranch %58
+         %72 = OpLabel
+               OpBranch %60
+         %58 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %75 = OpLoad %uint %74 None
+%tint_low_inc_1 = OpISub %uint %75 %uint_1
+         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %77 %tint_low_inc_1 None
+         %78 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %78 %uint_1 %uint_0
+         %80 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %81 = OpLoad %uint %80 None
+         %82 = OpISub %uint %81 %tint_carry_1
+         %83 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %83 %82 None
+         %84 = OpLoad %int %j None
+         %85 = OpIAdd %int %84 %int_1
+               OpStore %j %85 None
+               OpBranch %59
          %60 = OpLabel
-               OpBranch %44
-         %59 = OpLabel
-               OpBranch %46
-         %44 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %64 = OpLoad %uint %61 None
-%tint_low_inc_1 = OpISub %uint %64 %uint_1
-         %67 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %67 %tint_low_inc_1 None
-         %68 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %68 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %71 = OpLoad %uint %70 None
-         %72 = OpISub %uint %71 %tint_carry_1
-         %73 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %73 %72 None
-         %74 = OpLoad %int %j None
-         %75 = OpIAdd %int %74 %int_1
-               OpStore %j %75 None
-               OpBranch %45
-         %46 = OpLabel
-               OpBranch %40
-         %40 = OpLabel
+               OpBranch %39
+         %39 = OpLabel
                OpBranch %18
          %16 = OpLabel
-         %76 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %77 = OpLoad %uint %76 None
-%tint_low_inc = OpISub %uint %77 %uint_1
-         %79 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %79 %tint_low_inc None
-         %80 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %80 %uint_1 %uint_0
-         %82 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %83 = OpLoad %uint %82 None
-         %84 = OpISub %uint %83 %tint_carry
-         %85 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %85 %84 None
+         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %44 = OpLoad %uint %41 None
+%tint_low_inc = OpISub %uint %44 %uint_1
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %47 %tint_low_inc None
+         %48 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %48 %uint_1 %uint_0
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %51 = OpLoad %uint %50 None
+         %52 = OpISub %uint %51 %tint_carry
+         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %53 %52 None
                OpBranch %17
          %18 = OpLabel
-         %86 = OpLoad %int %return_value None
-               OpReturnValue %86
+         %19 = OpLoad %int %return_value None
+               OpReturnValue %19
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %89
          %90 = OpLabel
diff --git a/test/tint/loops/nested_loops_with_continuing_robustness.wgsl.expected.spvasm b/test/tint/loops/nested_loops_with_continuing_robustness.wgsl.expected.spvasm
index 69c96e7..99f96c1 100644
--- a/test/tint/loops/nested_loops_with_continuing_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/nested_loops_with_continuing_robustness.wgsl.expected.spvasm
@@ -13,11 +13,11 @@
                OpName %i "i"
                OpName %j "j"
                OpName %tint_loop_idx "tint_loop_idx"
+               OpName %tint_low_inc "tint_low_inc"
+               OpName %tint_carry "tint_carry"
                OpName %tint_loop_idx_0 "tint_loop_idx"
                OpName %tint_low_inc_1 "tint_low_inc_1"
                OpName %tint_carry_1 "tint_carry_1"
-               OpName %tint_low_inc "tint_low_inc"
-               OpName %tint_carry "tint_carry"
                OpName %unused_entry_point "unused_entry_point"
         %int = OpTypeInt 32 1
           %3 = OpTypeFunction %int
@@ -30,16 +30,16 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %27 = OpConstantNull %v2uint
+         %24 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %28 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
-      %false = OpConstantFalse %bool
-      %int_1 = OpConstant %int 1
-      %int_2 = OpConstant %int 2
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
+      %false = OpConstantFalse %bool
+      %int_1 = OpConstant %int 1
+      %int_2 = OpConstant %int 2
        %void = OpTypeVoid
          %89 = OpTypeFunction %void
           %f = OpFunction %int None %3
@@ -53,103 +53,103 @@
                OpStore %continue_execution %true
                OpBranch %14
          %14 = OpLabel
-               OpStore %tint_loop_idx %23
+               OpStore %tint_loop_idx %24
                OpBranch %17
          %17 = OpLabel
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %25 = OpLoad %v2uint %tint_loop_idx None
-         %26 = OpIEqual %v2bool %25 %27
-         %29 = OpAll %bool %26
-               OpSelectionMerge %30 None
-               OpBranchConditional %29 %31 %30
-         %31 = OpLabel
+         %26 = OpLoad %v2uint %tint_loop_idx None
+         %27 = OpIEqual %v2bool %26 %28
+         %30 = OpAll %bool %27
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
+         %32 = OpLabel
                OpBranch %18
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpSGreaterThan %bool %32 %int_4
-               OpSelectionMerge %35 None
-               OpBranchConditional %33 %36 %35
-         %36 = OpLabel
+         %31 = OpLabel
+         %33 = OpLoad %int %i None
+         %34 = OpSGreaterThan %bool %33 %int_4
+               OpSelectionMerge %36 None
+               OpBranchConditional %34 %37 %36
+         %37 = OpLabel
                OpStore %continue_execution %false None
                OpStore %return_value %int_1 None
-               OpBranch %35
-         %35 = OpLabel
-         %39 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %40 None
-               OpBranchConditional %39 %41 %40
-         %41 = OpLabel
-               OpBranch %42
-         %42 = OpLabel
-               OpStore %tint_loop_idx_0 %23
-               OpBranch %45
-         %45 = OpLabel
-               OpLoopMerge %46 %44 None
-               OpBranch %43
-         %43 = OpLabel
-         %48 = OpLoad %v2uint %tint_loop_idx_0 None
-         %49 = OpIEqual %v2bool %48 %27
-         %50 = OpAll %bool %49
-               OpSelectionMerge %51 None
-               OpBranchConditional %50 %52 %51
-         %52 = OpLabel
-               OpBranch %46
-         %51 = OpLabel
-         %53 = OpLoad %int %j None
-         %54 = OpSGreaterThan %bool %53 %int_4
-               OpSelectionMerge %55 None
-               OpBranchConditional %54 %56 %55
+               OpBranch %36
+         %36 = OpLabel
+         %38 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %39 None
+               OpBranchConditional %38 %40 %39
+         %40 = OpLabel
+               OpBranch %56
          %56 = OpLabel
+               OpStore %tint_loop_idx_0 %24
+               OpBranch %59
+         %59 = OpLabel
+               OpLoopMerge %60 %58 None
+               OpBranch %57
+         %57 = OpLabel
+         %62 = OpLoad %v2uint %tint_loop_idx_0 None
+         %63 = OpIEqual %v2bool %62 %28
+         %64 = OpAll %bool %63
+               OpSelectionMerge %65 None
+               OpBranchConditional %64 %66 %65
+         %66 = OpLabel
+               OpBranch %60
+         %65 = OpLabel
+         %67 = OpLoad %int %j None
+         %68 = OpSGreaterThan %bool %67 %int_4
+               OpSelectionMerge %69 None
+               OpBranchConditional %68 %70 %69
+         %70 = OpLabel
                OpStore %continue_execution %false None
                OpStore %return_value %int_2 None
-               OpBranch %55
-         %55 = OpLabel
-         %58 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %59 None
-               OpBranchConditional %58 %60 %59
+               OpBranch %69
+         %69 = OpLabel
+         %71 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %72 None
+               OpBranchConditional %71 %73 %72
+         %73 = OpLabel
+               OpBranch %58
+         %72 = OpLabel
+               OpBranch %60
+         %58 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+         %75 = OpLoad %uint %74 None
+%tint_low_inc_1 = OpISub %uint %75 %uint_1
+         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
+               OpStore %77 %tint_low_inc_1 None
+         %78 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
+%tint_carry_1 = OpSelect %uint %78 %uint_1 %uint_0
+         %80 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+         %81 = OpLoad %uint %80 None
+         %82 = OpISub %uint %81 %tint_carry_1
+         %83 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
+               OpStore %83 %82 None
+         %84 = OpLoad %int %j None
+         %85 = OpIAdd %int %84 %int_1
+               OpStore %j %85 None
+               OpBranch %59
          %60 = OpLabel
-               OpBranch %44
-         %59 = OpLabel
-               OpBranch %46
-         %44 = OpLabel
-         %61 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-         %64 = OpLoad %uint %61 None
-%tint_low_inc_1 = OpISub %uint %64 %uint_1
-         %67 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_0
-               OpStore %67 %tint_low_inc_1 None
-         %68 = OpIEqual %bool %tint_low_inc_1 %uint_4294967295
-%tint_carry_1 = OpSelect %uint %68 %uint_1 %uint_0
-         %70 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-         %71 = OpLoad %uint %70 None
-         %72 = OpISub %uint %71 %tint_carry_1
-         %73 = OpAccessChain %_ptr_Function_uint %tint_loop_idx_0 %uint_1
-               OpStore %73 %72 None
-         %74 = OpLoad %int %j None
-         %75 = OpIAdd %int %74 %int_1
-               OpStore %j %75 None
-               OpBranch %45
-         %46 = OpLabel
-               OpBranch %40
-         %40 = OpLabel
+               OpBranch %39
+         %39 = OpLabel
                OpBranch %18
          %16 = OpLabel
-         %76 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %77 = OpLoad %uint %76 None
-%tint_low_inc = OpISub %uint %77 %uint_1
-         %79 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %79 %tint_low_inc None
-         %80 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %80 %uint_1 %uint_0
-         %82 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %83 = OpLoad %uint %82 None
-         %84 = OpISub %uint %83 %tint_carry
-         %85 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %85 %84 None
+         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %44 = OpLoad %uint %41 None
+%tint_low_inc = OpISub %uint %44 %uint_1
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %47 %tint_low_inc None
+         %48 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %48 %uint_1 %uint_0
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %51 = OpLoad %uint %50 None
+         %52 = OpISub %uint %51 %tint_carry
+         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %53 %52 None
                OpBranch %17
          %18 = OpLabel
-         %86 = OpLoad %int %return_value None
-               OpReturnValue %86
+         %19 = OpLoad %int %return_value None
+               OpReturnValue %19
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %89
          %90 = OpLabel
diff --git a/test/tint/loops/single_continue.wgsl.expected.spvasm b/test/tint/loops/single_continue.wgsl.expected.spvasm
index 5d451f6..882a203 100644
--- a/test/tint/loops/single_continue.wgsl.expected.spvasm
+++ b/test/tint/loops/single_continue.wgsl.expected.spvasm
@@ -38,10 +38,10 @@
          %20 = OpLoad %int %i None
                OpSelectionMerge %23 None
                OpSwitch %20 %21 0 %22
-         %22 = OpLabel
-               OpBranch %7
          %21 = OpLabel
                OpBranch %23
+         %22 = OpLabel
+               OpBranch %7
          %23 = OpLabel
                OpBranch %7
           %7 = OpLabel
diff --git a/test/tint/loops/single_continue_robustness.wgsl.expected.spvasm b/test/tint/loops/single_continue_robustness.wgsl.expected.spvasm
index 5d451f6..882a203 100644
--- a/test/tint/loops/single_continue_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/single_continue_robustness.wgsl.expected.spvasm
@@ -38,10 +38,10 @@
          %20 = OpLoad %int %i None
                OpSelectionMerge %23 None
                OpSwitch %20 %21 0 %22
-         %22 = OpLabel
-               OpBranch %7
          %21 = OpLabel
                OpBranch %23
+         %22 = OpLabel
+               OpBranch %7
          %23 = OpLabel
                OpBranch %7
           %7 = OpLabel
diff --git a/test/tint/loops/while.wgsl.expected.spvasm b/test/tint/loops/while.wgsl.expected.spvasm
index 0506437..b26011f 100644
--- a/test/tint/loops/while.wgsl.expected.spvasm
+++ b/test/tint/loops/while.wgsl.expected.spvasm
@@ -21,8 +21,8 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %17 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %21 = OpConstantNull %v2uint
+         %18 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %22 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
@@ -38,48 +38,48 @@
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
                OpBranch %8
           %8 = OpLabel
-               OpStore %tint_loop_idx %17
+               OpStore %tint_loop_idx %18
                OpBranch %11
          %11 = OpLabel
                OpLoopMerge %12 %10 None
                OpBranch %9
           %9 = OpLabel
-         %19 = OpLoad %v2uint %tint_loop_idx None
-         %20 = OpIEqual %v2bool %19 %21
-         %24 = OpAll %bool %20
-               OpSelectionMerge %25 None
-               OpBranchConditional %24 %26 %25
+         %20 = OpLoad %v2uint %tint_loop_idx None
+         %21 = OpIEqual %v2bool %20 %22
+         %25 = OpAll %bool %21
+               OpSelectionMerge %26 None
+               OpBranchConditional %25 %27 %26
+         %27 = OpLabel
+               OpBranch %12
          %26 = OpLabel
+         %28 = OpLoad %int %i None
+         %29 = OpSLessThan %bool %28 %int_4
+               OpSelectionMerge %31 None
+               OpBranchConditional %29 %31 %32
+         %32 = OpLabel
                OpBranch %12
-         %25 = OpLabel
-         %27 = OpLoad %int %i None
-         %28 = OpSLessThan %bool %27 %int_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %30 %31
          %31 = OpLabel
-               OpBranch %12
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpIAdd %int %32 %int_1
-               OpStore %i %33 None
+         %33 = OpLoad %int %i None
+         %34 = OpIAdd %int %33 %int_1
+               OpStore %i %34 None
                OpBranch %10
          %10 = OpLabel
-         %35 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %38 = OpLoad %uint %35 None
-%tint_low_inc = OpISub %uint %38 %uint_1
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %41 %tint_low_inc None
-         %42 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %42 %uint_1 %uint_0
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %45 = OpLoad %uint %44 None
-         %46 = OpISub %uint %45 %tint_carry
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %47 %46 None
+         %36 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %39 = OpLoad %uint %36 None
+%tint_low_inc = OpISub %uint %39 %uint_1
+         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %42 %tint_low_inc None
+         %43 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %43 %uint_1 %uint_0
+         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %46 = OpLoad %uint %45 None
+         %47 = OpISub %uint %46 %tint_carry
+         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %48 %47 None
                OpBranch %11
          %12 = OpLabel
-         %48 = OpLoad %int %i None
-               OpReturnValue %48
+         %13 = OpLoad %int %i None
+               OpReturnValue %13
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %51
          %52 = OpLabel
diff --git a/test/tint/loops/while_robustness.wgsl.expected.spvasm b/test/tint/loops/while_robustness.wgsl.expected.spvasm
index 0506437..b26011f 100644
--- a/test/tint/loops/while_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/while_robustness.wgsl.expected.spvasm
@@ -21,8 +21,8 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %17 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %21 = OpConstantNull %v2uint
+         %18 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %22 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
@@ -38,48 +38,48 @@
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
                OpBranch %8
           %8 = OpLabel
-               OpStore %tint_loop_idx %17
+               OpStore %tint_loop_idx %18
                OpBranch %11
          %11 = OpLabel
                OpLoopMerge %12 %10 None
                OpBranch %9
           %9 = OpLabel
-         %19 = OpLoad %v2uint %tint_loop_idx None
-         %20 = OpIEqual %v2bool %19 %21
-         %24 = OpAll %bool %20
-               OpSelectionMerge %25 None
-               OpBranchConditional %24 %26 %25
+         %20 = OpLoad %v2uint %tint_loop_idx None
+         %21 = OpIEqual %v2bool %20 %22
+         %25 = OpAll %bool %21
+               OpSelectionMerge %26 None
+               OpBranchConditional %25 %27 %26
+         %27 = OpLabel
+               OpBranch %12
          %26 = OpLabel
+         %28 = OpLoad %int %i None
+         %29 = OpSLessThan %bool %28 %int_4
+               OpSelectionMerge %31 None
+               OpBranchConditional %29 %31 %32
+         %32 = OpLabel
                OpBranch %12
-         %25 = OpLabel
-         %27 = OpLoad %int %i None
-         %28 = OpSLessThan %bool %27 %int_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %30 %31
          %31 = OpLabel
-               OpBranch %12
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpIAdd %int %32 %int_1
-               OpStore %i %33 None
+         %33 = OpLoad %int %i None
+         %34 = OpIAdd %int %33 %int_1
+               OpStore %i %34 None
                OpBranch %10
          %10 = OpLabel
-         %35 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %38 = OpLoad %uint %35 None
-%tint_low_inc = OpISub %uint %38 %uint_1
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %41 %tint_low_inc None
-         %42 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %42 %uint_1 %uint_0
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %45 = OpLoad %uint %44 None
-         %46 = OpISub %uint %45 %tint_carry
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %47 %46 None
+         %36 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %39 = OpLoad %uint %36 None
+%tint_low_inc = OpISub %uint %39 %uint_1
+         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %42 %tint_low_inc None
+         %43 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %43 %uint_1 %uint_0
+         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %46 = OpLoad %uint %45 None
+         %47 = OpISub %uint %46 %tint_carry
+         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %48 %47 None
                OpBranch %11
          %12 = OpLabel
-         %48 = OpLoad %int %i None
-               OpReturnValue %48
+         %13 = OpLoad %int %i None
+               OpReturnValue %13
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %51
          %52 = OpLabel
diff --git a/test/tint/loops/while_with_continue.wgsl.expected.spvasm b/test/tint/loops/while_with_continue.wgsl.expected.spvasm
index 0506437..b26011f 100644
--- a/test/tint/loops/while_with_continue.wgsl.expected.spvasm
+++ b/test/tint/loops/while_with_continue.wgsl.expected.spvasm
@@ -21,8 +21,8 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %17 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %21 = OpConstantNull %v2uint
+         %18 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %22 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
@@ -38,48 +38,48 @@
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
                OpBranch %8
           %8 = OpLabel
-               OpStore %tint_loop_idx %17
+               OpStore %tint_loop_idx %18
                OpBranch %11
          %11 = OpLabel
                OpLoopMerge %12 %10 None
                OpBranch %9
           %9 = OpLabel
-         %19 = OpLoad %v2uint %tint_loop_idx None
-         %20 = OpIEqual %v2bool %19 %21
-         %24 = OpAll %bool %20
-               OpSelectionMerge %25 None
-               OpBranchConditional %24 %26 %25
+         %20 = OpLoad %v2uint %tint_loop_idx None
+         %21 = OpIEqual %v2bool %20 %22
+         %25 = OpAll %bool %21
+               OpSelectionMerge %26 None
+               OpBranchConditional %25 %27 %26
+         %27 = OpLabel
+               OpBranch %12
          %26 = OpLabel
+         %28 = OpLoad %int %i None
+         %29 = OpSLessThan %bool %28 %int_4
+               OpSelectionMerge %31 None
+               OpBranchConditional %29 %31 %32
+         %32 = OpLabel
                OpBranch %12
-         %25 = OpLabel
-         %27 = OpLoad %int %i None
-         %28 = OpSLessThan %bool %27 %int_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %30 %31
          %31 = OpLabel
-               OpBranch %12
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpIAdd %int %32 %int_1
-               OpStore %i %33 None
+         %33 = OpLoad %int %i None
+         %34 = OpIAdd %int %33 %int_1
+               OpStore %i %34 None
                OpBranch %10
          %10 = OpLabel
-         %35 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %38 = OpLoad %uint %35 None
-%tint_low_inc = OpISub %uint %38 %uint_1
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %41 %tint_low_inc None
-         %42 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %42 %uint_1 %uint_0
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %45 = OpLoad %uint %44 None
-         %46 = OpISub %uint %45 %tint_carry
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %47 %46 None
+         %36 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %39 = OpLoad %uint %36 None
+%tint_low_inc = OpISub %uint %39 %uint_1
+         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %42 %tint_low_inc None
+         %43 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %43 %uint_1 %uint_0
+         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %46 = OpLoad %uint %45 None
+         %47 = OpISub %uint %46 %tint_carry
+         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %48 %47 None
                OpBranch %11
          %12 = OpLabel
-         %48 = OpLoad %int %i None
-               OpReturnValue %48
+         %13 = OpLoad %int %i None
+               OpReturnValue %13
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %51
          %52 = OpLabel
diff --git a/test/tint/loops/while_with_continue_robustness.wgsl.expected.spvasm b/test/tint/loops/while_with_continue_robustness.wgsl.expected.spvasm
index 0506437..b26011f 100644
--- a/test/tint/loops/while_with_continue_robustness.wgsl.expected.spvasm
+++ b/test/tint/loops/while_with_continue_robustness.wgsl.expected.spvasm
@@ -21,8 +21,8 @@
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %17 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %21 = OpConstantNull %v2uint
+         %18 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %22 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %int_4 = OpConstant %int 4
@@ -38,48 +38,48 @@
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
                OpBranch %8
           %8 = OpLabel
-               OpStore %tint_loop_idx %17
+               OpStore %tint_loop_idx %18
                OpBranch %11
          %11 = OpLabel
                OpLoopMerge %12 %10 None
                OpBranch %9
           %9 = OpLabel
-         %19 = OpLoad %v2uint %tint_loop_idx None
-         %20 = OpIEqual %v2bool %19 %21
-         %24 = OpAll %bool %20
-               OpSelectionMerge %25 None
-               OpBranchConditional %24 %26 %25
+         %20 = OpLoad %v2uint %tint_loop_idx None
+         %21 = OpIEqual %v2bool %20 %22
+         %25 = OpAll %bool %21
+               OpSelectionMerge %26 None
+               OpBranchConditional %25 %27 %26
+         %27 = OpLabel
+               OpBranch %12
          %26 = OpLabel
+         %28 = OpLoad %int %i None
+         %29 = OpSLessThan %bool %28 %int_4
+               OpSelectionMerge %31 None
+               OpBranchConditional %29 %31 %32
+         %32 = OpLabel
                OpBranch %12
-         %25 = OpLabel
-         %27 = OpLoad %int %i None
-         %28 = OpSLessThan %bool %27 %int_4
-               OpSelectionMerge %30 None
-               OpBranchConditional %28 %30 %31
          %31 = OpLabel
-               OpBranch %12
-         %30 = OpLabel
-         %32 = OpLoad %int %i None
-         %33 = OpIAdd %int %32 %int_1
-               OpStore %i %33 None
+         %33 = OpLoad %int %i None
+         %34 = OpIAdd %int %33 %int_1
+               OpStore %i %34 None
                OpBranch %10
          %10 = OpLabel
-         %35 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %38 = OpLoad %uint %35 None
-%tint_low_inc = OpISub %uint %38 %uint_1
-         %41 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %41 %tint_low_inc None
-         %42 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %42 %uint_1 %uint_0
-         %44 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %45 = OpLoad %uint %44 None
-         %46 = OpISub %uint %45 %tint_carry
-         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %47 %46 None
+         %36 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %39 = OpLoad %uint %36 None
+%tint_low_inc = OpISub %uint %39 %uint_1
+         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %42 %tint_low_inc None
+         %43 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %43 %uint_1 %uint_0
+         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %46 = OpLoad %uint %45 None
+         %47 = OpISub %uint %46 %tint_carry
+         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %48 %47 None
                OpBranch %11
          %12 = OpLabel
-         %48 = OpLoad %int %i None
-               OpReturnValue %48
+         %13 = OpLoad %int %i None
+               OpReturnValue %13
                OpFunctionEnd
 %unused_entry_point = OpFunction %void None %51
          %52 = OpLabel
diff --git a/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.spvasm b/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.spvasm
index 534383a..74a2de5 100644
--- a/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.spvasm
@@ -25,11 +25,11 @@
          %10 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
     %int_123 = OpConstant %int 123
       %int_1 = OpConstant %int 1
+      %int_0 = OpConstant %int 0
          %26 = OpTypeFunction %void
  %main_inner = OpFunction %void None %10
 %tint_local_index = OpFunctionParameter %uint
@@ -43,8 +43,8 @@
          %15 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
                OpStore %i %int_123 None
-         %22 = OpLoad %int %i None
-          %u = OpIAdd %int %22 %int_1
+         %21 = OpLoad %int %i None
+          %u = OpIAdd %int %21 %int_1
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %26
diff --git a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.spvasm
index ea31ed1..a074fab 100644
--- a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.spvasm
@@ -70,21 +70,21 @@
                OpLoopMerge %36 %34 None
                OpBranch %33
          %33 = OpLabel
-         %39 = OpUGreaterThanEqual %bool %37 %uint_4
-               OpSelectionMerge %41 None
-               OpBranchConditional %39 %42 %41
-         %42 = OpLabel
+         %40 = OpUGreaterThanEqual %bool %37 %uint_4
+               OpSelectionMerge %42 None
+               OpBranchConditional %40 %43 %42
+         %43 = OpLabel
                OpBranch %36
-         %41 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_int %27 %37
-         %45 = OpLoad %int %43 None
-         %46 = OpAccessChain %_ptr_Function_int %29 %37
-               OpStore %46 %45 None
+         %42 = OpLabel
+         %44 = OpAccessChain %_ptr_Function_int %27 %37
+         %46 = OpLoad %int %44 None
+         %47 = OpAccessChain %_ptr_Function_int %29 %37
+               OpStore %47 %46 None
                OpBranch %34
          %34 = OpLabel
          %38 = OpIAdd %uint %37 %uint_1
                OpBranch %35
          %36 = OpLabel
-         %48 = OpLoad %_arr_int_uint_4_0 %29 None
-               OpReturnValue %48
+         %39 = OpLoad %_arr_int_uint_4_0 %29 None
+               OpReturnValue %39
                OpFunctionEnd
diff --git a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.spvasm
index d733c66..69f9661 100644
--- a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.spvasm
@@ -71,21 +71,21 @@
                OpLoopMerge %37 %35 None
                OpBranch %34
          %34 = OpLabel
-         %40 = OpUGreaterThanEqual %bool %38 %uint_4
-               OpSelectionMerge %42 None
-               OpBranchConditional %40 %43 %42
-         %43 = OpLabel
+         %41 = OpUGreaterThanEqual %bool %38 %uint_4
+               OpSelectionMerge %43 None
+               OpBranchConditional %41 %44 %43
+         %44 = OpLabel
                OpBranch %37
-         %42 = OpLabel
-         %44 = OpAccessChain %_ptr_Function_v4int %28 %38
-         %46 = OpLoad %v4int %44 None
-         %47 = OpAccessChain %_ptr_Function_v4int %30 %38
-               OpStore %47 %46 None
+         %43 = OpLabel
+         %45 = OpAccessChain %_ptr_Function_v4int %28 %38
+         %47 = OpLoad %v4int %45 None
+         %48 = OpAccessChain %_ptr_Function_v4int %30 %38
+               OpStore %48 %47 None
                OpBranch %35
          %35 = OpLabel
          %39 = OpIAdd %uint %38 %uint_1
                OpBranch %36
          %37 = OpLabel
-         %49 = OpLoad %_arr_v4int_uint_4_0 %30 None
-               OpReturnValue %49
+         %40 = OpLoad %_arr_v4int_uint_4_0 %30 None
+               OpReturnValue %40
                OpFunctionEnd
diff --git a/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.spvasm
index 1b447fc..4d09117 100644
--- a/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/array_in_struct.wgsl.expected.spvasm
@@ -31,12 +31,12 @@
      %uint_0 = OpConstant %uint 0
        %void = OpTypeVoid
          %20 = OpTypeFunction %void %uint
+     %uint_2 = OpConstant %uint 2
+   %uint_264 = OpConstant %uint 264
        %bool = OpTypeBool
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %int_0 = OpConstant %int 0
      %uint_1 = OpConstant %uint 1
-     %uint_2 = OpConstant %uint 2
-   %uint_264 = OpConstant %uint 264
          %42 = OpTypeFunction %void
        %func = OpFunction %_arr_int_uint_4 None %11
          %12 = OpLabel
@@ -55,14 +55,14 @@
                OpLoopMerge %26 %24 None
                OpBranch %23
          %23 = OpLabel
-         %29 = OpUGreaterThanEqual %bool %27 %uint_4
-               OpSelectionMerge %31 None
-               OpBranchConditional %29 %32 %31
-         %32 = OpLabel
+         %33 = OpUGreaterThanEqual %bool %27 %uint_4
+               OpSelectionMerge %35 None
+               OpBranchConditional %33 %36 %35
+         %36 = OpLabel
                OpBranch %26
-         %31 = OpLabel
-         %33 = OpAccessChain %_ptr_Workgroup_int %S %uint_0 %27
-               OpStore %33 %int_0 None
+         %35 = OpLabel
+         %37 = OpAccessChain %_ptr_Workgroup_int %S %uint_0 %27
+               OpStore %37 %int_0 None
                OpBranch %24
          %24 = OpLabel
          %28 = OpIAdd %uint %27 %uint_1
diff --git a/test/tint/ptr_ref/load/param/workgroup/i32.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/i32.wgsl.expected.spvasm
index a262c58..b819870 100644
--- a/test/tint/ptr_ref/load/param/workgroup/i32.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/i32.wgsl.expected.spvasm
@@ -26,9 +26,9 @@
          %14 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+      %int_0 = OpConstant %int 0
          %27 = OpTypeFunction %void
        %func = OpFunction %int None %8
           %9 = OpLabel
diff --git a/test/tint/ptr_ref/load/param/workgroup/i32_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/i32_in_struct.wgsl.expected.spvasm
index 933315f..32a01fd 100644
--- a/test/tint/ptr_ref/load/param/workgroup/i32_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/i32_in_struct.wgsl.expected.spvasm
@@ -31,9 +31,9 @@
          %18 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %25 = OpConstantNull %str
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %29 = OpConstantNull %str
          %31 = OpTypeFunction %void
        %func = OpFunction %int None %9
          %10 = OpLabel
@@ -48,7 +48,7 @@
                OpSelectionMerge %23 None
                OpBranchConditional %20 %24 %23
          %24 = OpLabel
-               OpStore %S %25 None
+               OpStore %S %29 None
                OpBranch %23
          %23 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
diff --git a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.spvasm
index c65f153..5ba6128 100644
--- a/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/struct_in_array.wgsl.expected.spvasm
@@ -33,10 +33,10 @@
 %_ptr_Workgroup_str = OpTypePointer Workgroup %str
        %void = OpTypeVoid
          %23 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
-         %37 = OpConstantNull %str
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+       %bool = OpTypeBool
+         %42 = OpConstantNull %str
          %44 = OpTypeFunction %void
        %func = OpFunction %str None %14
 %pointer_indices = OpFunctionParameter %_arr_uint_uint_1
@@ -57,22 +57,22 @@
                OpLoopMerge %29 %27 None
                OpBranch %26
          %26 = OpLabel
-         %32 = OpUGreaterThanEqual %bool %30 %uint_4
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %30 %uint_4
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %29
-         %34 = OpLabel
-         %36 = OpAccessChain %_ptr_Workgroup_str %S %30
-               OpStore %36 %37 None
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_str %S %30
+               OpStore %41 %42 None
                OpBranch %27
          %27 = OpLabel
          %31 = OpIAdd %uint %30 %uint_1
                OpBranch %28
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %41 = OpCompositeConstruct %_arr_uint_uint_1 %uint_2
-          %r = OpFunctionCall %str %func %41
+         %35 = OpCompositeConstruct %_arr_uint_uint_1 %uint_2
+          %r = OpFunctionCall %str %func %35
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %44
diff --git a/test/tint/ptr_ref/load/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm
index bd409a5..60ebd60 100644
--- a/test/tint/ptr_ref/load/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm
@@ -31,9 +31,9 @@
        %void = OpTypeVoid
          %22 = OpTypeFunction %void %uint
        %bool = OpTypeBool
-         %28 = OpConstantNull %mat2v2float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %33 = OpConstantNull %mat2v2float
          %35 = OpTypeFunction %void
        %func = OpFunction %v2float None %13
 %pointer_indices = OpFunctionParameter %_arr_uint_uint_1
@@ -50,12 +50,12 @@
                OpSelectionMerge %26 None
                OpBranchConditional %24 %27 %26
          %27 = OpLabel
-               OpStore %S %28 None
+               OpStore %S %33 None
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-          %r = OpFunctionCall %v2float %func %32
+         %31 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+          %r = OpFunctionCall %v2float %func %31
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %35
diff --git a/test/tint/ptr_ref/load/param/workgroup/vec4_f32.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/vec4_f32.wgsl.expected.spvasm
index 295a0b9..b378ce0 100644
--- a/test/tint/ptr_ref/load/param/workgroup/vec4_f32.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/vec4_f32.wgsl.expected.spvasm
@@ -27,9 +27,9 @@
          %15 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %22 = OpConstantNull %v4float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %26 = OpConstantNull %v4float
          %28 = OpTypeFunction %void
        %func = OpFunction %v4float None %9
          %10 = OpLabel
@@ -43,7 +43,7 @@
                OpSelectionMerge %20 None
                OpBranchConditional %17 %21 %20
          %21 = OpLabel
-               OpStore %S %22 None
+               OpStore %S %26 None
                OpBranch %20
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
diff --git a/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm
index 59db803..ddf14b2 100644
--- a/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm
@@ -31,9 +31,9 @@
        %void = OpTypeVoid
          %22 = OpTypeFunction %void %uint
        %bool = OpTypeBool
-         %28 = OpConstantNull %mat2v4float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %33 = OpConstantNull %mat2v4float
          %35 = OpTypeFunction %void
        %func = OpFunction %v4float None %13
 %pointer_indices = OpFunctionParameter %_arr_uint_uint_1
@@ -50,12 +50,12 @@
                OpSelectionMerge %26 None
                OpBranchConditional %24 %27 %26
          %27 = OpLabel
-               OpStore %S %28 None
+               OpStore %S %33 None
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-          %r = OpFunctionCall %v4float %func %32
+         %31 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+          %r = OpFunctionCall %v4float %func %31
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %35
diff --git a/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm
index 6be6003..5d761a8 100644
--- a/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/load/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm
@@ -32,9 +32,9 @@
          %19 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %26 = OpConstantNull %str
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %30 = OpConstantNull %str
          %32 = OpTypeFunction %void
        %func = OpFunction %v4float None %10
          %11 = OpLabel
@@ -49,7 +49,7 @@
                OpSelectionMerge %24 None
                OpBranchConditional %21 %25 %24
          %25 = OpLabel
-               OpStore %S %26 None
+               OpStore %S %30 None
                OpBranch %24
          %24 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
diff --git a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.spvasm
index 94defa82..fc0e99d 100644
--- a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.spvasm
@@ -69,21 +69,21 @@
                OpLoopMerge %35 %33 None
                OpBranch %32
          %32 = OpLabel
-         %38 = OpUGreaterThanEqual %bool %36 %uint_4
-               OpSelectionMerge %40 None
-               OpBranchConditional %38 %41 %40
-         %41 = OpLabel
+         %39 = OpUGreaterThanEqual %bool %36 %uint_4
+               OpSelectionMerge %41 None
+               OpBranchConditional %39 %42 %41
+         %42 = OpLabel
                OpBranch %35
-         %40 = OpLabel
-         %42 = OpAccessChain %_ptr_Function_int %26 %36
-         %44 = OpLoad %int %42 None
-         %45 = OpAccessChain %_ptr_Function_int %28 %36
-               OpStore %45 %44 None
+         %41 = OpLabel
+         %43 = OpAccessChain %_ptr_Function_int %26 %36
+         %45 = OpLoad %int %43 None
+         %46 = OpAccessChain %_ptr_Function_int %28 %36
+               OpStore %46 %45 None
                OpBranch %33
          %33 = OpLabel
          %37 = OpIAdd %uint %36 %uint_1
                OpBranch %34
          %35 = OpLabel
-         %47 = OpLoad %_arr_int_uint_4 %28 None
-               OpReturnValue %47
+         %38 = OpLoad %_arr_int_uint_4 %28 None
+               OpReturnValue %38
                OpFunctionEnd
diff --git a/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.spvasm
index f140ec6..5b2f265 100644
--- a/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/workgroup/array_in_struct.wgsl.expected.spvasm
@@ -31,12 +31,12 @@
      %uint_0 = OpConstant %uint 0
          %17 = OpConstantNull %_arr_int_uint_4
          %20 = OpTypeFunction %void %uint
+     %uint_2 = OpConstant %uint 2
+   %uint_264 = OpConstant %uint 264
        %bool = OpTypeBool
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %int_0 = OpConstant %int 0
      %uint_1 = OpConstant %uint 1
-     %uint_2 = OpConstant %uint 2
-   %uint_264 = OpConstant %uint 264
        %func = OpFunction %void None %12
          %13 = OpLabel
          %14 = OpAccessChain %_ptr_Workgroup__arr_int_uint_4 %S %uint_0
@@ -54,21 +54,21 @@
                OpLoopMerge %26 %24 None
                OpBranch %23
          %23 = OpLabel
-         %29 = OpUGreaterThanEqual %bool %27 %uint_4
-               OpSelectionMerge %31 None
-               OpBranchConditional %29 %32 %31
-         %32 = OpLabel
+         %33 = OpUGreaterThanEqual %bool %27 %uint_4
+               OpSelectionMerge %35 None
+               OpBranchConditional %33 %36 %35
+         %36 = OpLabel
                OpBranch %26
-         %31 = OpLabel
-         %33 = OpAccessChain %_ptr_Workgroup_int %S %uint_0 %27
-               OpStore %33 %int_0 None
+         %35 = OpLabel
+         %37 = OpAccessChain %_ptr_Workgroup_int %S %uint_0 %27
+               OpStore %37 %int_0 None
                OpBranch %24
          %24 = OpLabel
          %28 = OpIAdd %uint %27 %uint_1
                OpBranch %25
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %40 = OpFunctionCall %void %func
+         %32 = OpFunctionCall %void %func
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %12
diff --git a/test/tint/ptr_ref/store/param/workgroup/i32.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/workgroup/i32.wgsl.expected.spvasm
index 75fa397..d5ac19f 100644
--- a/test/tint/ptr_ref/store/param/workgroup/i32.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/workgroup/i32.wgsl.expected.spvasm
@@ -26,9 +26,9 @@
          %14 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+      %int_0 = OpConstant %int 0
        %func = OpFunction %void None %9
          %10 = OpLabel
                OpStore %S %int_42 None
@@ -45,7 +45,7 @@
                OpBranch %19
          %19 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %25 = OpFunctionCall %void %func
+         %24 = OpFunctionCall %void %func
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %9
diff --git a/test/tint/ptr_ref/store/param/workgroup/i32_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/workgroup/i32_in_struct.wgsl.expected.spvasm
index ad39911..8f7cd42 100644
--- a/test/tint/ptr_ref/store/param/workgroup/i32_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/workgroup/i32_in_struct.wgsl.expected.spvasm
@@ -31,9 +31,9 @@
          %18 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %25 = OpConstantNull %str
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %29 = OpConstantNull %str
        %func = OpFunction %void None %10
          %11 = OpLabel
          %12 = OpAccessChain %_ptr_Workgroup_int %S %uint_0
@@ -47,11 +47,11 @@
                OpSelectionMerge %23 None
                OpBranchConditional %20 %24 %23
          %24 = OpLabel
-               OpStore %S %25 None
+               OpStore %S %29 None
                OpBranch %23
          %23 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %29 = OpFunctionCall %void %func
+         %28 = OpFunctionCall %void %func
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %10
diff --git a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.spvasm
index 7433052..0c726c6 100644
--- a/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/workgroup/struct_in_array.wgsl.expected.spvasm
@@ -33,9 +33,9 @@
 %_ptr_Workgroup_str = OpTypePointer Workgroup %str
          %20 = OpConstantNull %str
          %23 = OpTypeFunction %void %uint
-       %bool = OpTypeBool
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+       %bool = OpTypeBool
          %43 = OpTypeFunction %void
        %func = OpFunction %void None %15
 %pointer_indices = OpFunctionParameter %_arr_uint_uint_1
@@ -56,22 +56,22 @@
                OpLoopMerge %29 %27 None
                OpBranch %26
          %26 = OpLabel
-         %32 = OpUGreaterThanEqual %bool %30 %uint_4
-               OpSelectionMerge %34 None
-               OpBranchConditional %32 %35 %34
-         %35 = OpLabel
+         %37 = OpUGreaterThanEqual %bool %30 %uint_4
+               OpSelectionMerge %39 None
+               OpBranchConditional %37 %40 %39
+         %40 = OpLabel
                OpBranch %29
-         %34 = OpLabel
-         %36 = OpAccessChain %_ptr_Workgroup_str %S %30
-               OpStore %36 %20 None
+         %39 = OpLabel
+         %41 = OpAccessChain %_ptr_Workgroup_str %S %30
+               OpStore %41 %20 None
                OpBranch %27
          %27 = OpLabel
          %31 = OpIAdd %uint %30 %uint_1
                OpBranch %28
          %29 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %40 = OpCompositeConstruct %_arr_uint_uint_1 %uint_2
-         %41 = OpFunctionCall %void %func %40
+         %35 = OpCompositeConstruct %_arr_uint_uint_1 %uint_2
+         %36 = OpFunctionCall %void %func %35
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %43
diff --git a/test/tint/ptr_ref/store/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm
index c45bccc..e9996c0 100644
--- a/test/tint/ptr_ref/store/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/workgroup/vec2_f32_in_mat2x2.wgsl.expected.spvasm
@@ -31,9 +31,9 @@
          %19 = OpConstantNull %v2float
          %22 = OpTypeFunction %void %uint
        %bool = OpTypeBool
-         %28 = OpConstantNull %mat2v2float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %33 = OpConstantNull %mat2v2float
          %35 = OpTypeFunction %void
        %func = OpFunction %void None %14
 %pointer_indices = OpFunctionParameter %_arr_uint_uint_1
@@ -50,12 +50,12 @@
                OpSelectionMerge %26 None
                OpBranchConditional %24 %27 %26
          %27 = OpLabel
-               OpStore %S %28 None
+               OpStore %S %33 None
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %33 = OpFunctionCall %void %func %32
+         %31 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %32 = OpFunctionCall %void %func %31
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %35
diff --git a/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm
index 18ffd6a..5a3ca06 100644
--- a/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_mat2x4.wgsl.expected.spvasm
@@ -31,9 +31,9 @@
          %19 = OpConstantNull %v4float
          %22 = OpTypeFunction %void %uint
        %bool = OpTypeBool
-         %28 = OpConstantNull %mat2v4float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %33 = OpConstantNull %mat2v4float
          %35 = OpTypeFunction %void
        %func = OpFunction %void None %14
 %pointer_indices = OpFunctionParameter %_arr_uint_uint_1
@@ -50,12 +50,12 @@
                OpSelectionMerge %26 None
                OpBranchConditional %24 %27 %26
          %27 = OpLabel
-               OpStore %S %28 None
+               OpStore %S %33 None
                OpBranch %26
          %26 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
-         %33 = OpFunctionCall %void %func %32
+         %31 = OpCompositeConstruct %_arr_uint_uint_1 %uint_1
+         %32 = OpFunctionCall %void %func %31
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %35
diff --git a/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm b/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm
index 38cf9bd..4f051be 100644
--- a/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm
+++ b/test/tint/ptr_ref/store/param/workgroup/vec4_f32_in_struct.wgsl.expected.spvasm
@@ -32,9 +32,9 @@
          %19 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %26 = OpConstantNull %str
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %30 = OpConstantNull %str
        %func = OpFunction %void None %11
          %12 = OpLabel
          %13 = OpAccessChain %_ptr_Workgroup_v4float %S %uint_0
@@ -48,11 +48,11 @@
                OpSelectionMerge %24 None
                OpBranchConditional %21 %25 %24
          %25 = OpLabel
-               OpStore %S %26 None
+               OpStore %S %30 None
                OpBranch %24
          %24 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %30 = OpFunctionCall %void %func
+         %29 = OpFunctionCall %void %func
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %11
diff --git a/test/tint/samples/compute_boids.wgsl.expected.spvasm b/test/tint/samples/compute_boids.wgsl.expected.spvasm
index 3b9c2a3..dbea510 100644
--- a/test/tint/samples/compute_boids.wgsl.expected.spvasm
+++ b/test/tint/samples/compute_boids.wgsl.expected.spvasm
@@ -235,15 +235,15 @@
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
 %_ptr_Uniform_float = OpTypePointer Uniform %float
-      %int_1 = OpConstant %int 1
-     %uint_2 = OpConstant %uint 2
-     %uint_3 = OpConstant %uint 3
      %uint_6 = OpConstant %uint 6
     %float_0 = OpConstant %float 0
 %float_0_100000001 = OpConstant %float 0.100000001
 %_ptr_Function_float = OpTypePointer Function %float
    %float_n1 = OpConstant %float -1
     %float_1 = OpConstant %float 1
+     %uint_2 = OpConstant %uint 2
+     %uint_3 = OpConstant %uint 3
+      %int_1 = OpConstant %int 1
         %222 = OpTypeFunction %void
 %comp_main_inner = OpFunction %void None %24
 %gl_GlobalInvocationID = OpFunctionParameter %v3uint
@@ -291,206 +291,206 @@
                OpLoopMerge %65 %63 None
                OpBranch %62
          %62 = OpLabel
-         %67 = OpLoad %uint %i None
-         %68 = OpULessThan %bool %67 %uint_5
-               OpSelectionMerge %69 None
-               OpBranchConditional %68 %69 %70
-         %70 = OpLabel
+        %138 = OpLoad %uint %i None
+        %139 = OpULessThan %bool %138 %uint_5
+               OpSelectionMerge %140 None
+               OpBranchConditional %139 %140 %141
+        %141 = OpLabel
                OpBranch %65
-         %69 = OpLabel
-         %71 = OpLoad %uint %i None
-         %72 = OpLoad %uint %index None
-         %73 = OpIEqual %bool %71 %72
-               OpSelectionMerge %74 None
-               OpBranchConditional %73 %75 %74
-         %75 = OpLabel
+        %140 = OpLabel
+        %142 = OpLoad %uint %i None
+        %143 = OpLoad %uint %index None
+        %144 = OpIEqual %bool %142 %143
+               OpSelectionMerge %145 None
+               OpBranchConditional %144 %146 %145
+        %146 = OpLabel
                OpBranch %63
-         %74 = OpLabel
-         %76 = OpLoad %uint %i None
-         %77 = OpExtInst %uint %36 UMin %76 %uint_4
-         %78 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %77 %uint_0
-         %79 = OpLoad %v2float %78 None
-         %80 = OpVectorShuffle %v2float %79 %79 0 1
-               OpStore %pos %80 None
-         %81 = OpLoad %uint %i None
-         %82 = OpExtInst %uint %36 UMin %81 %uint_4
-         %83 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %82 %uint_1
-         %84 = OpLoad %v2float %83 None
-         %85 = OpVectorShuffle %v2float %84 %84 0 1
-               OpStore %vel %85 None
-         %86 = OpLoad %v2float %pos None
-         %87 = OpLoad %v2float %vPos None
-         %88 = OpExtInst %float %36 Distance %86 %87
-         %89 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_1
-         %91 = OpLoad %float %89 None
-         %92 = OpFOrdLessThan %bool %88 %91
-               OpSelectionMerge %93 None
-               OpBranchConditional %92 %94 %93
-         %94 = OpLabel
-         %95 = OpLoad %v2float %cMass None
-         %96 = OpLoad %v2float %pos None
-         %97 = OpFAdd %v2float %95 %96
-               OpStore %cMass %97 None
-         %98 = OpLoad %int %cMassCount None
-         %99 = OpIAdd %int %98 %int_1
-               OpStore %cMassCount %99 None
-               OpBranch %93
-         %93 = OpLabel
-        %101 = OpLoad %v2float %pos None
-        %102 = OpLoad %v2float %vPos None
-        %103 = OpExtInst %float %36 Distance %101 %102
-        %104 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_2
-        %106 = OpLoad %float %104 None
-        %107 = OpFOrdLessThan %bool %103 %106
-               OpSelectionMerge %108 None
-               OpBranchConditional %107 %109 %108
-        %109 = OpLabel
-        %110 = OpLoad %v2float %colVel None
-        %111 = OpLoad %v2float %pos None
-        %112 = OpLoad %v2float %vPos None
-        %113 = OpFSub %v2float %111 %112
-        %114 = OpFSub %v2float %110 %113
-               OpStore %colVel %114 None
-               OpBranch %108
-        %108 = OpLabel
-        %115 = OpLoad %v2float %pos None
-        %116 = OpLoad %v2float %vPos None
-        %117 = OpExtInst %float %36 Distance %115 %116
-        %118 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_3
-        %120 = OpLoad %float %118 None
-        %121 = OpFOrdLessThan %bool %117 %120
+        %145 = OpLabel
+        %147 = OpLoad %uint %i None
+        %148 = OpExtInst %uint %36 UMin %147 %uint_4
+        %149 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %148 %uint_0
+        %150 = OpLoad %v2float %149 None
+        %151 = OpVectorShuffle %v2float %150 %150 0 1
+               OpStore %pos %151 None
+        %152 = OpLoad %uint %i None
+        %153 = OpExtInst %uint %36 UMin %152 %uint_4
+        %154 = OpAccessChain %_ptr_StorageBuffer_v2float %6 %uint_0 %uint_0 %153 %uint_1
+        %155 = OpLoad %v2float %154 None
+        %156 = OpVectorShuffle %v2float %155 %155 0 1
+               OpStore %vel %156 None
+        %157 = OpLoad %v2float %pos None
+        %158 = OpLoad %v2float %vPos None
+        %159 = OpExtInst %float %36 Distance %157 %158
+        %160 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_1
+        %161 = OpLoad %float %160 None
+        %162 = OpFOrdLessThan %bool %159 %161
+               OpSelectionMerge %163 None
+               OpBranchConditional %162 %164 %163
+        %164 = OpLabel
+        %205 = OpLoad %v2float %cMass None
+        %206 = OpLoad %v2float %pos None
+        %207 = OpFAdd %v2float %205 %206
+               OpStore %cMass %207 None
+        %208 = OpLoad %int %cMassCount None
+        %209 = OpIAdd %int %208 %int_1
+               OpStore %cMassCount %209 None
+               OpBranch %163
+        %163 = OpLabel
+        %165 = OpLoad %v2float %pos None
+        %166 = OpLoad %v2float %vPos None
+        %167 = OpExtInst %float %36 Distance %165 %166
+        %168 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_2
+        %170 = OpLoad %float %168 None
+        %171 = OpFOrdLessThan %bool %167 %170
+               OpSelectionMerge %172 None
+               OpBranchConditional %171 %173 %172
+        %173 = OpLabel
+        %211 = OpLoad %v2float %colVel None
+        %212 = OpLoad %v2float %pos None
+        %213 = OpLoad %v2float %vPos None
+        %214 = OpFSub %v2float %212 %213
+        %215 = OpFSub %v2float %211 %214
+               OpStore %colVel %215 None
+               OpBranch %172
+        %172 = OpLabel
+        %174 = OpLoad %v2float %pos None
+        %175 = OpLoad %v2float %vPos None
+        %176 = OpExtInst %float %36 Distance %174 %175
+        %177 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_3
+        %179 = OpLoad %float %177 None
+        %180 = OpFOrdLessThan %bool %176 %179
+               OpSelectionMerge %181 None
+               OpBranchConditional %180 %182 %181
+        %182 = OpLabel
+        %216 = OpLoad %v2float %cVel None
+        %217 = OpLoad %v2float %vel None
+        %218 = OpFAdd %v2float %216 %217
+               OpStore %cVel %218 None
+        %219 = OpLoad %int %cVelCount None
+        %220 = OpIAdd %int %219 %int_1
+               OpStore %cVelCount %220 None
+               OpBranch %181
+        %181 = OpLabel
+               OpBranch %63
+         %63 = OpLabel
+        %183 = OpLoad %uint %i None
+        %184 = OpIAdd %uint %183 %uint_1
+               OpStore %i %184 None
+               OpBranch %64
+         %65 = OpLabel
+         %66 = OpLoad %int %cMassCount None
+         %67 = OpSGreaterThan %bool %66 %int_0
+               OpSelectionMerge %68 None
+               OpBranchConditional %67 %69 %68
+         %69 = OpLabel
+        %185 = OpLoad %v2float %cMass None
+        %186 = OpLoad %int %cMassCount None
+        %187 = OpConvertSToF %float %186
+        %188 = OpLoad %int %cMassCount None
+        %189 = OpConvertSToF %float %188
+        %190 = OpCompositeConstruct %v2float %187 %189
+        %191 = OpFDiv %v2float %185 %190
+        %192 = OpLoad %v2float %vPos None
+        %193 = OpFSub %v2float %191 %192
+               OpStore %cMass %193 None
+               OpBranch %68
+         %68 = OpLabel
+         %70 = OpLoad %int %cVelCount None
+         %71 = OpSGreaterThan %bool %70 %int_0
+               OpSelectionMerge %72 None
+               OpBranchConditional %71 %73 %72
+         %73 = OpLabel
+        %194 = OpLoad %v2float %cVel None
+        %195 = OpLoad %int %cVelCount None
+        %196 = OpConvertSToF %float %195
+        %197 = OpLoad %int %cVelCount None
+        %198 = OpConvertSToF %float %197
+        %199 = OpCompositeConstruct %v2float %196 %198
+        %200 = OpFDiv %v2float %194 %199
+               OpStore %cVel %200 None
+               OpBranch %72
+         %72 = OpLabel
+         %74 = OpLoad %v2float %vVel None
+         %75 = OpLoad %v2float %cMass None
+         %76 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_4
+         %78 = OpLoad %float %76 None
+         %79 = OpVectorTimesScalar %v2float %75 %78
+         %80 = OpFAdd %v2float %74 %79
+         %81 = OpLoad %v2float %colVel None
+         %82 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_5
+         %83 = OpLoad %float %82 None
+         %84 = OpVectorTimesScalar %v2float %81 %83
+         %85 = OpFAdd %v2float %80 %84
+         %86 = OpLoad %v2float %cVel None
+         %87 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_6
+         %89 = OpLoad %float %87 None
+         %90 = OpVectorTimesScalar %v2float %86 %89
+         %91 = OpFAdd %v2float %85 %90
+               OpStore %vVel %91 None
+         %92 = OpLoad %v2float %vVel None
+         %93 = OpExtInst %v2float %36 Normalize %92
+         %94 = OpLoad %v2float %vVel None
+         %95 = OpExtInst %float %36 Length %94
+         %96 = OpExtInst %float %36 NClamp %95 %float_0 %float_0_100000001
+         %99 = OpVectorTimesScalar %v2float %93 %96
+               OpStore %vVel %99 None
+        %100 = OpLoad %v2float %vPos None
+        %101 = OpLoad %v2float %vVel None
+        %102 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_0
+        %103 = OpLoad %float %102 None
+        %104 = OpVectorTimesScalar %v2float %101 %103
+        %105 = OpFAdd %v2float %100 %104
+               OpStore %vPos %105 None
+        %106 = OpAccessChain %_ptr_Function_float %vPos %uint_0
+        %108 = OpLoad %float %106 None
+        %109 = OpFOrdLessThan %bool %108 %float_n1
+               OpSelectionMerge %111 None
+               OpBranchConditional %109 %112 %111
+        %112 = OpLabel
+        %201 = OpAccessChain %_ptr_Function_float %vPos %uint_0
+               OpStore %201 %float_1 None
+               OpBranch %111
+        %111 = OpLabel
+        %113 = OpAccessChain %_ptr_Function_float %vPos %uint_0
+        %114 = OpLoad %float %113 None
+        %115 = OpFOrdGreaterThan %bool %114 %float_1
+               OpSelectionMerge %117 None
+               OpBranchConditional %115 %118 %117
+        %118 = OpLabel
+        %202 = OpAccessChain %_ptr_Function_float %vPos %uint_0
+               OpStore %202 %float_n1 None
+               OpBranch %117
+        %117 = OpLabel
+        %119 = OpAccessChain %_ptr_Function_float %vPos %uint_1
+        %120 = OpLoad %float %119 None
+        %121 = OpFOrdLessThan %bool %120 %float_n1
                OpSelectionMerge %122 None
                OpBranchConditional %121 %123 %122
         %123 = OpLabel
-        %124 = OpLoad %v2float %cVel None
-        %125 = OpLoad %v2float %vel None
-        %126 = OpFAdd %v2float %124 %125
-               OpStore %cVel %126 None
-        %127 = OpLoad %int %cVelCount None
-        %128 = OpIAdd %int %127 %int_1
-               OpStore %cVelCount %128 None
+        %203 = OpAccessChain %_ptr_Function_float %vPos %uint_1
+               OpStore %203 %float_1 None
                OpBranch %122
         %122 = OpLabel
-               OpBranch %63
-         %63 = OpLabel
-        %129 = OpLoad %uint %i None
-        %130 = OpIAdd %uint %129 %uint_1
-               OpStore %i %130 None
-               OpBranch %64
-         %65 = OpLabel
-        %131 = OpLoad %int %cMassCount None
-        %132 = OpSGreaterThan %bool %131 %int_0
-               OpSelectionMerge %133 None
-               OpBranchConditional %132 %134 %133
-        %134 = OpLabel
-        %135 = OpLoad %v2float %cMass None
-        %136 = OpLoad %int %cMassCount None
-        %137 = OpConvertSToF %float %136
-        %138 = OpLoad %int %cMassCount None
-        %139 = OpConvertSToF %float %138
-        %140 = OpCompositeConstruct %v2float %137 %139
-        %141 = OpFDiv %v2float %135 %140
-        %142 = OpLoad %v2float %vPos None
-        %143 = OpFSub %v2float %141 %142
-               OpStore %cMass %143 None
-               OpBranch %133
-        %133 = OpLabel
-        %144 = OpLoad %int %cVelCount None
-        %145 = OpSGreaterThan %bool %144 %int_0
-               OpSelectionMerge %146 None
-               OpBranchConditional %145 %147 %146
-        %147 = OpLabel
-        %148 = OpLoad %v2float %cVel None
-        %149 = OpLoad %int %cVelCount None
-        %150 = OpConvertSToF %float %149
-        %151 = OpLoad %int %cVelCount None
-        %152 = OpConvertSToF %float %151
-        %153 = OpCompositeConstruct %v2float %150 %152
-        %154 = OpFDiv %v2float %148 %153
-               OpStore %cVel %154 None
-               OpBranch %146
-        %146 = OpLabel
-        %155 = OpLoad %v2float %vVel None
-        %156 = OpLoad %v2float %cMass None
-        %157 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_4
-        %158 = OpLoad %float %157 None
-        %159 = OpVectorTimesScalar %v2float %156 %158
-        %160 = OpFAdd %v2float %155 %159
-        %161 = OpLoad %v2float %colVel None
-        %162 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_5
-        %163 = OpLoad %float %162 None
-        %164 = OpVectorTimesScalar %v2float %161 %163
-        %165 = OpFAdd %v2float %160 %164
-        %166 = OpLoad %v2float %cVel None
-        %167 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_6
-        %169 = OpLoad %float %167 None
-        %170 = OpVectorTimesScalar %v2float %166 %169
-        %171 = OpFAdd %v2float %165 %170
-               OpStore %vVel %171 None
-        %172 = OpLoad %v2float %vVel None
-        %173 = OpExtInst %v2float %36 Normalize %172
-        %174 = OpLoad %v2float %vVel None
-        %175 = OpExtInst %float %36 Length %174
-        %176 = OpExtInst %float %36 NClamp %175 %float_0 %float_0_100000001
-        %179 = OpVectorTimesScalar %v2float %173 %176
-               OpStore %vVel %179 None
-        %180 = OpLoad %v2float %vPos None
-        %181 = OpLoad %v2float %vVel None
-        %182 = OpAccessChain %_ptr_Uniform_float %1 %uint_0 %uint_0
-        %183 = OpLoad %float %182 None
-        %184 = OpVectorTimesScalar %v2float %181 %183
-        %185 = OpFAdd %v2float %180 %184
-               OpStore %vPos %185 None
-        %186 = OpAccessChain %_ptr_Function_float %vPos %uint_0
-        %188 = OpLoad %float %186 None
-        %189 = OpFOrdLessThan %bool %188 %float_n1
-               OpSelectionMerge %191 None
-               OpBranchConditional %189 %192 %191
-        %192 = OpLabel
-        %193 = OpAccessChain %_ptr_Function_float %vPos %uint_0
-               OpStore %193 %float_1 None
-               OpBranch %191
-        %191 = OpLabel
-        %195 = OpAccessChain %_ptr_Function_float %vPos %uint_0
-        %196 = OpLoad %float %195 None
-        %197 = OpFOrdGreaterThan %bool %196 %float_1
-               OpSelectionMerge %198 None
-               OpBranchConditional %197 %199 %198
-        %199 = OpLabel
-        %200 = OpAccessChain %_ptr_Function_float %vPos %uint_0
-               OpStore %200 %float_n1 None
-               OpBranch %198
-        %198 = OpLabel
-        %201 = OpAccessChain %_ptr_Function_float %vPos %uint_1
-        %202 = OpLoad %float %201 None
-        %203 = OpFOrdLessThan %bool %202 %float_n1
-               OpSelectionMerge %204 None
-               OpBranchConditional %203 %205 %204
-        %205 = OpLabel
-        %206 = OpAccessChain %_ptr_Function_float %vPos %uint_1
-               OpStore %206 %float_1 None
-               OpBranch %204
-        %204 = OpLabel
-        %207 = OpAccessChain %_ptr_Function_float %vPos %uint_1
-        %208 = OpLoad %float %207 None
-        %209 = OpFOrdGreaterThan %bool %208 %float_1
-               OpSelectionMerge %210 None
-               OpBranchConditional %209 %211 %210
-        %211 = OpLabel
-        %212 = OpAccessChain %_ptr_Function_float %vPos %uint_1
-               OpStore %212 %float_n1 None
-               OpBranch %210
-        %210 = OpLabel
-        %213 = OpLoad %uint %index None
-        %214 = OpExtInst %uint %36 UMin %213 %uint_4
-        %215 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %214 %uint_0
-        %216 = OpLoad %v2float %vPos None
-               OpStore %215 %216 None
-        %217 = OpLoad %uint %index None
-        %218 = OpExtInst %uint %36 UMin %217 %uint_4
-        %219 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %218 %uint_1
-        %220 = OpLoad %v2float %vVel None
-               OpStore %219 %220 None
+        %124 = OpAccessChain %_ptr_Function_float %vPos %uint_1
+        %125 = OpLoad %float %124 None
+        %126 = OpFOrdGreaterThan %bool %125 %float_1
+               OpSelectionMerge %127 None
+               OpBranchConditional %126 %128 %127
+        %128 = OpLabel
+        %204 = OpAccessChain %_ptr_Function_float %vPos %uint_1
+               OpStore %204 %float_n1 None
+               OpBranch %127
+        %127 = OpLabel
+        %129 = OpLoad %uint %index None
+        %130 = OpExtInst %uint %36 UMin %129 %uint_4
+        %131 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %130 %uint_0
+        %132 = OpLoad %v2float %vPos None
+               OpStore %131 %132 None
+        %133 = OpLoad %uint %index None
+        %134 = OpExtInst %uint %36 UMin %133 %uint_4
+        %135 = OpAccessChain %_ptr_StorageBuffer_v2float %15 %uint_0 %uint_0 %134 %uint_1
+        %136 = OpLoad %v2float %vVel None
+               OpStore %135 %136 None
                OpReturn
                OpFunctionEnd
   %comp_main = OpFunction %void None %222
diff --git a/test/tint/shadowing/loop.wgsl.expected.spvasm b/test/tint/shadowing/loop.wgsl.expected.spvasm
index 7d5d2e8..9227000 100644
--- a/test/tint/shadowing/loop.wgsl.expected.spvasm
+++ b/test/tint/shadowing/loop.wgsl.expected.spvasm
@@ -4,7 +4,7 @@
 ; Bound: 69
 ; Schema: 0
                OpCapability Shader
-         %36 = OpExtInstImport "GLSL.std.450"
+         %40 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint GLCompute %foo "foo"
                OpExecutionMode %foo LocalSize 1 1 1
@@ -34,16 +34,16 @@
          %10 = OpTypeFunction %void
 %_ptr_Function_int = OpTypePointer Function %int
       %int_0 = OpConstant %int 0
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+     %uint_0 = OpConstant %uint 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %23 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %27 = OpConstantNull %v2uint
+         %27 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %31 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
      %uint_9 = OpConstant %uint 9
-%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
-     %uint_0 = OpConstant %uint 0
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_1 = OpConstant %uint 1
      %int_10 = OpConstant %int 10
@@ -56,56 +56,56 @@
                OpStore %i %int_0
                OpBranch %15
          %15 = OpLabel
-               OpStore %tint_loop_idx %23
+               OpStore %tint_loop_idx %27
                OpBranch %18
          %18 = OpLabel
                OpLoopMerge %19 %17 None
                OpBranch %16
          %16 = OpLabel
-         %25 = OpLoad %v2uint %tint_loop_idx None
-         %26 = OpIEqual %v2bool %25 %27
-         %30 = OpAll %bool %26
-               OpSelectionMerge %31 None
-               OpBranchConditional %30 %32 %31
-         %32 = OpLabel
+         %29 = OpLoad %v2uint %tint_loop_idx None
+         %30 = OpIEqual %v2bool %29 %31
+         %34 = OpAll %bool %30
+               OpSelectionMerge %35 None
+               OpBranchConditional %34 %36 %35
+         %36 = OpLabel
                OpBranch %19
-         %31 = OpLabel
-         %33 = OpLoad %int %i None
-         %34 = OpBitcast %uint %33
-         %35 = OpExtInst %uint %36 UMin %34 %uint_9
-         %38 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %35
-         %41 = OpLoad %int %38 None
-               OpStore %x %41
+         %35 = OpLabel
+         %37 = OpLoad %int %i None
+         %38 = OpBitcast %uint %37
+         %39 = OpExtInst %uint %40 UMin %38 %uint_9
+         %42 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %39
+         %43 = OpLoad %int %42 None
+               OpStore %x %43
                OpBranch %17
          %17 = OpLabel
-         %43 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %45 = OpLoad %uint %43 None
-%tint_low_inc = OpISub %uint %45 %uint_1
-         %48 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %48 %tint_low_inc None
-         %49 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %49 %uint_1 %uint_0
-         %51 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %52 = OpLoad %uint %51 None
-         %53 = OpISub %uint %52 %tint_carry
-         %54 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %54 %53 None
-         %55 = OpLoad %int %x None
-         %56 = OpBitcast %uint %55
-         %57 = OpExtInst %uint %36 UMin %56 %uint_9
-         %58 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %57
-         %59 = OpLoad %int %58 None
-               OpStore %x_0 %59
-         %61 = OpLoad %int %x_0 None
-         %62 = OpLoad %int %i None
-         %63 = OpIAdd %int %62 %61
-               OpStore %i %63 None
+         %45 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %47 = OpLoad %uint %45 None
+%tint_low_inc = OpISub %uint %47 %uint_1
+         %50 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %50 %tint_low_inc None
+         %51 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %51 %uint_1 %uint_0
+         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %54 = OpLoad %uint %53 None
+         %55 = OpISub %uint %54 %tint_carry
+         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %56 %55 None
+         %57 = OpLoad %int %x None
+         %58 = OpBitcast %uint %57
+         %59 = OpExtInst %uint %40 UMin %58 %uint_9
+         %60 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %59
+         %61 = OpLoad %int %60 None
+               OpStore %x_0 %61
+         %63 = OpLoad %int %x_0 None
          %64 = OpLoad %int %i None
-         %65 = OpSGreaterThan %bool %64 %int_10
-               OpBranchConditional %65 %19 %18
+         %65 = OpIAdd %int %64 %63
+               OpStore %i %65 None
+         %66 = OpLoad %int %i None
+         %67 = OpSGreaterThan %bool %66 %int_10
+               OpBranchConditional %67 %19 %18
          %19 = OpLabel
-         %67 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %uint_0
-         %68 = OpLoad %int %i None
-               OpStore %67 %68 None
+         %20 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0 %uint_0
+         %23 = OpLoad %int %i None
+               OpStore %20 %23 None
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.spvasm b/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.spvasm
index 1f22672..afb8885 100644
--- a/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.spvasm
+++ b/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.spvasm
@@ -41,10 +41,10 @@
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
        %uint = OpTypeInt 32 0
      %uint_0 = OpConstant %uint 0
+%__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool
+         %29 = OpUndef %__atomic_compare_exchange_result_i32
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
-%__atomic_compare_exchange_result_i32 = OpTypeStruct %int %bool
-         %33 = OpUndef %__atomic_compare_exchange_result_i32
        %void = OpTypeVoid
          %45 = OpTypeFunction %void
   %foo_inner = OpFunction %int None %12
@@ -57,31 +57,31 @@
                OpSelectionMerge %23 None
                OpBranchConditional %22 %24 %25
          %24 = OpLabel
-         %26 = OpAtomicCompareExchange %int %18 %uint_1 %uint_0 %uint_0 %int_1 %int_0
-         %29 = OpIEqual %bool %26 %int_0
-         %31 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %26 %29
+         %38 = OpAtomicCompareExchange %int %18 %uint_1 %uint_0 %uint_0 %int_1 %int_0
+         %41 = OpIEqual %bool %38 %int_0
+         %28 = OpCompositeConstruct %__atomic_compare_exchange_result_i32 %38 %41
                OpBranch %23
          %25 = OpLabel
                OpBranch %23
          %23 = OpLabel
-     %result = OpPhi %__atomic_compare_exchange_result_i32 %31 %24 %33 %25
-         %34 = OpCompositeExtract %bool %result 1
-               OpSelectionMerge %35 None
-               OpBranchConditional %34 %36 %35
-         %36 = OpLabel
-         %37 = OpCompositeExtract %int %result 0
-               OpStore %x %37 None
-               OpBranch %35
-         %35 = OpLabel
-         %38 = OpLoad %int %x None
-         %39 = OpLoad %bool %continue_execution None
-         %40 = OpLogicalNot %bool %39
-               OpSelectionMerge %41 None
-               OpBranchConditional %40 %42 %41
-         %42 = OpLabel
+     %result = OpPhi %__atomic_compare_exchange_result_i32 %28 %24 %29 %25
+         %30 = OpCompositeExtract %bool %result 1
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
+         %32 = OpLabel
+         %42 = OpCompositeExtract %int %result 0
+               OpStore %x %42 None
+               OpBranch %31
+         %31 = OpLabel
+         %33 = OpLoad %int %x None
+         %34 = OpLoad %bool %continue_execution None
+         %35 = OpLogicalNot %bool %34
+               OpSelectionMerge %36 None
+               OpBranchConditional %35 %37 %36
+         %37 = OpLabel
                OpKill
-         %41 = OpLabel
-               OpReturnValue %38
+         %36 = OpLabel
+               OpReturnValue %33
                OpFunctionEnd
         %foo = OpFunction %void None %45
          %46 = OpLabel
diff --git a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.spvasm b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.spvasm
index df77b52..ac7f17a 100644
--- a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.spvasm
+++ b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.spvasm
@@ -62,25 +62,25 @@
 %foo_loc0_Output = OpVariable %_ptr_Output_int Output
          %26 = OpTypeFunction %int %float %v2float
     %float_0 = OpConstant %float 0
-      %false = OpConstantFalse %bool
-         %36 = OpTypeSampledImage %3
+         %35 = OpTypeSampledImage %3
     %v4float = OpTypeVector %float 4
 %_ptr_Function_int = OpTypePointer Function %int
+      %false = OpConstantFalse %bool
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %53 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %58 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
       %int_0 = OpConstant %int 0
-         %59 = OpConstantNull %v2uint
+         %64 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
      %int_10 = OpConstant %int 10
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
 %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+         %98 = OpUndef %int
       %int_1 = OpConstant %int 1
-         %94 = OpUndef %int
         %101 = OpTypeFunction %int %float
 %float_n2_14748365e_09 = OpConstant %float -2.14748365e+09
 %int_n2147483648 = OpConstant %int -2147483648
@@ -102,78 +102,78 @@
                OpStore %continue_execution %false None
                OpBranch %30
          %30 = OpLabel
-         %33 = OpLoad %3 %t None
-         %34 = OpLoad %7 %s None
-         %35 = OpSampledImage %36 %33 %34
-         %37 = OpImageSampleImplicitLod %v4float %35 %coord None
-         %39 = OpCompositeExtract %float %37 0
-         %40 = OpFunctionCall %int %tint_f32_to_i32 %39
-               OpStore %result %40
-               OpBranch %44
-         %44 = OpLabel
-               OpStore %tint_loop_idx %53
+         %32 = OpLoad %3 %t None
+         %33 = OpLoad %7 %s None
+         %34 = OpSampledImage %35 %32 %33
+         %36 = OpImageSampleImplicitLod %v4float %34 %coord None
+         %38 = OpCompositeExtract %float %36 0
+         %39 = OpFunctionCall %int %tint_f32_to_i32 %38
+               OpStore %result %39
+               OpBranch %43
+         %43 = OpLabel
+               OpStore %tint_loop_idx %58
                OpStore %i %int_0
-               OpBranch %47
-         %47 = OpLabel
-               OpLoopMerge %48 %46 None
-               OpBranch %45
-         %45 = OpLabel
-         %57 = OpLoad %v2uint %tint_loop_idx None
-         %58 = OpIEqual %v2bool %57 %59
-         %61 = OpAll %bool %58
-               OpSelectionMerge %62 None
-               OpBranchConditional %61 %63 %62
-         %63 = OpLabel
-               OpBranch %48
-         %62 = OpLabel
-         %64 = OpLoad %int %i None
-         %65 = OpSLessThan %bool %64 %int_10
-               OpSelectionMerge %67 None
-               OpBranchConditional %65 %67 %68
-         %68 = OpLabel
-               OpBranch %48
-         %67 = OpLabel
-         %69 = OpLoad %int %i None
-         %70 = OpLoad %int %result None
-         %71 = OpIAdd %int %70 %69
-               OpStore %result %71 None
                OpBranch %46
          %46 = OpLabel
-         %72 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %75 = OpLoad %uint %72 None
-%tint_low_inc = OpISub %uint %75 %uint_1
-         %78 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %78 %tint_low_inc None
-         %79 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %79 %uint_1 %uint_0
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %82 = OpLoad %uint %81 None
-         %83 = OpISub %uint %82 %tint_carry
-         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %84 %83 None
-         %85 = OpAccessChain %_ptr_StorageBuffer_int %8 %uint_0
-         %87 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %88 None
-               OpBranchConditional %87 %89 %90
-         %89 = OpLabel
-         %91 = OpAtomicIAdd %int %85 %uint_1 %uint_0 %int_1
-               OpBranch %88
-         %90 = OpLabel
-               OpBranch %88
-         %88 = OpLabel
-         %93 = OpPhi %int %91 %89 %94 %90
-               OpStore %i %93 None
+               OpLoopMerge %47 %45 None
+               OpBranch %44
+         %44 = OpLabel
+         %62 = OpLoad %v2uint %tint_loop_idx None
+         %63 = OpIEqual %v2bool %62 %64
+         %66 = OpAll %bool %63
+               OpSelectionMerge %67 None
+               OpBranchConditional %66 %68 %67
+         %68 = OpLabel
                OpBranch %47
-         %48 = OpLabel
-         %95 = OpLoad %int %result None
-         %96 = OpLoad %bool %continue_execution None
-         %97 = OpLogicalNot %bool %96
-               OpSelectionMerge %98 None
-               OpBranchConditional %97 %99 %98
-         %99 = OpLabel
+         %67 = OpLabel
+         %69 = OpLoad %int %i None
+         %70 = OpSLessThan %bool %69 %int_10
+               OpSelectionMerge %72 None
+               OpBranchConditional %70 %72 %73
+         %73 = OpLabel
+               OpBranch %47
+         %72 = OpLabel
+         %74 = OpLoad %int %i None
+         %75 = OpLoad %int %result None
+         %76 = OpIAdd %int %75 %74
+               OpStore %result %76 None
+               OpBranch %45
+         %45 = OpLabel
+         %77 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %80 = OpLoad %uint %77 None
+%tint_low_inc = OpISub %uint %80 %uint_1
+         %83 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %83 %tint_low_inc None
+         %84 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %84 %uint_1 %uint_0
+         %86 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %87 = OpLoad %uint %86 None
+         %88 = OpISub %uint %87 %tint_carry
+         %89 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %89 %88 None
+         %90 = OpAccessChain %_ptr_StorageBuffer_int %8 %uint_0
+         %92 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %93 None
+               OpBranchConditional %92 %94 %95
+         %94 = OpLabel
+         %97 = OpAtomicIAdd %int %90 %uint_1 %uint_0 %int_1
+               OpBranch %93
+         %95 = OpLabel
+               OpBranch %93
+         %93 = OpLabel
+         %96 = OpPhi %int %97 %94 %98 %95
+               OpStore %i %96 None
+               OpBranch %46
+         %47 = OpLabel
+         %48 = OpLoad %int %result None
+         %49 = OpLoad %bool %continue_execution None
+         %50 = OpLogicalNot %bool %49
+               OpSelectionMerge %51 None
+               OpBranchConditional %50 %52 %51
+         %52 = OpLabel
                OpKill
-         %98 = OpLabel
-               OpReturnValue %95
+         %51 = OpLabel
+               OpReturnValue %48
                OpFunctionEnd
 %tint_f32_to_i32 = OpFunction %int None %101
       %value = OpFunctionParameter %float
diff --git a/test/tint/statements/discard/multiple_returns.wgsl.expected.spvasm b/test/tint/statements/discard/multiple_returns.wgsl.expected.spvasm
index d56a6a0..1023180 100644
--- a/test/tint/statements/discard/multiple_returns.wgsl.expected.spvasm
+++ b/test/tint/statements/discard/multiple_returns.wgsl.expected.spvasm
@@ -45,16 +45,16 @@
        %uint = OpTypeInt 32 0
      %uint_0 = OpConstant %uint 0
       %int_0 = OpConstant %int 0
-      %false = OpConstantFalse %bool
     %float_1 = OpConstant %float 1
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
     %float_0 = OpConstant %float 0
+      %false = OpConstantFalse %bool
 %_ptr_Function_int = OpTypePointer Function %int
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %50 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-         %54 = OpConstantNull %v2uint
+         %58 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
+         %62 = OpConstantNull %v2uint
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_1 = OpConstant %uint 1
@@ -73,95 +73,56 @@
                OpStore %continue_execution %false None
                OpBranch %24
          %24 = OpLabel
-         %27 = OpDPdx %float %float_1
-         %29 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
-         %31 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %32 None
-               OpBranchConditional %31 %33 %32
-         %33 = OpLabel
-               OpStore %29 %27 None
-               OpBranch %32
+         %26 = OpDPdx %float %float_1
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
+         %30 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
          %32 = OpLabel
-         %34 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
-         %35 = OpLoad %float %34 None
-         %36 = OpFOrdLessThan %bool %35 %float_0
-               OpSelectionMerge %38 None
-               OpBranchConditional %36 %39 %38
-         %39 = OpLabel
+               OpStore %28 %26 None
+               OpBranch %31
+         %31 = OpLabel
+         %33 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
+         %34 = OpLoad %float %33 None
+         %35 = OpFOrdLessThan %bool %34 %float_0
+               OpSelectionMerge %37 None
+               OpBranchConditional %35 %38 %37
+         %38 = OpLabel
                OpStore %i %int_0
-               OpBranch %42
-         %42 = OpLabel
-               OpStore %tint_loop_idx %50
-               OpBranch %45
-         %45 = OpLabel
-               OpLoopMerge %46 %44 None
-               OpBranch %43
-         %43 = OpLabel
-         %52 = OpLoad %v2uint %tint_loop_idx None
-         %53 = OpIEqual %v2bool %52 %54
-         %56 = OpAll %bool %53
-               OpSelectionMerge %57 None
-               OpBranchConditional %56 %58 %57
-         %58 = OpLabel
                OpBranch %46
-         %57 = OpLabel
-         %59 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
-         %60 = OpLoad %float %59 None
-         %61 = OpLoad %int %i None
-         %62 = OpConvertSToF %float %61
-         %63 = OpFOrdGreaterThan %bool %60 %62
-               OpSelectionMerge %64 None
-               OpBranchConditional %63 %65 %64
-         %65 = OpLabel
-         %66 = OpLoad %int %i None
-         %67 = OpConvertSToF %float %66
-         %68 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
-         %69 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %70 None
-               OpBranchConditional %69 %71 %70
-         %71 = OpLabel
-               OpStore %68 %67 None
-               OpBranch %70
-         %70 = OpLabel
-         %72 = OpLoad %bool %continue_execution None
-         %73 = OpLogicalNot %bool %72
-               OpSelectionMerge %74 None
-               OpBranchConditional %73 %75 %74
-         %75 = OpLabel
-               OpKill
-         %74 = OpLabel
-               OpReturn
-         %64 = OpLabel
-               OpBranch %44
-         %44 = OpLabel
-         %76 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %78 = OpLoad %uint %76 None
-%tint_low_inc = OpISub %uint %78 %uint_1
-         %81 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %81 %tint_low_inc None
-         %82 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %82 %uint_1 %uint_0
-         %84 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %85 = OpLoad %uint %84 None
-         %86 = OpISub %uint %85 %tint_carry
-         %87 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %87 %86 None
-         %88 = OpLoad %int %i None
-         %89 = OpIAdd %int %88 %int_1
-               OpStore %i %89 None
-         %91 = OpLoad %int %i None
-         %92 = OpIEqual %bool %91 %int_5
-               OpBranchConditional %92 %46 %45
          %46 = OpLabel
-         %94 = OpLoad %bool %continue_execution None
-         %95 = OpLogicalNot %bool %94
+               OpStore %tint_loop_idx %58
+               OpBranch %49
+         %49 = OpLabel
+               OpLoopMerge %50 %48 None
+               OpBranch %47
+         %47 = OpLabel
+         %60 = OpLoad %v2uint %tint_loop_idx None
+         %61 = OpIEqual %v2bool %60 %62
+         %64 = OpAll %bool %61
+               OpSelectionMerge %65 None
+               OpBranchConditional %64 %66 %65
+         %66 = OpLabel
+               OpBranch %50
+         %65 = OpLabel
+         %67 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
+         %68 = OpLoad %float %67 None
+         %69 = OpLoad %int %i None
+         %70 = OpConvertSToF %float %69
+         %71 = OpFOrdGreaterThan %bool %68 %70
+               OpSelectionMerge %72 None
+               OpBranchConditional %71 %73 %72
+         %73 = OpLabel
+         %92 = OpLoad %int %i None
+         %93 = OpConvertSToF %float %92
+         %94 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
+         %95 = OpLoad %bool %continue_execution None
                OpSelectionMerge %96 None
                OpBranchConditional %95 %97 %96
          %97 = OpLabel
-               OpKill
+               OpStore %94 %93 None
+               OpBranch %96
          %96 = OpLabel
-               OpReturn
-         %38 = OpLabel
          %98 = OpLoad %bool %continue_execution None
          %99 = OpLogicalNot %bool %98
                OpSelectionMerge %100 None
@@ -170,4 +131,43 @@
                OpKill
         %100 = OpLabel
                OpReturn
+         %72 = OpLabel
+               OpBranch %48
+         %48 = OpLabel
+         %74 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %76 = OpLoad %uint %74 None
+%tint_low_inc = OpISub %uint %76 %uint_1
+         %79 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %79 %tint_low_inc None
+         %80 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %80 %uint_1 %uint_0
+         %82 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %83 = OpLoad %uint %82 None
+         %84 = OpISub %uint %83 %tint_carry
+         %85 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %85 %84 None
+         %86 = OpLoad %int %i None
+         %87 = OpIAdd %int %86 %int_1
+               OpStore %i %87 None
+         %89 = OpLoad %int %i None
+         %90 = OpIEqual %bool %89 %int_5
+               OpBranchConditional %90 %50 %49
+         %50 = OpLabel
+         %51 = OpLoad %bool %continue_execution None
+         %52 = OpLogicalNot %bool %51
+               OpSelectionMerge %53 None
+               OpBranchConditional %52 %54 %53
+         %54 = OpLabel
+               OpKill
+         %53 = OpLabel
+               OpReturn
+         %37 = OpLabel
+         %39 = OpLoad %bool %continue_execution None
+         %40 = OpLogicalNot %bool %39
+               OpSelectionMerge %41 None
+               OpBranchConditional %40 %42 %41
+         %42 = OpLabel
+               OpKill
+         %41 = OpLabel
+               OpReturn
                OpFunctionEnd
diff --git a/test/tint/statements/discard/nested_return.wgsl.expected.spvasm b/test/tint/statements/discard/nested_return.wgsl.expected.spvasm
index c2d2be9..cdcabb7 100644
--- a/test/tint/statements/discard/nested_return.wgsl.expected.spvasm
+++ b/test/tint/statements/discard/nested_return.wgsl.expected.spvasm
@@ -42,12 +42,12 @@
                OpStore %continue_execution %false None
                OpBranch %20
          %20 = OpLabel
-         %23 = OpLoad %bool %continue_execution None
-         %24 = OpLogicalNot %bool %23
-               OpSelectionMerge %25 None
-               OpBranchConditional %24 %26 %25
-         %26 = OpLabel
-               OpKill
+         %22 = OpLoad %bool %continue_execution None
+         %23 = OpLogicalNot %bool %22
+               OpSelectionMerge %24 None
+               OpBranchConditional %23 %25 %24
          %25 = OpLabel
+               OpKill
+         %24 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/statements/discard/non_uniform.wgsl.expected.spvasm b/test/tint/statements/discard/non_uniform.wgsl.expected.spvasm
index 922ec42..543b058 100644
--- a/test/tint/statements/discard/non_uniform.wgsl.expected.spvasm
+++ b/test/tint/statements/discard/non_uniform.wgsl.expected.spvasm
@@ -41,9 +41,9 @@
        %uint = OpTypeInt 32 0
      %uint_0 = OpConstant %uint 0
       %int_0 = OpConstant %int 0
-      %false = OpConstantFalse %bool
     %float_1 = OpConstant %float 1
 %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
+      %false = OpConstantFalse %bool
        %main = OpFunction %void None %15
          %16 = OpLabel
          %17 = OpAccessChain %_ptr_StorageBuffer_int %1 %uint_0
@@ -55,21 +55,21 @@
                OpStore %continue_execution %false None
                OpBranch %24
          %24 = OpLabel
-         %27 = OpDPdx %float %float_1
-         %29 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
-         %31 = OpLoad %bool %continue_execution None
-               OpSelectionMerge %32 None
-               OpBranchConditional %31 %33 %32
-         %33 = OpLabel
-               OpStore %29 %27 None
-               OpBranch %32
+         %26 = OpDPdx %float %float_1
+         %28 = OpAccessChain %_ptr_StorageBuffer_float %5 %uint_0
+         %30 = OpLoad %bool %continue_execution None
+               OpSelectionMerge %31 None
+               OpBranchConditional %30 %32 %31
          %32 = OpLabel
-         %34 = OpLoad %bool %continue_execution None
-         %35 = OpLogicalNot %bool %34
-               OpSelectionMerge %36 None
-               OpBranchConditional %35 %37 %36
-         %37 = OpLabel
-               OpKill
+               OpStore %28 %26 None
+               OpBranch %31
+         %31 = OpLabel
+         %33 = OpLoad %bool %continue_execution None
+         %34 = OpLogicalNot %bool %33
+               OpSelectionMerge %35 None
+               OpBranchConditional %34 %36 %35
          %36 = OpLabel
+               OpKill
+         %35 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/statements/for/complex.wgsl.expected.spvasm b/test/tint/statements/for/complex.wgsl.expected.spvasm
index ea80677..1619b7e 100644
--- a/test/tint/statements/for/complex.wgsl.expected.spvasm
+++ b/test/tint/statements/for/complex.wgsl.expected.spvasm
@@ -30,13 +30,13 @@
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
       %int_5 = OpConstant %int 5
-     %int_10 = OpConstant %int 10
       %false = OpConstantFalse %bool
      %int_30 = OpConstant %int 30
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
       %int_1 = OpConstant %int 1
+     %int_10 = OpConstant %int 10
 %some_loop_body = OpFunction %void None %3
           %4 = OpLabel
                OpReturn
@@ -68,39 +68,39 @@
                OpSelectionMerge %35 None
                OpBranchConditional %33 %36 %37
          %36 = OpLabel
-         %38 = OpLoad %int %j None
-         %39 = OpSLessThan %bool %38 %int_10
+         %63 = OpLoad %int %j None
+         %39 = OpSLessThan %bool %63 %int_10
                OpBranch %35
          %37 = OpLabel
                OpBranch %35
          %35 = OpLabel
-         %41 = OpPhi %bool %39 %36 %false %37
-               OpSelectionMerge %43 None
-               OpBranchConditional %41 %43 %44
-         %44 = OpLabel
+         %38 = OpPhi %bool %39 %36 %false %37
+               OpSelectionMerge %41 None
+               OpBranchConditional %38 %41 %42
+         %42 = OpLabel
                OpBranch %15
-         %43 = OpLabel
-         %45 = OpFunctionCall %void %some_loop_body
-         %46 = OpLoad %int %i None
-         %47 = OpIMul %int %46 %int_30
-               OpStore %j %47 None
+         %41 = OpLabel
+         %43 = OpFunctionCall %void %some_loop_body
+         %44 = OpLoad %int %i None
+         %45 = OpIMul %int %44 %int_30
+               OpStore %j %45 None
                OpBranch %13
          %13 = OpLabel
-         %49 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %52 = OpLoad %uint %49 None
-%tint_low_inc = OpISub %uint %52 %uint_1
-         %55 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %55 %tint_low_inc None
-         %56 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %56 %uint_1 %uint_0
-         %58 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %59 = OpLoad %uint %58 None
-         %60 = OpISub %uint %59 %tint_carry
-         %61 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %61 %60 None
-         %62 = OpLoad %int %i None
-         %63 = OpIAdd %int %62 %int_1
-               OpStore %i %63 None
+         %47 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %50 = OpLoad %uint %47 None
+%tint_low_inc = OpISub %uint %50 %uint_1
+         %53 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %53 %tint_low_inc None
+         %54 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %54 %uint_1 %uint_0
+         %56 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %57 = OpLoad %uint %56 None
+         %58 = OpISub %uint %57 %tint_carry
+         %59 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %59 %58 None
+         %60 = OpLoad %int %i None
+         %61 = OpIAdd %int %60 %int_1
+               OpStore %i %61 None
                OpBranch %14
          %15 = OpLabel
                OpReturn
diff --git a/test/tint/statements/for/scoping.wgsl.expected.spvasm b/test/tint/statements/for/scoping.wgsl.expected.spvasm
index a457d59..e315646 100644
--- a/test/tint/statements/for/scoping.wgsl.expected.spvasm
+++ b/test/tint/statements/for/scoping.wgsl.expected.spvasm
@@ -8,65 +8,65 @@
                OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
                OpExecutionMode %unused_entry_point LocalSize 1 1 1
                OpName %f "f"
-               OpName %tint_loop_idx "tint_loop_idx"
                OpName %must_not_collide "must_not_collide"
+               OpName %tint_loop_idx "tint_loop_idx"
+               OpName %must_not_collide_0 "must_not_collide"
                OpName %tint_low_inc "tint_low_inc"
                OpName %tint_carry "tint_carry"
-               OpName %must_not_collide_0 "must_not_collide"
                OpName %unused_entry_point "unused_entry_point"
        %void = OpTypeVoid
           %3 = OpTypeFunction %void
+        %int = OpTypeInt 32 1
+%_ptr_Function_int = OpTypePointer Function %int
+         %13 = OpConstantNull %int
        %uint = OpTypeInt 32 0
      %v2uint = OpTypeVector %uint 2
 %_ptr_Function_v2uint = OpTypePointer Function %v2uint
 %uint_4294967295 = OpConstant %uint 4294967295
-         %14 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
-        %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
+         %18 = OpConstantComposite %v2uint %uint_4294967295 %uint_4294967295
       %int_0 = OpConstant %int 0
-         %22 = OpConstantNull %v2uint
+         %24 = OpConstantNull %v2uint
        %bool = OpTypeBool
      %v2bool = OpTypeVector %bool 2
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_0 = OpConstant %uint 0
      %uint_1 = OpConstant %uint 1
-         %42 = OpConstantNull %int
           %f = OpFunction %void None %3
           %4 = OpLabel
+%must_not_collide = OpVariable %_ptr_Function_int Function %13
 %tint_loop_idx = OpVariable %_ptr_Function_v2uint Function
-%must_not_collide = OpVariable %_ptr_Function_int Function
-%must_not_collide_0 = OpVariable %_ptr_Function_int Function %42
+%must_not_collide_0 = OpVariable %_ptr_Function_int Function
                OpBranch %5
           %5 = OpLabel
-               OpStore %tint_loop_idx %14
-               OpStore %must_not_collide %int_0
+               OpStore %tint_loop_idx %18
+               OpStore %must_not_collide_0 %int_0
                OpBranch %8
           %8 = OpLabel
                OpLoopMerge %9 %7 None
                OpBranch %6
           %6 = OpLabel
-         %20 = OpLoad %v2uint %tint_loop_idx None
-         %21 = OpIEqual %v2bool %20 %22
-         %25 = OpAll %bool %21
-               OpSelectionMerge %26 None
-               OpBranchConditional %25 %27 %26
-         %27 = OpLabel
+         %22 = OpLoad %v2uint %tint_loop_idx None
+         %23 = OpIEqual %v2bool %22 %24
+         %27 = OpAll %bool %23
+               OpSelectionMerge %28 None
+               OpBranchConditional %27 %29 %28
+         %29 = OpLabel
                OpBranch %9
-         %26 = OpLabel
+         %28 = OpLabel
                OpBranch %9
           %7 = OpLabel
-         %28 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-         %31 = OpLoad %uint %28 None
-%tint_low_inc = OpISub %uint %31 %uint_1
-         %34 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
-               OpStore %34 %tint_low_inc None
-         %35 = OpIEqual %bool %tint_low_inc %uint_4294967295
- %tint_carry = OpSelect %uint %35 %uint_1 %uint_0
-         %37 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-         %38 = OpLoad %uint %37 None
-         %39 = OpISub %uint %38 %tint_carry
-         %40 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
-               OpStore %40 %39 None
+         %30 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+         %33 = OpLoad %uint %30 None
+%tint_low_inc = OpISub %uint %33 %uint_1
+         %36 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_0
+               OpStore %36 %tint_low_inc None
+         %37 = OpIEqual %bool %tint_low_inc %uint_4294967295
+ %tint_carry = OpSelect %uint %37 %uint_1 %uint_0
+         %39 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+         %40 = OpLoad %uint %39 None
+         %41 = OpISub %uint %40 %tint_carry
+         %42 = OpAccessChain %_ptr_Function_uint %tint_loop_idx %uint_1
+               OpStore %42 %41 None
                OpBranch %8
           %9 = OpLabel
                OpReturn
diff --git a/test/tint/statements/switch/common.wgsl.expected.spvasm b/test/tint/statements/switch/common.wgsl.expected.spvasm
index 183372c..4d88492 100644
--- a/test/tint/statements/switch/common.wgsl.expected.spvasm
+++ b/test/tint/statements/switch/common.wgsl.expected.spvasm
@@ -26,6 +26,9 @@
          %10 = OpLoad %int %i None
                OpSelectionMerge %15 None
                OpSwitch %10 %11 0 %12 1 %13 2 %14
+         %11 = OpLabel
+               OpStore %result %int_44 None
+               OpBranch %15
          %12 = OpLabel
                OpStore %result %int_10 None
                OpBranch %15
@@ -35,9 +38,6 @@
          %14 = OpLabel
                OpStore %result %int_33 None
                OpBranch %15
-         %11 = OpLabel
-               OpStore %result %int_44 None
-               OpBranch %15
          %15 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/switch/switch.wgsl.expected.spvasm b/test/tint/switch/switch.wgsl.expected.spvasm
index 98f1f66..2ec658b 100644
--- a/test/tint/switch/switch.wgsl.expected.spvasm
+++ b/test/tint/switch/switch.wgsl.expected.spvasm
@@ -23,15 +23,15 @@
           %9 = OpLoad %int %a_0 None
                OpSelectionMerge %13 None
                OpSwitch %9 %10 0 %11 1 %12
-         %11 = OpLabel
-               OpBranch %13
-         %12 = OpLabel
-               OpBranch %13
          %10 = OpLabel
          %14 = OpLoad %int %a_0 None
          %15 = OpIAdd %int %14 %int_2
                OpStore %a_0 %15 None
                OpBranch %13
+         %11 = OpLabel
+               OpBranch %13
+         %12 = OpLabel
+               OpBranch %13
          %13 = OpLabel
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/switch/switch_nested.wgsl.expected.spvasm b/test/tint/switch/switch_nested.wgsl.expected.spvasm
index 081ac53..04e3520 100644
--- a/test/tint/switch/switch_nested.wgsl.expected.spvasm
+++ b/test/tint/switch/switch_nested.wgsl.expected.spvasm
@@ -24,8 +24,8 @@
        %uint = OpTypeInt 32 0
 %_ptr_Function_uint = OpTypePointer Function %uint
      %uint_3 = OpConstant %uint 3
-   %uint_123 = OpConstant %uint 123
       %false = OpConstantFalse %bool
+   %uint_123 = OpConstant %uint 123
           %a = OpFunction %void None %3
           %4 = OpLabel
 %continue_execution = OpVariable %_ptr_Function_bool Function
@@ -46,15 +46,15 @@
                OpBranch %24
          %22 = OpLabel
                OpStore %c %uint_123
-         %27 = OpLoad %uint %c None
-               OpSelectionMerge %30 None
-               OpSwitch %27 %28 0 %29
+         %28 = OpLoad %uint %c None
+               OpSelectionMerge %31 None
+               OpSwitch %28 %29 0 %30
          %29 = OpLabel
-               OpBranch %30
-         %28 = OpLabel
                OpStore %continue_execution %false None
-               OpBranch %30
+               OpBranch %31
          %30 = OpLabel
+               OpBranch %31
+         %31 = OpLabel
          %32 = OpLoad %bool %continue_execution None
                OpSelectionMerge %33 None
                OpBranchConditional %32 %34 %33
diff --git a/test/tint/types/module_scope_used_in_functions.wgsl.expected.spvasm b/test/tint/types/module_scope_used_in_functions.wgsl.expected.spvasm
index db5eb62..26cdc8b 100644
--- a/test/tint/types/module_scope_used_in_functions.wgsl.expected.spvasm
+++ b/test/tint/types/module_scope_used_in_functions.wgsl.expected.spvasm
@@ -70,10 +70,10 @@
          %53 = OpTypeFunction %void %float
          %59 = OpTypeFunction %void %uint
        %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
     %float_1 = OpConstant %float 1
+    %float_0 = OpConstant %float 0
     %no_uses = OpFunction %void None %20
          %21 = OpLabel
                OpReturn
@@ -122,7 +122,7 @@
                OpBranch %63
          %63 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %69 = OpFunctionCall %void %foo %float_1
+         %68 = OpFunctionCall %void %foo %float_1
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %20
diff --git a/test/tint/types/module_scope_var.wgsl.expected.spvasm b/test/tint/types/module_scope_var.wgsl.expected.spvasm
index 9e0d0f6..30e57f4 100644
--- a/test/tint/types/module_scope_var.wgsl.expected.spvasm
+++ b/test/tint/types/module_scope_var.wgsl.expected.spvasm
@@ -74,12 +74,12 @@
        %void = OpTypeVoid
          %50 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
-    %float_0 = OpConstant %float 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
       %false = OpConstantFalse %bool
       %int_0 = OpConstant %int 0
      %uint_0 = OpConstant %uint 0
+    %float_0 = OpConstant %float 0
    %float_42 = OpConstant %float 42
          %65 = OpTypeFunction %void
  %main_inner = OpFunction %void None %50
diff --git a/test/tint/types/module_scope_vars_pointers.wgsl.expected.spvasm b/test/tint/types/module_scope_vars_pointers.wgsl.expected.spvasm
index d4e48f6..6570db6 100644
--- a/test/tint/types/module_scope_vars_pointers.wgsl.expected.spvasm
+++ b/test/tint/types/module_scope_vars_pointers.wgsl.expected.spvasm
@@ -30,9 +30,9 @@
          %13 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-    %float_0 = OpConstant %float 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+    %float_0 = OpConstant %float 0
          %28 = OpTypeFunction %void
  %main_inner = OpFunction %void None %13
 %tint_local_index = OpFunctionParameter %uint
@@ -45,9 +45,9 @@
                OpBranch %18
          %18 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %24 = OpLoad %float %p None
-         %25 = OpLoad %float %w None
-          %x = OpFAdd %float %24 %25
+         %23 = OpLoad %float %p None
+         %24 = OpLoad %float %w None
+          %x = OpFAdd %float %23 %24
                OpStore %p %x None
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.spvasm
index 7e8dc12..81ca458 100644
--- a/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/array/array_i32.wgsl.expected.spvasm
@@ -26,13 +26,13 @@
 %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %14 = OpTypeFunction %void %uint
+   %uint_264 = OpConstant %uint 264
+%_ptr_Function__arr__arr_int_uint_3_uint_2 = OpTypePointer Function %_arr__arr_int_uint_3_uint_2
      %uint_6 = OpConstant %uint 6
        %bool = OpTypeBool
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %int_0 = OpConstant %int 0
      %uint_1 = OpConstant %uint 1
-   %uint_264 = OpConstant %uint 264
-%_ptr_Function__arr__arr_int_uint_3_uint_2 = OpTypePointer Function %_arr__arr_int_uint_3_uint_2
          %40 = OpTypeFunction %void
  %main_inner = OpFunction %void None %14
 %tint_local_index = OpFunctionParameter %uint
@@ -46,24 +46,24 @@
                OpLoopMerge %20 %18 None
                OpBranch %17
          %17 = OpLabel
-         %23 = OpUGreaterThanEqual %bool %21 %uint_6
-               OpSelectionMerge %26 None
-               OpBranchConditional %23 %27 %26
-         %27 = OpLabel
+         %28 = OpUGreaterThanEqual %bool %21 %uint_6
+               OpSelectionMerge %31 None
+               OpBranchConditional %28 %32 %31
+         %32 = OpLabel
                OpBranch %20
-         %26 = OpLabel
-         %28 = OpUMod %uint %21 %uint_3
-         %29 = OpUDiv %uint %21 %uint_3
-         %30 = OpAccessChain %_ptr_Workgroup_int %zero %29 %28
-               OpStore %30 %int_0 None
+         %31 = OpLabel
+         %33 = OpUMod %uint %21 %uint_3
+         %34 = OpUDiv %uint %21 %uint_3
+         %35 = OpAccessChain %_ptr_Workgroup_int %zero %34 %33
+               OpStore %35 %int_0 None
                OpBranch %18
          %18 = OpLabel
          %22 = OpIAdd %uint %21 %uint_1
                OpBranch %19
          %20 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %36 = OpLoad %_arr__arr_int_uint_3_uint_2 %zero None
-               OpStore %v %36
+         %25 = OpLoad %_arr__arr_int_uint_3_uint_2 %zero None
+               OpStore %v %25
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %40
diff --git a/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.spvasm
index b24c0fb..ffaf7c1 100644
--- a/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/array/i32.wgsl.expected.spvasm
@@ -24,13 +24,13 @@
 %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %12 = OpTypeFunction %void %uint
+     %uint_2 = OpConstant %uint 2
+   %uint_264 = OpConstant %uint 264
+%_ptr_Function__arr_int_uint_3 = OpTypePointer Function %_arr_int_uint_3
        %bool = OpTypeBool
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %int_0 = OpConstant %int 0
      %uint_1 = OpConstant %uint 1
-     %uint_2 = OpConstant %uint 2
-   %uint_264 = OpConstant %uint 264
-%_ptr_Function__arr_int_uint_3 = OpTypePointer Function %_arr_int_uint_3
          %36 = OpTypeFunction %void
  %main_inner = OpFunction %void None %12
 %tint_local_index = OpFunctionParameter %uint
@@ -44,22 +44,22 @@
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %21 = OpUGreaterThanEqual %bool %19 %uint_3
-               OpSelectionMerge %23 None
-               OpBranchConditional %21 %24 %23
-         %24 = OpLabel
+         %27 = OpUGreaterThanEqual %bool %19 %uint_3
+               OpSelectionMerge %29 None
+               OpBranchConditional %27 %30 %29
+         %30 = OpLabel
                OpBranch %18
-         %23 = OpLabel
-         %25 = OpAccessChain %_ptr_Workgroup_int %zero %19
-               OpStore %25 %int_0 None
+         %29 = OpLabel
+         %31 = OpAccessChain %_ptr_Workgroup_int %zero %19
+               OpStore %31 %int_0 None
                OpBranch %16
          %16 = OpLabel
          %20 = OpIAdd %uint %19 %uint_1
                OpBranch %17
          %18 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpLoad %_arr_int_uint_3 %zero None
-               OpStore %v %32
+         %24 = OpLoad %_arr_int_uint_3 %zero None
+               OpStore %v %24
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %36
diff --git a/test/tint/var/initialization/workgroup/array/u32_large.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/array/u32_large.wgsl.expected.spvasm
index 16a4148..580f7a7 100644
--- a/test/tint/var/initialization/workgroup/array/u32_large.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/array/u32_large.wgsl.expected.spvasm
@@ -24,13 +24,13 @@
 %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input
        %void = OpTypeVoid
          %12 = OpTypeFunction %void %uint
+     %uint_2 = OpConstant %uint 2
+   %uint_264 = OpConstant %uint 264
+%_ptr_Function__arr_int_uint_23 = OpTypePointer Function %_arr_int_uint_23
        %bool = OpTypeBool
 %_ptr_Workgroup_int = OpTypePointer Workgroup %int
       %int_0 = OpConstant %int 0
     %uint_13 = OpConstant %uint 13
-     %uint_2 = OpConstant %uint 2
-   %uint_264 = OpConstant %uint 264
-%_ptr_Function__arr_int_uint_23 = OpTypePointer Function %_arr_int_uint_23
          %36 = OpTypeFunction %void
  %main_inner = OpFunction %void None %12
 %tint_local_index = OpFunctionParameter %uint
@@ -44,22 +44,22 @@
                OpLoopMerge %18 %16 None
                OpBranch %15
          %15 = OpLabel
-         %21 = OpUGreaterThanEqual %bool %19 %uint_23
-               OpSelectionMerge %23 None
-               OpBranchConditional %21 %24 %23
-         %24 = OpLabel
+         %27 = OpUGreaterThanEqual %bool %19 %uint_23
+               OpSelectionMerge %29 None
+               OpBranchConditional %27 %30 %29
+         %30 = OpLabel
                OpBranch %18
-         %23 = OpLabel
-         %25 = OpAccessChain %_ptr_Workgroup_int %zero %19
-               OpStore %25 %int_0 None
+         %29 = OpLabel
+         %31 = OpAccessChain %_ptr_Workgroup_int %zero %19
+               OpStore %31 %int_0 None
                OpBranch %16
          %16 = OpLabel
          %20 = OpIAdd %uint %19 %uint_13
                OpBranch %17
          %18 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %32 = OpLoad %_arr_int_uint_23 %zero None
-               OpStore %v %32
+         %24 = OpLoad %_arr_int_uint_23 %zero None
+               OpStore %v %24
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %36
diff --git a/test/tint/var/initialization/workgroup/array/u32_small.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/array/u32_small.wgsl.expected.spvasm
index b225461..d778fc2 100644
--- a/test/tint/var/initialization/workgroup/array/u32_small.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/array/u32_small.wgsl.expected.spvasm
@@ -25,11 +25,11 @@
        %void = OpTypeVoid
          %12 = OpTypeFunction %void %uint
        %bool = OpTypeBool
-%_ptr_Workgroup_int = OpTypePointer Workgroup %int
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Function__arr_int_uint_3 = OpTypePointer Function %_arr_int_uint_3
+%_ptr_Workgroup_int = OpTypePointer Workgroup %int
+      %int_0 = OpConstant %int 0
          %28 = OpTypeFunction %void
  %main_inner = OpFunction %void None %12
 %tint_local_index = OpFunctionParameter %uint
@@ -39,13 +39,13 @@
                OpSelectionMerge %16 None
                OpBranchConditional %14 %17 %16
          %17 = OpLabel
-         %18 = OpAccessChain %_ptr_Workgroup_int %zero %tint_local_index
-               OpStore %18 %int_0 None
+         %24 = OpAccessChain %_ptr_Workgroup_int %zero %tint_local_index
+               OpStore %24 %int_0 None
                OpBranch %16
          %16 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %24 = OpLoad %_arr_int_uint_3 %zero None
-               OpStore %v %24
+         %21 = OpLoad %_arr_int_uint_3 %zero None
+               OpStore %v %21
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %28
diff --git a/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm
index c814618..9215a63 100644
--- a/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/matrix.wgsl.expected.spvasm
@@ -25,9 +25,9 @@
          %12 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %19 = OpConstantNull %mat2v3float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %23 = OpConstantNull %mat2v3float
          %25 = OpTypeFunction %void
  %main_inner = OpFunction %void None %12
 %tint_local_index = OpFunctionParameter %uint
@@ -36,11 +36,11 @@
                OpSelectionMerge %17 None
                OpBranchConditional %14 %18 %17
          %18 = OpLabel
-               OpStore %v %19 None
+               OpStore %v %23 None
                OpBranch %17
          %17 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %23 = OpLoad %mat2v3float %v None
+         %22 = OpLoad %mat2v3float %v None
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %25
diff --git a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm
index 716c9d1..c0cad2d 100644
--- a/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/scalar.wgsl.expected.spvasm
@@ -24,9 +24,9 @@
          %10 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+      %int_0 = OpConstant %int 0
          %23 = OpTypeFunction %void
  %main_inner = OpFunction %void None %10
 %tint_local_index = OpFunctionParameter %uint
diff --git a/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm
index c4a5c35..4d95b3e 100644
--- a/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/struct.wgsl.expected.spvasm
@@ -28,9 +28,9 @@
          %12 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %19 = OpConstantNull %S
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %23 = OpConstantNull %S
          %25 = OpTypeFunction %void
  %main_inner = OpFunction %void None %12
 %tint_local_index = OpFunctionParameter %uint
@@ -39,11 +39,11 @@
                OpSelectionMerge %17 None
                OpBranchConditional %14 %18 %17
          %18 = OpLabel
-               OpStore %v %19 None
+               OpStore %v %23 None
                OpBranch %17
          %17 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %23 = OpLoad %S %v None
+         %22 = OpLoad %S %v None
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %25
diff --git a/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm b/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm
index 2499d08..6e58df2 100644
--- a/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm
+++ b/test/tint/var/initialization/workgroup/vector.wgsl.expected.spvasm
@@ -24,9 +24,9 @@
          %11 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-         %18 = OpConstantNull %v3int
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
+         %22 = OpConstantNull %v3int
          %24 = OpTypeFunction %void
  %main_inner = OpFunction %void None %11
 %tint_local_index = OpFunctionParameter %uint
@@ -35,11 +35,11 @@
                OpSelectionMerge %16 None
                OpBranchConditional %13 %17 %16
          %17 = OpLabel
-               OpStore %v %18 None
+               OpStore %v %22 None
                OpBranch %16
          %16 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-         %22 = OpLoad %v3int %v None
+         %21 = OpLoad %v3int %v None
                OpReturn
                OpFunctionEnd
        %main = OpFunction %void None %24
diff --git a/test/tint/var/uses/many_workgroup_vars.wgsl.expected.spvasm b/test/tint/var/uses/many_workgroup_vars.wgsl.expected.spvasm
index 3276b4b..d15d701 100644
--- a/test/tint/var/uses/many_workgroup_vars.wgsl.expected.spvasm
+++ b/test/tint/var/uses/many_workgroup_vars.wgsl.expected.spvasm
@@ -223,13 +223,13 @@
         %111 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-        %118 = OpConstantNull %mat2v2float
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
 %_ptr_Workgroup_v2float = OpTypePointer Workgroup %v2float
      %uint_0 = OpConstant %uint 0
 %_ptr_Workgroup_float = OpTypePointer Workgroup %float
     %float_1 = OpConstant %float 1
+        %325 = OpConstantNull %mat2v2float
         %327 = OpTypeFunction %void
 %tint_symbol_inner = OpFunction %void None %111
         %idx = OpFunctionParameter %uint
@@ -238,409 +238,409 @@
                OpSelectionMerge %116 None
                OpBranchConditional %113 %117 %116
         %117 = OpLabel
-               OpStore %m00 %118 None
-               OpStore %m01 %118 None
-               OpStore %m02 %118 None
-               OpStore %m03 %118 None
-               OpStore %m04 %118 None
-               OpStore %m05 %118 None
-               OpStore %m06 %118 None
-               OpStore %m07 %118 None
-               OpStore %m08 %118 None
-               OpStore %m09 %118 None
-               OpStore %m10 %118 None
-               OpStore %m11 %118 None
-               OpStore %m12 %118 None
-               OpStore %m13 %118 None
-               OpStore %m14 %118 None
-               OpStore %m15 %118 None
-               OpStore %m16 %118 None
-               OpStore %m17 %118 None
-               OpStore %m18 %118 None
-               OpStore %m19 %118 None
-               OpStore %m20 %118 None
-               OpStore %m21 %118 None
-               OpStore %m22 %118 None
-               OpStore %m23 %118 None
-               OpStore %m24 %118 None
-               OpStore %m25 %118 None
-               OpStore %m26 %118 None
-               OpStore %m27 %118 None
-               OpStore %m28 %118 None
-               OpStore %m29 %118 None
-               OpStore %m30 %118 None
-               OpStore %m31 %118 None
-               OpStore %m32 %118 None
-               OpStore %m33 %118 None
-               OpStore %m34 %118 None
-               OpStore %m35 %118 None
-               OpStore %m36 %118 None
-               OpStore %m37 %118 None
-               OpStore %m38 %118 None
-               OpStore %m39 %118 None
-               OpStore %m40 %118 None
-               OpStore %m41 %118 None
-               OpStore %m42 %118 None
-               OpStore %m43 %118 None
-               OpStore %m44 %118 None
-               OpStore %m45 %118 None
-               OpStore %m46 %118 None
-               OpStore %m47 %118 None
-               OpStore %m48 %118 None
-               OpStore %m49 %118 None
-               OpStore %m50 %118 None
-               OpStore %m51 %118 None
-               OpStore %m52 %118 None
-               OpStore %m53 %118 None
-               OpStore %m54 %118 None
-               OpStore %m55 %118 None
-               OpStore %m56 %118 None
-               OpStore %m57 %118 None
-               OpStore %m58 %118 None
-               OpStore %m59 %118 None
-               OpStore %m60 %118 None
-               OpStore %m61 %118 None
-               OpStore %m62 %118 None
-               OpStore %m63 %118 None
-               OpStore %m64 %118 None
-               OpStore %m65 %118 None
-               OpStore %m66 %118 None
-               OpStore %m67 %118 None
-               OpStore %m68 %118 None
-               OpStore %m69 %118 None
-               OpStore %m70 %118 None
-               OpStore %m71 %118 None
-               OpStore %m72 %118 None
-               OpStore %m73 %118 None
-               OpStore %m74 %118 None
-               OpStore %m75 %118 None
-               OpStore %m76 %118 None
-               OpStore %m77 %118 None
-               OpStore %m78 %118 None
-               OpStore %m79 %118 None
-               OpStore %m80 %118 None
-               OpStore %m81 %118 None
-               OpStore %m82 %118 None
-               OpStore %m83 %118 None
-               OpStore %m84 %118 None
-               OpStore %m85 %118 None
-               OpStore %m86 %118 None
-               OpStore %m87 %118 None
-               OpStore %m88 %118 None
-               OpStore %m89 %118 None
-               OpStore %m90 %118 None
-               OpStore %m91 %118 None
-               OpStore %m92 %118 None
-               OpStore %m93 %118 None
-               OpStore %m94 %118 None
-               OpStore %m95 %118 None
-               OpStore %m96 %118 None
-               OpStore %m97 %118 None
-               OpStore %m98 %118 None
-               OpStore %m99 %118 None
+               OpStore %m00 %325 None
+               OpStore %m01 %325 None
+               OpStore %m02 %325 None
+               OpStore %m03 %325 None
+               OpStore %m04 %325 None
+               OpStore %m05 %325 None
+               OpStore %m06 %325 None
+               OpStore %m07 %325 None
+               OpStore %m08 %325 None
+               OpStore %m09 %325 None
+               OpStore %m10 %325 None
+               OpStore %m11 %325 None
+               OpStore %m12 %325 None
+               OpStore %m13 %325 None
+               OpStore %m14 %325 None
+               OpStore %m15 %325 None
+               OpStore %m16 %325 None
+               OpStore %m17 %325 None
+               OpStore %m18 %325 None
+               OpStore %m19 %325 None
+               OpStore %m20 %325 None
+               OpStore %m21 %325 None
+               OpStore %m22 %325 None
+               OpStore %m23 %325 None
+               OpStore %m24 %325 None
+               OpStore %m25 %325 None
+               OpStore %m26 %325 None
+               OpStore %m27 %325 None
+               OpStore %m28 %325 None
+               OpStore %m29 %325 None
+               OpStore %m30 %325 None
+               OpStore %m31 %325 None
+               OpStore %m32 %325 None
+               OpStore %m33 %325 None
+               OpStore %m34 %325 None
+               OpStore %m35 %325 None
+               OpStore %m36 %325 None
+               OpStore %m37 %325 None
+               OpStore %m38 %325 None
+               OpStore %m39 %325 None
+               OpStore %m40 %325 None
+               OpStore %m41 %325 None
+               OpStore %m42 %325 None
+               OpStore %m43 %325 None
+               OpStore %m44 %325 None
+               OpStore %m45 %325 None
+               OpStore %m46 %325 None
+               OpStore %m47 %325 None
+               OpStore %m48 %325 None
+               OpStore %m49 %325 None
+               OpStore %m50 %325 None
+               OpStore %m51 %325 None
+               OpStore %m52 %325 None
+               OpStore %m53 %325 None
+               OpStore %m54 %325 None
+               OpStore %m55 %325 None
+               OpStore %m56 %325 None
+               OpStore %m57 %325 None
+               OpStore %m58 %325 None
+               OpStore %m59 %325 None
+               OpStore %m60 %325 None
+               OpStore %m61 %325 None
+               OpStore %m62 %325 None
+               OpStore %m63 %325 None
+               OpStore %m64 %325 None
+               OpStore %m65 %325 None
+               OpStore %m66 %325 None
+               OpStore %m67 %325 None
+               OpStore %m68 %325 None
+               OpStore %m69 %325 None
+               OpStore %m70 %325 None
+               OpStore %m71 %325 None
+               OpStore %m72 %325 None
+               OpStore %m73 %325 None
+               OpStore %m74 %325 None
+               OpStore %m75 %325 None
+               OpStore %m76 %325 None
+               OpStore %m77 %325 None
+               OpStore %m78 %325 None
+               OpStore %m79 %325 None
+               OpStore %m80 %325 None
+               OpStore %m81 %325 None
+               OpStore %m82 %325 None
+               OpStore %m83 %325 None
+               OpStore %m84 %325 None
+               OpStore %m85 %325 None
+               OpStore %m86 %325 None
+               OpStore %m87 %325 None
+               OpStore %m88 %325 None
+               OpStore %m89 %325 None
+               OpStore %m90 %325 None
+               OpStore %m91 %325 None
+               OpStore %m92 %325 None
+               OpStore %m93 %325 None
+               OpStore %m94 %325 None
+               OpStore %m95 %325 None
+               OpStore %m96 %325 None
+               OpStore %m97 %325 None
+               OpStore %m98 %325 None
+               OpStore %m99 %325 None
                OpBranch %116
         %116 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
-        %122 = OpAccessChain %_ptr_Workgroup_v2float %m00 %uint_0
-        %125 = OpAccessChain %_ptr_Workgroup_float %122 %uint_0
-               OpStore %125 %float_1 None
-        %128 = OpAccessChain %_ptr_Workgroup_v2float %m01 %uint_0
-        %129 = OpAccessChain %_ptr_Workgroup_float %128 %uint_0
-               OpStore %129 %float_1 None
-        %130 = OpAccessChain %_ptr_Workgroup_v2float %m02 %uint_0
-        %131 = OpAccessChain %_ptr_Workgroup_float %130 %uint_0
-               OpStore %131 %float_1 None
-        %132 = OpAccessChain %_ptr_Workgroup_v2float %m03 %uint_0
-        %133 = OpAccessChain %_ptr_Workgroup_float %132 %uint_0
-               OpStore %133 %float_1 None
-        %134 = OpAccessChain %_ptr_Workgroup_v2float %m04 %uint_0
-        %135 = OpAccessChain %_ptr_Workgroup_float %134 %uint_0
-               OpStore %135 %float_1 None
-        %136 = OpAccessChain %_ptr_Workgroup_v2float %m05 %uint_0
-        %137 = OpAccessChain %_ptr_Workgroup_float %136 %uint_0
-               OpStore %137 %float_1 None
-        %138 = OpAccessChain %_ptr_Workgroup_v2float %m06 %uint_0
-        %139 = OpAccessChain %_ptr_Workgroup_float %138 %uint_0
-               OpStore %139 %float_1 None
-        %140 = OpAccessChain %_ptr_Workgroup_v2float %m07 %uint_0
-        %141 = OpAccessChain %_ptr_Workgroup_float %140 %uint_0
-               OpStore %141 %float_1 None
-        %142 = OpAccessChain %_ptr_Workgroup_v2float %m08 %uint_0
-        %143 = OpAccessChain %_ptr_Workgroup_float %142 %uint_0
-               OpStore %143 %float_1 None
-        %144 = OpAccessChain %_ptr_Workgroup_v2float %m09 %uint_0
-        %145 = OpAccessChain %_ptr_Workgroup_float %144 %uint_0
-               OpStore %145 %float_1 None
-        %146 = OpAccessChain %_ptr_Workgroup_v2float %m10 %uint_0
-        %147 = OpAccessChain %_ptr_Workgroup_float %146 %uint_0
-               OpStore %147 %float_1 None
-        %148 = OpAccessChain %_ptr_Workgroup_v2float %m11 %uint_0
-        %149 = OpAccessChain %_ptr_Workgroup_float %148 %uint_0
-               OpStore %149 %float_1 None
-        %150 = OpAccessChain %_ptr_Workgroup_v2float %m12 %uint_0
-        %151 = OpAccessChain %_ptr_Workgroup_float %150 %uint_0
-               OpStore %151 %float_1 None
-        %152 = OpAccessChain %_ptr_Workgroup_v2float %m13 %uint_0
-        %153 = OpAccessChain %_ptr_Workgroup_float %152 %uint_0
-               OpStore %153 %float_1 None
-        %154 = OpAccessChain %_ptr_Workgroup_v2float %m14 %uint_0
-        %155 = OpAccessChain %_ptr_Workgroup_float %154 %uint_0
-               OpStore %155 %float_1 None
-        %156 = OpAccessChain %_ptr_Workgroup_v2float %m15 %uint_0
-        %157 = OpAccessChain %_ptr_Workgroup_float %156 %uint_0
-               OpStore %157 %float_1 None
-        %158 = OpAccessChain %_ptr_Workgroup_v2float %m16 %uint_0
-        %159 = OpAccessChain %_ptr_Workgroup_float %158 %uint_0
-               OpStore %159 %float_1 None
-        %160 = OpAccessChain %_ptr_Workgroup_v2float %m17 %uint_0
-        %161 = OpAccessChain %_ptr_Workgroup_float %160 %uint_0
-               OpStore %161 %float_1 None
-        %162 = OpAccessChain %_ptr_Workgroup_v2float %m18 %uint_0
-        %163 = OpAccessChain %_ptr_Workgroup_float %162 %uint_0
-               OpStore %163 %float_1 None
-        %164 = OpAccessChain %_ptr_Workgroup_v2float %m19 %uint_0
-        %165 = OpAccessChain %_ptr_Workgroup_float %164 %uint_0
-               OpStore %165 %float_1 None
-        %166 = OpAccessChain %_ptr_Workgroup_v2float %m20 %uint_0
-        %167 = OpAccessChain %_ptr_Workgroup_float %166 %uint_0
-               OpStore %167 %float_1 None
-        %168 = OpAccessChain %_ptr_Workgroup_v2float %m21 %uint_0
-        %169 = OpAccessChain %_ptr_Workgroup_float %168 %uint_0
-               OpStore %169 %float_1 None
-        %170 = OpAccessChain %_ptr_Workgroup_v2float %m22 %uint_0
-        %171 = OpAccessChain %_ptr_Workgroup_float %170 %uint_0
-               OpStore %171 %float_1 None
-        %172 = OpAccessChain %_ptr_Workgroup_v2float %m23 %uint_0
-        %173 = OpAccessChain %_ptr_Workgroup_float %172 %uint_0
-               OpStore %173 %float_1 None
-        %174 = OpAccessChain %_ptr_Workgroup_v2float %m24 %uint_0
-        %175 = OpAccessChain %_ptr_Workgroup_float %174 %uint_0
-               OpStore %175 %float_1 None
-        %176 = OpAccessChain %_ptr_Workgroup_v2float %m25 %uint_0
-        %177 = OpAccessChain %_ptr_Workgroup_float %176 %uint_0
-               OpStore %177 %float_1 None
-        %178 = OpAccessChain %_ptr_Workgroup_v2float %m26 %uint_0
-        %179 = OpAccessChain %_ptr_Workgroup_float %178 %uint_0
-               OpStore %179 %float_1 None
-        %180 = OpAccessChain %_ptr_Workgroup_v2float %m27 %uint_0
-        %181 = OpAccessChain %_ptr_Workgroup_float %180 %uint_0
-               OpStore %181 %float_1 None
-        %182 = OpAccessChain %_ptr_Workgroup_v2float %m28 %uint_0
-        %183 = OpAccessChain %_ptr_Workgroup_float %182 %uint_0
-               OpStore %183 %float_1 None
-        %184 = OpAccessChain %_ptr_Workgroup_v2float %m29 %uint_0
-        %185 = OpAccessChain %_ptr_Workgroup_float %184 %uint_0
-               OpStore %185 %float_1 None
-        %186 = OpAccessChain %_ptr_Workgroup_v2float %m30 %uint_0
-        %187 = OpAccessChain %_ptr_Workgroup_float %186 %uint_0
-               OpStore %187 %float_1 None
-        %188 = OpAccessChain %_ptr_Workgroup_v2float %m31 %uint_0
-        %189 = OpAccessChain %_ptr_Workgroup_float %188 %uint_0
-               OpStore %189 %float_1 None
-        %190 = OpAccessChain %_ptr_Workgroup_v2float %m32 %uint_0
-        %191 = OpAccessChain %_ptr_Workgroup_float %190 %uint_0
-               OpStore %191 %float_1 None
-        %192 = OpAccessChain %_ptr_Workgroup_v2float %m33 %uint_0
-        %193 = OpAccessChain %_ptr_Workgroup_float %192 %uint_0
-               OpStore %193 %float_1 None
-        %194 = OpAccessChain %_ptr_Workgroup_v2float %m34 %uint_0
-        %195 = OpAccessChain %_ptr_Workgroup_float %194 %uint_0
-               OpStore %195 %float_1 None
-        %196 = OpAccessChain %_ptr_Workgroup_v2float %m35 %uint_0
-        %197 = OpAccessChain %_ptr_Workgroup_float %196 %uint_0
-               OpStore %197 %float_1 None
-        %198 = OpAccessChain %_ptr_Workgroup_v2float %m36 %uint_0
-        %199 = OpAccessChain %_ptr_Workgroup_float %198 %uint_0
-               OpStore %199 %float_1 None
-        %200 = OpAccessChain %_ptr_Workgroup_v2float %m37 %uint_0
-        %201 = OpAccessChain %_ptr_Workgroup_float %200 %uint_0
-               OpStore %201 %float_1 None
-        %202 = OpAccessChain %_ptr_Workgroup_v2float %m38 %uint_0
-        %203 = OpAccessChain %_ptr_Workgroup_float %202 %uint_0
-               OpStore %203 %float_1 None
-        %204 = OpAccessChain %_ptr_Workgroup_v2float %m39 %uint_0
-        %205 = OpAccessChain %_ptr_Workgroup_float %204 %uint_0
-               OpStore %205 %float_1 None
-        %206 = OpAccessChain %_ptr_Workgroup_v2float %m40 %uint_0
-        %207 = OpAccessChain %_ptr_Workgroup_float %206 %uint_0
-               OpStore %207 %float_1 None
-        %208 = OpAccessChain %_ptr_Workgroup_v2float %m41 %uint_0
-        %209 = OpAccessChain %_ptr_Workgroup_float %208 %uint_0
-               OpStore %209 %float_1 None
-        %210 = OpAccessChain %_ptr_Workgroup_v2float %m42 %uint_0
-        %211 = OpAccessChain %_ptr_Workgroup_float %210 %uint_0
-               OpStore %211 %float_1 None
-        %212 = OpAccessChain %_ptr_Workgroup_v2float %m43 %uint_0
-        %213 = OpAccessChain %_ptr_Workgroup_float %212 %uint_0
-               OpStore %213 %float_1 None
-        %214 = OpAccessChain %_ptr_Workgroup_v2float %m44 %uint_0
-        %215 = OpAccessChain %_ptr_Workgroup_float %214 %uint_0
-               OpStore %215 %float_1 None
-        %216 = OpAccessChain %_ptr_Workgroup_v2float %m45 %uint_0
-        %217 = OpAccessChain %_ptr_Workgroup_float %216 %uint_0
-               OpStore %217 %float_1 None
-        %218 = OpAccessChain %_ptr_Workgroup_v2float %m46 %uint_0
-        %219 = OpAccessChain %_ptr_Workgroup_float %218 %uint_0
-               OpStore %219 %float_1 None
-        %220 = OpAccessChain %_ptr_Workgroup_v2float %m47 %uint_0
-        %221 = OpAccessChain %_ptr_Workgroup_float %220 %uint_0
-               OpStore %221 %float_1 None
-        %222 = OpAccessChain %_ptr_Workgroup_v2float %m48 %uint_0
-        %223 = OpAccessChain %_ptr_Workgroup_float %222 %uint_0
-               OpStore %223 %float_1 None
-        %224 = OpAccessChain %_ptr_Workgroup_v2float %m49 %uint_0
-        %225 = OpAccessChain %_ptr_Workgroup_float %224 %uint_0
-               OpStore %225 %float_1 None
-        %226 = OpAccessChain %_ptr_Workgroup_v2float %m50 %uint_0
-        %227 = OpAccessChain %_ptr_Workgroup_float %226 %uint_0
-               OpStore %227 %float_1 None
-        %228 = OpAccessChain %_ptr_Workgroup_v2float %m51 %uint_0
-        %229 = OpAccessChain %_ptr_Workgroup_float %228 %uint_0
-               OpStore %229 %float_1 None
-        %230 = OpAccessChain %_ptr_Workgroup_v2float %m52 %uint_0
-        %231 = OpAccessChain %_ptr_Workgroup_float %230 %uint_0
-               OpStore %231 %float_1 None
-        %232 = OpAccessChain %_ptr_Workgroup_v2float %m53 %uint_0
-        %233 = OpAccessChain %_ptr_Workgroup_float %232 %uint_0
-               OpStore %233 %float_1 None
-        %234 = OpAccessChain %_ptr_Workgroup_v2float %m54 %uint_0
-        %235 = OpAccessChain %_ptr_Workgroup_float %234 %uint_0
-               OpStore %235 %float_1 None
-        %236 = OpAccessChain %_ptr_Workgroup_v2float %m55 %uint_0
-        %237 = OpAccessChain %_ptr_Workgroup_float %236 %uint_0
-               OpStore %237 %float_1 None
-        %238 = OpAccessChain %_ptr_Workgroup_v2float %m56 %uint_0
-        %239 = OpAccessChain %_ptr_Workgroup_float %238 %uint_0
-               OpStore %239 %float_1 None
-        %240 = OpAccessChain %_ptr_Workgroup_v2float %m57 %uint_0
-        %241 = OpAccessChain %_ptr_Workgroup_float %240 %uint_0
-               OpStore %241 %float_1 None
-        %242 = OpAccessChain %_ptr_Workgroup_v2float %m58 %uint_0
-        %243 = OpAccessChain %_ptr_Workgroup_float %242 %uint_0
-               OpStore %243 %float_1 None
-        %244 = OpAccessChain %_ptr_Workgroup_v2float %m59 %uint_0
-        %245 = OpAccessChain %_ptr_Workgroup_float %244 %uint_0
-               OpStore %245 %float_1 None
-        %246 = OpAccessChain %_ptr_Workgroup_v2float %m60 %uint_0
-        %247 = OpAccessChain %_ptr_Workgroup_float %246 %uint_0
-               OpStore %247 %float_1 None
-        %248 = OpAccessChain %_ptr_Workgroup_v2float %m61 %uint_0
-        %249 = OpAccessChain %_ptr_Workgroup_float %248 %uint_0
-               OpStore %249 %float_1 None
-        %250 = OpAccessChain %_ptr_Workgroup_v2float %m62 %uint_0
-        %251 = OpAccessChain %_ptr_Workgroup_float %250 %uint_0
-               OpStore %251 %float_1 None
-        %252 = OpAccessChain %_ptr_Workgroup_v2float %m63 %uint_0
-        %253 = OpAccessChain %_ptr_Workgroup_float %252 %uint_0
-               OpStore %253 %float_1 None
-        %254 = OpAccessChain %_ptr_Workgroup_v2float %m64 %uint_0
-        %255 = OpAccessChain %_ptr_Workgroup_float %254 %uint_0
-               OpStore %255 %float_1 None
-        %256 = OpAccessChain %_ptr_Workgroup_v2float %m65 %uint_0
-        %257 = OpAccessChain %_ptr_Workgroup_float %256 %uint_0
-               OpStore %257 %float_1 None
-        %258 = OpAccessChain %_ptr_Workgroup_v2float %m66 %uint_0
-        %259 = OpAccessChain %_ptr_Workgroup_float %258 %uint_0
-               OpStore %259 %float_1 None
-        %260 = OpAccessChain %_ptr_Workgroup_v2float %m67 %uint_0
-        %261 = OpAccessChain %_ptr_Workgroup_float %260 %uint_0
-               OpStore %261 %float_1 None
-        %262 = OpAccessChain %_ptr_Workgroup_v2float %m68 %uint_0
-        %263 = OpAccessChain %_ptr_Workgroup_float %262 %uint_0
-               OpStore %263 %float_1 None
-        %264 = OpAccessChain %_ptr_Workgroup_v2float %m69 %uint_0
-        %265 = OpAccessChain %_ptr_Workgroup_float %264 %uint_0
-               OpStore %265 %float_1 None
-        %266 = OpAccessChain %_ptr_Workgroup_v2float %m70 %uint_0
-        %267 = OpAccessChain %_ptr_Workgroup_float %266 %uint_0
-               OpStore %267 %float_1 None
-        %268 = OpAccessChain %_ptr_Workgroup_v2float %m71 %uint_0
-        %269 = OpAccessChain %_ptr_Workgroup_float %268 %uint_0
-               OpStore %269 %float_1 None
-        %270 = OpAccessChain %_ptr_Workgroup_v2float %m72 %uint_0
-        %271 = OpAccessChain %_ptr_Workgroup_float %270 %uint_0
-               OpStore %271 %float_1 None
-        %272 = OpAccessChain %_ptr_Workgroup_v2float %m73 %uint_0
-        %273 = OpAccessChain %_ptr_Workgroup_float %272 %uint_0
-               OpStore %273 %float_1 None
-        %274 = OpAccessChain %_ptr_Workgroup_v2float %m74 %uint_0
-        %275 = OpAccessChain %_ptr_Workgroup_float %274 %uint_0
-               OpStore %275 %float_1 None
-        %276 = OpAccessChain %_ptr_Workgroup_v2float %m75 %uint_0
-        %277 = OpAccessChain %_ptr_Workgroup_float %276 %uint_0
-               OpStore %277 %float_1 None
-        %278 = OpAccessChain %_ptr_Workgroup_v2float %m76 %uint_0
-        %279 = OpAccessChain %_ptr_Workgroup_float %278 %uint_0
-               OpStore %279 %float_1 None
-        %280 = OpAccessChain %_ptr_Workgroup_v2float %m77 %uint_0
-        %281 = OpAccessChain %_ptr_Workgroup_float %280 %uint_0
-               OpStore %281 %float_1 None
-        %282 = OpAccessChain %_ptr_Workgroup_v2float %m78 %uint_0
-        %283 = OpAccessChain %_ptr_Workgroup_float %282 %uint_0
-               OpStore %283 %float_1 None
-        %284 = OpAccessChain %_ptr_Workgroup_v2float %m79 %uint_0
-        %285 = OpAccessChain %_ptr_Workgroup_float %284 %uint_0
-               OpStore %285 %float_1 None
-        %286 = OpAccessChain %_ptr_Workgroup_v2float %m80 %uint_0
-        %287 = OpAccessChain %_ptr_Workgroup_float %286 %uint_0
-               OpStore %287 %float_1 None
-        %288 = OpAccessChain %_ptr_Workgroup_v2float %m81 %uint_0
-        %289 = OpAccessChain %_ptr_Workgroup_float %288 %uint_0
-               OpStore %289 %float_1 None
-        %290 = OpAccessChain %_ptr_Workgroup_v2float %m82 %uint_0
-        %291 = OpAccessChain %_ptr_Workgroup_float %290 %uint_0
-               OpStore %291 %float_1 None
-        %292 = OpAccessChain %_ptr_Workgroup_v2float %m83 %uint_0
-        %293 = OpAccessChain %_ptr_Workgroup_float %292 %uint_0
-               OpStore %293 %float_1 None
-        %294 = OpAccessChain %_ptr_Workgroup_v2float %m84 %uint_0
-        %295 = OpAccessChain %_ptr_Workgroup_float %294 %uint_0
-               OpStore %295 %float_1 None
-        %296 = OpAccessChain %_ptr_Workgroup_v2float %m85 %uint_0
-        %297 = OpAccessChain %_ptr_Workgroup_float %296 %uint_0
-               OpStore %297 %float_1 None
-        %298 = OpAccessChain %_ptr_Workgroup_v2float %m86 %uint_0
-        %299 = OpAccessChain %_ptr_Workgroup_float %298 %uint_0
-               OpStore %299 %float_1 None
-        %300 = OpAccessChain %_ptr_Workgroup_v2float %m87 %uint_0
-        %301 = OpAccessChain %_ptr_Workgroup_float %300 %uint_0
-               OpStore %301 %float_1 None
-        %302 = OpAccessChain %_ptr_Workgroup_v2float %m88 %uint_0
-        %303 = OpAccessChain %_ptr_Workgroup_float %302 %uint_0
-               OpStore %303 %float_1 None
-        %304 = OpAccessChain %_ptr_Workgroup_v2float %m89 %uint_0
-        %305 = OpAccessChain %_ptr_Workgroup_float %304 %uint_0
-               OpStore %305 %float_1 None
-        %306 = OpAccessChain %_ptr_Workgroup_v2float %m90 %uint_0
-        %307 = OpAccessChain %_ptr_Workgroup_float %306 %uint_0
-               OpStore %307 %float_1 None
-        %308 = OpAccessChain %_ptr_Workgroup_v2float %m91 %uint_0
-        %309 = OpAccessChain %_ptr_Workgroup_float %308 %uint_0
-               OpStore %309 %float_1 None
-        %310 = OpAccessChain %_ptr_Workgroup_v2float %m92 %uint_0
-        %311 = OpAccessChain %_ptr_Workgroup_float %310 %uint_0
-               OpStore %311 %float_1 None
-        %312 = OpAccessChain %_ptr_Workgroup_v2float %m93 %uint_0
-        %313 = OpAccessChain %_ptr_Workgroup_float %312 %uint_0
-               OpStore %313 %float_1 None
-        %314 = OpAccessChain %_ptr_Workgroup_v2float %m94 %uint_0
-        %315 = OpAccessChain %_ptr_Workgroup_float %314 %uint_0
-               OpStore %315 %float_1 None
-        %316 = OpAccessChain %_ptr_Workgroup_v2float %m95 %uint_0
-        %317 = OpAccessChain %_ptr_Workgroup_float %316 %uint_0
-               OpStore %317 %float_1 None
-        %318 = OpAccessChain %_ptr_Workgroup_v2float %m96 %uint_0
-        %319 = OpAccessChain %_ptr_Workgroup_float %318 %uint_0
-               OpStore %319 %float_1 None
-        %320 = OpAccessChain %_ptr_Workgroup_v2float %m97 %uint_0
-        %321 = OpAccessChain %_ptr_Workgroup_float %320 %uint_0
-               OpStore %321 %float_1 None
-        %322 = OpAccessChain %_ptr_Workgroup_v2float %m98 %uint_0
-        %323 = OpAccessChain %_ptr_Workgroup_float %322 %uint_0
-               OpStore %323 %float_1 None
-        %324 = OpAccessChain %_ptr_Workgroup_v2float %m99 %uint_0
-        %325 = OpAccessChain %_ptr_Workgroup_float %324 %uint_0
-               OpStore %325 %float_1 None
+        %121 = OpAccessChain %_ptr_Workgroup_v2float %m00 %uint_0
+        %124 = OpAccessChain %_ptr_Workgroup_float %121 %uint_0
+               OpStore %124 %float_1 None
+        %127 = OpAccessChain %_ptr_Workgroup_v2float %m01 %uint_0
+        %128 = OpAccessChain %_ptr_Workgroup_float %127 %uint_0
+               OpStore %128 %float_1 None
+        %129 = OpAccessChain %_ptr_Workgroup_v2float %m02 %uint_0
+        %130 = OpAccessChain %_ptr_Workgroup_float %129 %uint_0
+               OpStore %130 %float_1 None
+        %131 = OpAccessChain %_ptr_Workgroup_v2float %m03 %uint_0
+        %132 = OpAccessChain %_ptr_Workgroup_float %131 %uint_0
+               OpStore %132 %float_1 None
+        %133 = OpAccessChain %_ptr_Workgroup_v2float %m04 %uint_0
+        %134 = OpAccessChain %_ptr_Workgroup_float %133 %uint_0
+               OpStore %134 %float_1 None
+        %135 = OpAccessChain %_ptr_Workgroup_v2float %m05 %uint_0
+        %136 = OpAccessChain %_ptr_Workgroup_float %135 %uint_0
+               OpStore %136 %float_1 None
+        %137 = OpAccessChain %_ptr_Workgroup_v2float %m06 %uint_0
+        %138 = OpAccessChain %_ptr_Workgroup_float %137 %uint_0
+               OpStore %138 %float_1 None
+        %139 = OpAccessChain %_ptr_Workgroup_v2float %m07 %uint_0
+        %140 = OpAccessChain %_ptr_Workgroup_float %139 %uint_0
+               OpStore %140 %float_1 None
+        %141 = OpAccessChain %_ptr_Workgroup_v2float %m08 %uint_0
+        %142 = OpAccessChain %_ptr_Workgroup_float %141 %uint_0
+               OpStore %142 %float_1 None
+        %143 = OpAccessChain %_ptr_Workgroup_v2float %m09 %uint_0
+        %144 = OpAccessChain %_ptr_Workgroup_float %143 %uint_0
+               OpStore %144 %float_1 None
+        %145 = OpAccessChain %_ptr_Workgroup_v2float %m10 %uint_0
+        %146 = OpAccessChain %_ptr_Workgroup_float %145 %uint_0
+               OpStore %146 %float_1 None
+        %147 = OpAccessChain %_ptr_Workgroup_v2float %m11 %uint_0
+        %148 = OpAccessChain %_ptr_Workgroup_float %147 %uint_0
+               OpStore %148 %float_1 None
+        %149 = OpAccessChain %_ptr_Workgroup_v2float %m12 %uint_0
+        %150 = OpAccessChain %_ptr_Workgroup_float %149 %uint_0
+               OpStore %150 %float_1 None
+        %151 = OpAccessChain %_ptr_Workgroup_v2float %m13 %uint_0
+        %152 = OpAccessChain %_ptr_Workgroup_float %151 %uint_0
+               OpStore %152 %float_1 None
+        %153 = OpAccessChain %_ptr_Workgroup_v2float %m14 %uint_0
+        %154 = OpAccessChain %_ptr_Workgroup_float %153 %uint_0
+               OpStore %154 %float_1 None
+        %155 = OpAccessChain %_ptr_Workgroup_v2float %m15 %uint_0
+        %156 = OpAccessChain %_ptr_Workgroup_float %155 %uint_0
+               OpStore %156 %float_1 None
+        %157 = OpAccessChain %_ptr_Workgroup_v2float %m16 %uint_0
+        %158 = OpAccessChain %_ptr_Workgroup_float %157 %uint_0
+               OpStore %158 %float_1 None
+        %159 = OpAccessChain %_ptr_Workgroup_v2float %m17 %uint_0
+        %160 = OpAccessChain %_ptr_Workgroup_float %159 %uint_0
+               OpStore %160 %float_1 None
+        %161 = OpAccessChain %_ptr_Workgroup_v2float %m18 %uint_0
+        %162 = OpAccessChain %_ptr_Workgroup_float %161 %uint_0
+               OpStore %162 %float_1 None
+        %163 = OpAccessChain %_ptr_Workgroup_v2float %m19 %uint_0
+        %164 = OpAccessChain %_ptr_Workgroup_float %163 %uint_0
+               OpStore %164 %float_1 None
+        %165 = OpAccessChain %_ptr_Workgroup_v2float %m20 %uint_0
+        %166 = OpAccessChain %_ptr_Workgroup_float %165 %uint_0
+               OpStore %166 %float_1 None
+        %167 = OpAccessChain %_ptr_Workgroup_v2float %m21 %uint_0
+        %168 = OpAccessChain %_ptr_Workgroup_float %167 %uint_0
+               OpStore %168 %float_1 None
+        %169 = OpAccessChain %_ptr_Workgroup_v2float %m22 %uint_0
+        %170 = OpAccessChain %_ptr_Workgroup_float %169 %uint_0
+               OpStore %170 %float_1 None
+        %171 = OpAccessChain %_ptr_Workgroup_v2float %m23 %uint_0
+        %172 = OpAccessChain %_ptr_Workgroup_float %171 %uint_0
+               OpStore %172 %float_1 None
+        %173 = OpAccessChain %_ptr_Workgroup_v2float %m24 %uint_0
+        %174 = OpAccessChain %_ptr_Workgroup_float %173 %uint_0
+               OpStore %174 %float_1 None
+        %175 = OpAccessChain %_ptr_Workgroup_v2float %m25 %uint_0
+        %176 = OpAccessChain %_ptr_Workgroup_float %175 %uint_0
+               OpStore %176 %float_1 None
+        %177 = OpAccessChain %_ptr_Workgroup_v2float %m26 %uint_0
+        %178 = OpAccessChain %_ptr_Workgroup_float %177 %uint_0
+               OpStore %178 %float_1 None
+        %179 = OpAccessChain %_ptr_Workgroup_v2float %m27 %uint_0
+        %180 = OpAccessChain %_ptr_Workgroup_float %179 %uint_0
+               OpStore %180 %float_1 None
+        %181 = OpAccessChain %_ptr_Workgroup_v2float %m28 %uint_0
+        %182 = OpAccessChain %_ptr_Workgroup_float %181 %uint_0
+               OpStore %182 %float_1 None
+        %183 = OpAccessChain %_ptr_Workgroup_v2float %m29 %uint_0
+        %184 = OpAccessChain %_ptr_Workgroup_float %183 %uint_0
+               OpStore %184 %float_1 None
+        %185 = OpAccessChain %_ptr_Workgroup_v2float %m30 %uint_0
+        %186 = OpAccessChain %_ptr_Workgroup_float %185 %uint_0
+               OpStore %186 %float_1 None
+        %187 = OpAccessChain %_ptr_Workgroup_v2float %m31 %uint_0
+        %188 = OpAccessChain %_ptr_Workgroup_float %187 %uint_0
+               OpStore %188 %float_1 None
+        %189 = OpAccessChain %_ptr_Workgroup_v2float %m32 %uint_0
+        %190 = OpAccessChain %_ptr_Workgroup_float %189 %uint_0
+               OpStore %190 %float_1 None
+        %191 = OpAccessChain %_ptr_Workgroup_v2float %m33 %uint_0
+        %192 = OpAccessChain %_ptr_Workgroup_float %191 %uint_0
+               OpStore %192 %float_1 None
+        %193 = OpAccessChain %_ptr_Workgroup_v2float %m34 %uint_0
+        %194 = OpAccessChain %_ptr_Workgroup_float %193 %uint_0
+               OpStore %194 %float_1 None
+        %195 = OpAccessChain %_ptr_Workgroup_v2float %m35 %uint_0
+        %196 = OpAccessChain %_ptr_Workgroup_float %195 %uint_0
+               OpStore %196 %float_1 None
+        %197 = OpAccessChain %_ptr_Workgroup_v2float %m36 %uint_0
+        %198 = OpAccessChain %_ptr_Workgroup_float %197 %uint_0
+               OpStore %198 %float_1 None
+        %199 = OpAccessChain %_ptr_Workgroup_v2float %m37 %uint_0
+        %200 = OpAccessChain %_ptr_Workgroup_float %199 %uint_0
+               OpStore %200 %float_1 None
+        %201 = OpAccessChain %_ptr_Workgroup_v2float %m38 %uint_0
+        %202 = OpAccessChain %_ptr_Workgroup_float %201 %uint_0
+               OpStore %202 %float_1 None
+        %203 = OpAccessChain %_ptr_Workgroup_v2float %m39 %uint_0
+        %204 = OpAccessChain %_ptr_Workgroup_float %203 %uint_0
+               OpStore %204 %float_1 None
+        %205 = OpAccessChain %_ptr_Workgroup_v2float %m40 %uint_0
+        %206 = OpAccessChain %_ptr_Workgroup_float %205 %uint_0
+               OpStore %206 %float_1 None
+        %207 = OpAccessChain %_ptr_Workgroup_v2float %m41 %uint_0
+        %208 = OpAccessChain %_ptr_Workgroup_float %207 %uint_0
+               OpStore %208 %float_1 None
+        %209 = OpAccessChain %_ptr_Workgroup_v2float %m42 %uint_0
+        %210 = OpAccessChain %_ptr_Workgroup_float %209 %uint_0
+               OpStore %210 %float_1 None
+        %211 = OpAccessChain %_ptr_Workgroup_v2float %m43 %uint_0
+        %212 = OpAccessChain %_ptr_Workgroup_float %211 %uint_0
+               OpStore %212 %float_1 None
+        %213 = OpAccessChain %_ptr_Workgroup_v2float %m44 %uint_0
+        %214 = OpAccessChain %_ptr_Workgroup_float %213 %uint_0
+               OpStore %214 %float_1 None
+        %215 = OpAccessChain %_ptr_Workgroup_v2float %m45 %uint_0
+        %216 = OpAccessChain %_ptr_Workgroup_float %215 %uint_0
+               OpStore %216 %float_1 None
+        %217 = OpAccessChain %_ptr_Workgroup_v2float %m46 %uint_0
+        %218 = OpAccessChain %_ptr_Workgroup_float %217 %uint_0
+               OpStore %218 %float_1 None
+        %219 = OpAccessChain %_ptr_Workgroup_v2float %m47 %uint_0
+        %220 = OpAccessChain %_ptr_Workgroup_float %219 %uint_0
+               OpStore %220 %float_1 None
+        %221 = OpAccessChain %_ptr_Workgroup_v2float %m48 %uint_0
+        %222 = OpAccessChain %_ptr_Workgroup_float %221 %uint_0
+               OpStore %222 %float_1 None
+        %223 = OpAccessChain %_ptr_Workgroup_v2float %m49 %uint_0
+        %224 = OpAccessChain %_ptr_Workgroup_float %223 %uint_0
+               OpStore %224 %float_1 None
+        %225 = OpAccessChain %_ptr_Workgroup_v2float %m50 %uint_0
+        %226 = OpAccessChain %_ptr_Workgroup_float %225 %uint_0
+               OpStore %226 %float_1 None
+        %227 = OpAccessChain %_ptr_Workgroup_v2float %m51 %uint_0
+        %228 = OpAccessChain %_ptr_Workgroup_float %227 %uint_0
+               OpStore %228 %float_1 None
+        %229 = OpAccessChain %_ptr_Workgroup_v2float %m52 %uint_0
+        %230 = OpAccessChain %_ptr_Workgroup_float %229 %uint_0
+               OpStore %230 %float_1 None
+        %231 = OpAccessChain %_ptr_Workgroup_v2float %m53 %uint_0
+        %232 = OpAccessChain %_ptr_Workgroup_float %231 %uint_0
+               OpStore %232 %float_1 None
+        %233 = OpAccessChain %_ptr_Workgroup_v2float %m54 %uint_0
+        %234 = OpAccessChain %_ptr_Workgroup_float %233 %uint_0
+               OpStore %234 %float_1 None
+        %235 = OpAccessChain %_ptr_Workgroup_v2float %m55 %uint_0
+        %236 = OpAccessChain %_ptr_Workgroup_float %235 %uint_0
+               OpStore %236 %float_1 None
+        %237 = OpAccessChain %_ptr_Workgroup_v2float %m56 %uint_0
+        %238 = OpAccessChain %_ptr_Workgroup_float %237 %uint_0
+               OpStore %238 %float_1 None
+        %239 = OpAccessChain %_ptr_Workgroup_v2float %m57 %uint_0
+        %240 = OpAccessChain %_ptr_Workgroup_float %239 %uint_0
+               OpStore %240 %float_1 None
+        %241 = OpAccessChain %_ptr_Workgroup_v2float %m58 %uint_0
+        %242 = OpAccessChain %_ptr_Workgroup_float %241 %uint_0
+               OpStore %242 %float_1 None
+        %243 = OpAccessChain %_ptr_Workgroup_v2float %m59 %uint_0
+        %244 = OpAccessChain %_ptr_Workgroup_float %243 %uint_0
+               OpStore %244 %float_1 None
+        %245 = OpAccessChain %_ptr_Workgroup_v2float %m60 %uint_0
+        %246 = OpAccessChain %_ptr_Workgroup_float %245 %uint_0
+               OpStore %246 %float_1 None
+        %247 = OpAccessChain %_ptr_Workgroup_v2float %m61 %uint_0
+        %248 = OpAccessChain %_ptr_Workgroup_float %247 %uint_0
+               OpStore %248 %float_1 None
+        %249 = OpAccessChain %_ptr_Workgroup_v2float %m62 %uint_0
+        %250 = OpAccessChain %_ptr_Workgroup_float %249 %uint_0
+               OpStore %250 %float_1 None
+        %251 = OpAccessChain %_ptr_Workgroup_v2float %m63 %uint_0
+        %252 = OpAccessChain %_ptr_Workgroup_float %251 %uint_0
+               OpStore %252 %float_1 None
+        %253 = OpAccessChain %_ptr_Workgroup_v2float %m64 %uint_0
+        %254 = OpAccessChain %_ptr_Workgroup_float %253 %uint_0
+               OpStore %254 %float_1 None
+        %255 = OpAccessChain %_ptr_Workgroup_v2float %m65 %uint_0
+        %256 = OpAccessChain %_ptr_Workgroup_float %255 %uint_0
+               OpStore %256 %float_1 None
+        %257 = OpAccessChain %_ptr_Workgroup_v2float %m66 %uint_0
+        %258 = OpAccessChain %_ptr_Workgroup_float %257 %uint_0
+               OpStore %258 %float_1 None
+        %259 = OpAccessChain %_ptr_Workgroup_v2float %m67 %uint_0
+        %260 = OpAccessChain %_ptr_Workgroup_float %259 %uint_0
+               OpStore %260 %float_1 None
+        %261 = OpAccessChain %_ptr_Workgroup_v2float %m68 %uint_0
+        %262 = OpAccessChain %_ptr_Workgroup_float %261 %uint_0
+               OpStore %262 %float_1 None
+        %263 = OpAccessChain %_ptr_Workgroup_v2float %m69 %uint_0
+        %264 = OpAccessChain %_ptr_Workgroup_float %263 %uint_0
+               OpStore %264 %float_1 None
+        %265 = OpAccessChain %_ptr_Workgroup_v2float %m70 %uint_0
+        %266 = OpAccessChain %_ptr_Workgroup_float %265 %uint_0
+               OpStore %266 %float_1 None
+        %267 = OpAccessChain %_ptr_Workgroup_v2float %m71 %uint_0
+        %268 = OpAccessChain %_ptr_Workgroup_float %267 %uint_0
+               OpStore %268 %float_1 None
+        %269 = OpAccessChain %_ptr_Workgroup_v2float %m72 %uint_0
+        %270 = OpAccessChain %_ptr_Workgroup_float %269 %uint_0
+               OpStore %270 %float_1 None
+        %271 = OpAccessChain %_ptr_Workgroup_v2float %m73 %uint_0
+        %272 = OpAccessChain %_ptr_Workgroup_float %271 %uint_0
+               OpStore %272 %float_1 None
+        %273 = OpAccessChain %_ptr_Workgroup_v2float %m74 %uint_0
+        %274 = OpAccessChain %_ptr_Workgroup_float %273 %uint_0
+               OpStore %274 %float_1 None
+        %275 = OpAccessChain %_ptr_Workgroup_v2float %m75 %uint_0
+        %276 = OpAccessChain %_ptr_Workgroup_float %275 %uint_0
+               OpStore %276 %float_1 None
+        %277 = OpAccessChain %_ptr_Workgroup_v2float %m76 %uint_0
+        %278 = OpAccessChain %_ptr_Workgroup_float %277 %uint_0
+               OpStore %278 %float_1 None
+        %279 = OpAccessChain %_ptr_Workgroup_v2float %m77 %uint_0
+        %280 = OpAccessChain %_ptr_Workgroup_float %279 %uint_0
+               OpStore %280 %float_1 None
+        %281 = OpAccessChain %_ptr_Workgroup_v2float %m78 %uint_0
+        %282 = OpAccessChain %_ptr_Workgroup_float %281 %uint_0
+               OpStore %282 %float_1 None
+        %283 = OpAccessChain %_ptr_Workgroup_v2float %m79 %uint_0
+        %284 = OpAccessChain %_ptr_Workgroup_float %283 %uint_0
+               OpStore %284 %float_1 None
+        %285 = OpAccessChain %_ptr_Workgroup_v2float %m80 %uint_0
+        %286 = OpAccessChain %_ptr_Workgroup_float %285 %uint_0
+               OpStore %286 %float_1 None
+        %287 = OpAccessChain %_ptr_Workgroup_v2float %m81 %uint_0
+        %288 = OpAccessChain %_ptr_Workgroup_float %287 %uint_0
+               OpStore %288 %float_1 None
+        %289 = OpAccessChain %_ptr_Workgroup_v2float %m82 %uint_0
+        %290 = OpAccessChain %_ptr_Workgroup_float %289 %uint_0
+               OpStore %290 %float_1 None
+        %291 = OpAccessChain %_ptr_Workgroup_v2float %m83 %uint_0
+        %292 = OpAccessChain %_ptr_Workgroup_float %291 %uint_0
+               OpStore %292 %float_1 None
+        %293 = OpAccessChain %_ptr_Workgroup_v2float %m84 %uint_0
+        %294 = OpAccessChain %_ptr_Workgroup_float %293 %uint_0
+               OpStore %294 %float_1 None
+        %295 = OpAccessChain %_ptr_Workgroup_v2float %m85 %uint_0
+        %296 = OpAccessChain %_ptr_Workgroup_float %295 %uint_0
+               OpStore %296 %float_1 None
+        %297 = OpAccessChain %_ptr_Workgroup_v2float %m86 %uint_0
+        %298 = OpAccessChain %_ptr_Workgroup_float %297 %uint_0
+               OpStore %298 %float_1 None
+        %299 = OpAccessChain %_ptr_Workgroup_v2float %m87 %uint_0
+        %300 = OpAccessChain %_ptr_Workgroup_float %299 %uint_0
+               OpStore %300 %float_1 None
+        %301 = OpAccessChain %_ptr_Workgroup_v2float %m88 %uint_0
+        %302 = OpAccessChain %_ptr_Workgroup_float %301 %uint_0
+               OpStore %302 %float_1 None
+        %303 = OpAccessChain %_ptr_Workgroup_v2float %m89 %uint_0
+        %304 = OpAccessChain %_ptr_Workgroup_float %303 %uint_0
+               OpStore %304 %float_1 None
+        %305 = OpAccessChain %_ptr_Workgroup_v2float %m90 %uint_0
+        %306 = OpAccessChain %_ptr_Workgroup_float %305 %uint_0
+               OpStore %306 %float_1 None
+        %307 = OpAccessChain %_ptr_Workgroup_v2float %m91 %uint_0
+        %308 = OpAccessChain %_ptr_Workgroup_float %307 %uint_0
+               OpStore %308 %float_1 None
+        %309 = OpAccessChain %_ptr_Workgroup_v2float %m92 %uint_0
+        %310 = OpAccessChain %_ptr_Workgroup_float %309 %uint_0
+               OpStore %310 %float_1 None
+        %311 = OpAccessChain %_ptr_Workgroup_v2float %m93 %uint_0
+        %312 = OpAccessChain %_ptr_Workgroup_float %311 %uint_0
+               OpStore %312 %float_1 None
+        %313 = OpAccessChain %_ptr_Workgroup_v2float %m94 %uint_0
+        %314 = OpAccessChain %_ptr_Workgroup_float %313 %uint_0
+               OpStore %314 %float_1 None
+        %315 = OpAccessChain %_ptr_Workgroup_v2float %m95 %uint_0
+        %316 = OpAccessChain %_ptr_Workgroup_float %315 %uint_0
+               OpStore %316 %float_1 None
+        %317 = OpAccessChain %_ptr_Workgroup_v2float %m96 %uint_0
+        %318 = OpAccessChain %_ptr_Workgroup_float %317 %uint_0
+               OpStore %318 %float_1 None
+        %319 = OpAccessChain %_ptr_Workgroup_v2float %m97 %uint_0
+        %320 = OpAccessChain %_ptr_Workgroup_float %319 %uint_0
+               OpStore %320 %float_1 None
+        %321 = OpAccessChain %_ptr_Workgroup_v2float %m98 %uint_0
+        %322 = OpAccessChain %_ptr_Workgroup_float %321 %uint_0
+               OpStore %322 %float_1 None
+        %323 = OpAccessChain %_ptr_Workgroup_v2float %m99 %uint_0
+        %324 = OpAccessChain %_ptr_Workgroup_float %323 %uint_0
+               OpStore %324 %float_1 None
                OpReturn
                OpFunctionEnd
 %tint_symbol = OpFunction %void None %327
diff --git a/test/tint/var/uses/workgroup.wgsl.expected.spvasm b/test/tint/var/uses/workgroup.wgsl.expected.spvasm
index c12c7a2..6d86d8b 100644
--- a/test/tint/var/uses/workgroup.wgsl.expected.spvasm
+++ b/test/tint/var/uses/workgroup.wgsl.expected.spvasm
@@ -29,10 +29,10 @@
          %16 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
      %int_42 = OpConstant %int 42
+      %int_0 = OpConstant %int 0
      %uses_a = OpFunction %void None %9
          %10 = OpLabel
          %11 = OpLoad %int %a None
@@ -52,7 +52,7 @@
          %21 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
                OpStore %a %int_42 None
-         %28 = OpFunctionCall %void %uses_a
+         %27 = OpFunctionCall %void %uses_a
                OpReturn
                OpFunctionEnd
       %main1 = OpFunction %void None %9
@@ -92,10 +92,10 @@
          %16 = OpTypeFunction %void %uint
      %uint_1 = OpConstant %uint 1
        %bool = OpTypeBool
-      %int_0 = OpConstant %int 0
      %uint_2 = OpConstant %uint 2
    %uint_264 = OpConstant %uint 264
       %int_7 = OpConstant %int 7
+      %int_0 = OpConstant %int 0
      %uses_b = OpFunction %void None %9
          %10 = OpLabel
          %11 = OpLoad %int %b None
@@ -115,7 +115,7 @@
          %21 = OpLabel
                OpControlBarrier %uint_2 %uint_2 %uint_264
                OpStore %b %int_7 None
-         %28 = OpFunctionCall %void %uses_b
+         %27 = OpFunctionCall %void %uses_b
                OpReturn
                OpFunctionEnd
       %main2 = OpFunction %void None %9