HLSL-IR: enable replace_pointer_lets in ValueToLet

Thanks to dsinclair@'s recent changes, ValueToLet can now replace lets
to pointers, which inlines them. This is required for HLSL as it does
not support pointers. We were erroneously emitting non-pointer variables
instead.

Bug: 362533189
Change-Id: Ib78c3c52339b9ad22c4725e405f76d166e9adc6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/209254
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/tint/lang/hlsl/writer/printer/printer.cc b/src/tint/lang/hlsl/writer/printer/printer.cc
index 3d6db6f..94126ec 100644
--- a/src/tint/lang/hlsl/writer/printer/printer.cc
+++ b/src/tint/lang/hlsl/writer/printer/printer.cc
@@ -608,6 +608,8 @@
     }
 
     void EmitLet(const core::ir::Let* l, LetType type) {
+        TINT_ASSERT(!l->Result(0)->Type()->Is<core::type::Pointer>());
+
         auto out = Line();
 
         if (type == LetType::kModuleScope) {
diff --git a/src/tint/lang/hlsl/writer/raise/raise.cc b/src/tint/lang/hlsl/writer/raise/raise.cc
index 2e9b1e2..feecca8 100644
--- a/src/tint/lang/hlsl/writer/raise/raise.cc
+++ b/src/tint/lang/hlsl/writer/raise/raise.cc
@@ -198,6 +198,7 @@
     RUN_TRANSFORM(core::ir::transform::RenameConflicts, module);
     {
         core::ir::transform::ValueToLetConfig cfg;
+        cfg.replace_pointer_lets = true;
         RUN_TRANSFORM(core::ir::transform::ValueToLet, module, cfg);
     }
 
diff --git a/test/tint/access/ptr.wgsl.expected.ir.dxc.hlsl b/test/tint/access/ptr.wgsl.expected.ir.dxc.hlsl
index 31c71a4..8d4a69d 100644
--- a/test/tint/access/ptr.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/access/ptr.wgsl.expected.ir.dxc.hlsl
@@ -29,9 +29,8 @@
 }
 
 int accept_ptr_to_struct_access_pass_ptr(inout S val) {
-  int b = val.a;
-  b = int(2);
-  return b;
+  val.a = int(2);
+  return val.a;
 }
 
 int tint_f32_to_i32(float value) {
@@ -57,14 +56,13 @@
   GroupMemoryBarrierWithGroupSync();
   int v1 = int(0);
   S v2 = (S)0;
-  S v3 = v2;
   float3 v4 = (0.0f).xxx;
   int v_4 = int(0);
   InterlockedOr(g1, int(0), v_4);
   int t1 = v_4;
   int v_5 = accept_ptr_deref_pass_through(v1);
   int v_6 = (v_5 + accept_ptr_to_struct_and_access(v2));
-  int v_7 = (v_6 + accept_ptr_to_struct_and_access(v3));
+  int v_7 = (v_6 + accept_ptr_to_struct_and_access(v2));
   int v_8 = (v_7 + accept_ptr_vec_access_elements(v4));
   int v_9 = (v_8 + accept_ptr_to_struct_access_pass_ptr(v2));
   s.Store(0u, asuint(((v_9 + call_builtin_with_mod_scope_ptr()) + t1)));
diff --git a/test/tint/array/assign_to_subexpr.wgsl.expected.ir.dxc.hlsl b/test/tint/array/assign_to_subexpr.wgsl.expected.ir.dxc.hlsl
index a4f9c0f..9f3d59b 100644
--- a/test/tint/array/assign_to_subexpr.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/array/assign_to_subexpr.wgsl.expected.ir.dxc.hlsl
@@ -9,20 +9,17 @@
   int tint_symbol[4] = (int[4])0;
   S dst_struct = (S)0;
   int dst_array[2][4] = (int[2][4])0;
-  int dst_ptr[4] = tint_symbol;
-  S dst_struct_ptr = dst_struct;
-  int dst_array_ptr[2][4] = dst_array;
   int src[4] = v;
   dst_struct.arr = src;
   int v_1[4] = v;
   dst_array[int(1)] = v_1;
   int v_2[4] = v;
-  dst_ptr = v_2;
+  tint_symbol = v_2;
   int v_3[4] = v;
-  dst_struct_ptr.arr = v_3;
+  dst_struct.arr = v_3;
   int v_4[4] = v;
-  dst_array_ptr[int(0)] = v_4;
-  return ((dst_ptr[int(0)] + dst_struct_ptr.arr[int(0)]) + dst_array_ptr[int(0)][int(0)]);
+  dst_array[int(0)] = v_4;
+  return ((tint_symbol[int(0)] + dst_struct.arr[int(0)]) + dst_array[int(0)][int(0)]);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.dxc.hlsl b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.dxc.hlsl
index 7fb7bb5..a33e300 100644
--- a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.dxc.hlsl
@@ -112,12 +112,18 @@
   uint v_47 = (32u + (544u * uint(idx)));
   uint4 v_48 = ub[(v_47 / 16u)];
   uint2 vec2_u32 = (((((v_47 % 16u) / 4u) == 2u)) ? (v_48.zw) : (v_48.xy));
-  float3 vec3_f32 = asfloat(ub[((48u + (544u * uint(idx))) / 16u)].xyz);
-  int3 vec3_i32 = asint(ub[((64u + (544u * uint(idx))) / 16u)].xyz);
-  uint3 vec3_u32 = ub[((80u + (544u * uint(idx))) / 16u)].xyz;
-  float4 vec4_f32 = asfloat(ub[((96u + (544u * uint(idx))) / 16u)]);
-  int4 vec4_i32 = asint(ub[((112u + (544u * uint(idx))) / 16u)]);
-  uint4 vec4_u32 = ub[((128u + (544u * uint(idx))) / 16u)];
+  uint v_49 = ((48u + (544u * uint(idx))) / 16u);
+  float3 vec3_f32 = asfloat(ub[v_49].xyz);
+  uint v_50 = ((64u + (544u * uint(idx))) / 16u);
+  int3 vec3_i32 = asint(ub[v_50].xyz);
+  uint v_51 = ((80u + (544u * uint(idx))) / 16u);
+  uint3 vec3_u32 = ub[v_51].xyz;
+  uint v_52 = ((96u + (544u * uint(idx))) / 16u);
+  float4 vec4_f32 = asfloat(ub[v_52]);
+  uint v_53 = ((112u + (544u * uint(idx))) / 16u);
+  int4 vec4_i32 = asint(ub[v_53]);
+  uint v_54 = ((128u + (544u * uint(idx))) / 16u);
+  uint4 vec4_u32 = ub[v_54];
   float2x2 mat2x2_f32 = v_36((144u + (544u * uint(idx))));
   float2x3 mat2x3_f32 = v_34((160u + (544u * uint(idx))));
   float2x4 mat2x4_f32 = v_32((192u + (544u * uint(idx))));
@@ -127,26 +133,26 @@
   float4x2 mat4x2_f32 = v_12((352u + (544u * uint(idx))));
   float4x3 mat4x3_f32 = v_8((384u + (544u * uint(idx))));
   float4x4 mat4x4_f32 = v_4((448u + (544u * uint(idx))));
-  float3 v_49[2] = v((512u + (544u * uint(idx))));
-  int v_50 = (tint_f32_to_i32(scalar_f32) + scalar_i32);
-  int v_51 = (v_50 + int(scalar_u32));
-  int v_52 = ((v_51 + tint_f32_to_i32(vec2_f32[0u])) + vec2_i32[0u]);
-  int v_53 = (v_52 + int(vec2_u32[0u]));
-  int v_54 = ((v_53 + tint_f32_to_i32(vec3_f32[1u])) + vec3_i32[1u]);
-  int v_55 = (v_54 + int(vec3_u32[1u]));
-  int v_56 = ((v_55 + tint_f32_to_i32(vec4_f32[2u])) + vec4_i32[2u]);
-  int v_57 = (v_56 + int(vec4_u32[2u]));
-  int v_58 = (v_57 + tint_f32_to_i32(mat2x2_f32[int(0)][0u]));
-  int v_59 = (v_58 + tint_f32_to_i32(mat2x3_f32[int(0)][0u]));
-  int v_60 = (v_59 + tint_f32_to_i32(mat2x4_f32[int(0)][0u]));
-  int v_61 = (v_60 + tint_f32_to_i32(mat3x2_f32[int(0)][0u]));
-  int v_62 = (v_61 + tint_f32_to_i32(mat3x3_f32[int(0)][0u]));
-  int v_63 = (v_62 + tint_f32_to_i32(mat3x4_f32[int(0)][0u]));
-  int v_64 = (v_63 + tint_f32_to_i32(mat4x2_f32[int(0)][0u]));
-  int v_65 = (v_64 + tint_f32_to_i32(mat4x3_f32[int(0)][0u]));
-  int v_66 = (v_65 + tint_f32_to_i32(mat4x4_f32[int(0)][0u]));
-  float3 arr2_vec3_f32[2] = v_49;
-  s.Store(0u, asuint((v_66 + tint_f32_to_i32(arr2_vec3_f32[int(0)][0u]))));
+  float3 v_55[2] = v((512u + (544u * uint(idx))));
+  int v_56 = (tint_f32_to_i32(scalar_f32) + scalar_i32);
+  int v_57 = (v_56 + int(scalar_u32));
+  int v_58 = ((v_57 + tint_f32_to_i32(vec2_f32[0u])) + vec2_i32[0u]);
+  int v_59 = (v_58 + int(vec2_u32[0u]));
+  int v_60 = ((v_59 + tint_f32_to_i32(vec3_f32[1u])) + vec3_i32[1u]);
+  int v_61 = (v_60 + int(vec3_u32[1u]));
+  int v_62 = ((v_61 + tint_f32_to_i32(vec4_f32[2u])) + vec4_i32[2u]);
+  int v_63 = (v_62 + int(vec4_u32[2u]));
+  int v_64 = (v_63 + tint_f32_to_i32(mat2x2_f32[int(0)][0u]));
+  int v_65 = (v_64 + tint_f32_to_i32(mat2x3_f32[int(0)][0u]));
+  int v_66 = (v_65 + tint_f32_to_i32(mat2x4_f32[int(0)][0u]));
+  int v_67 = (v_66 + tint_f32_to_i32(mat3x2_f32[int(0)][0u]));
+  int v_68 = (v_67 + tint_f32_to_i32(mat3x3_f32[int(0)][0u]));
+  int v_69 = (v_68 + tint_f32_to_i32(mat3x4_f32[int(0)][0u]));
+  int v_70 = (v_69 + tint_f32_to_i32(mat4x2_f32[int(0)][0u]));
+  int v_71 = (v_70 + tint_f32_to_i32(mat4x3_f32[int(0)][0u]));
+  int v_72 = (v_71 + tint_f32_to_i32(mat4x4_f32[int(0)][0u]));
+  float3 arr2_vec3_f32[2] = v_55;
+  s.Store(0u, asuint((v_72 + tint_f32_to_i32(arr2_vec3_f32[int(0)][0u]))));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.fxc.hlsl b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.fxc.hlsl
index 7fb7bb5..a33e300 100644
--- a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.ir.fxc.hlsl
@@ -112,12 +112,18 @@
   uint v_47 = (32u + (544u * uint(idx)));
   uint4 v_48 = ub[(v_47 / 16u)];
   uint2 vec2_u32 = (((((v_47 % 16u) / 4u) == 2u)) ? (v_48.zw) : (v_48.xy));
-  float3 vec3_f32 = asfloat(ub[((48u + (544u * uint(idx))) / 16u)].xyz);
-  int3 vec3_i32 = asint(ub[((64u + (544u * uint(idx))) / 16u)].xyz);
-  uint3 vec3_u32 = ub[((80u + (544u * uint(idx))) / 16u)].xyz;
-  float4 vec4_f32 = asfloat(ub[((96u + (544u * uint(idx))) / 16u)]);
-  int4 vec4_i32 = asint(ub[((112u + (544u * uint(idx))) / 16u)]);
-  uint4 vec4_u32 = ub[((128u + (544u * uint(idx))) / 16u)];
+  uint v_49 = ((48u + (544u * uint(idx))) / 16u);
+  float3 vec3_f32 = asfloat(ub[v_49].xyz);
+  uint v_50 = ((64u + (544u * uint(idx))) / 16u);
+  int3 vec3_i32 = asint(ub[v_50].xyz);
+  uint v_51 = ((80u + (544u * uint(idx))) / 16u);
+  uint3 vec3_u32 = ub[v_51].xyz;
+  uint v_52 = ((96u + (544u * uint(idx))) / 16u);
+  float4 vec4_f32 = asfloat(ub[v_52]);
+  uint v_53 = ((112u + (544u * uint(idx))) / 16u);
+  int4 vec4_i32 = asint(ub[v_53]);
+  uint v_54 = ((128u + (544u * uint(idx))) / 16u);
+  uint4 vec4_u32 = ub[v_54];
   float2x2 mat2x2_f32 = v_36((144u + (544u * uint(idx))));
   float2x3 mat2x3_f32 = v_34((160u + (544u * uint(idx))));
   float2x4 mat2x4_f32 = v_32((192u + (544u * uint(idx))));
@@ -127,26 +133,26 @@
   float4x2 mat4x2_f32 = v_12((352u + (544u * uint(idx))));
   float4x3 mat4x3_f32 = v_8((384u + (544u * uint(idx))));
   float4x4 mat4x4_f32 = v_4((448u + (544u * uint(idx))));
-  float3 v_49[2] = v((512u + (544u * uint(idx))));
-  int v_50 = (tint_f32_to_i32(scalar_f32) + scalar_i32);
-  int v_51 = (v_50 + int(scalar_u32));
-  int v_52 = ((v_51 + tint_f32_to_i32(vec2_f32[0u])) + vec2_i32[0u]);
-  int v_53 = (v_52 + int(vec2_u32[0u]));
-  int v_54 = ((v_53 + tint_f32_to_i32(vec3_f32[1u])) + vec3_i32[1u]);
-  int v_55 = (v_54 + int(vec3_u32[1u]));
-  int v_56 = ((v_55 + tint_f32_to_i32(vec4_f32[2u])) + vec4_i32[2u]);
-  int v_57 = (v_56 + int(vec4_u32[2u]));
-  int v_58 = (v_57 + tint_f32_to_i32(mat2x2_f32[int(0)][0u]));
-  int v_59 = (v_58 + tint_f32_to_i32(mat2x3_f32[int(0)][0u]));
-  int v_60 = (v_59 + tint_f32_to_i32(mat2x4_f32[int(0)][0u]));
-  int v_61 = (v_60 + tint_f32_to_i32(mat3x2_f32[int(0)][0u]));
-  int v_62 = (v_61 + tint_f32_to_i32(mat3x3_f32[int(0)][0u]));
-  int v_63 = (v_62 + tint_f32_to_i32(mat3x4_f32[int(0)][0u]));
-  int v_64 = (v_63 + tint_f32_to_i32(mat4x2_f32[int(0)][0u]));
-  int v_65 = (v_64 + tint_f32_to_i32(mat4x3_f32[int(0)][0u]));
-  int v_66 = (v_65 + tint_f32_to_i32(mat4x4_f32[int(0)][0u]));
-  float3 arr2_vec3_f32[2] = v_49;
-  s.Store(0u, asuint((v_66 + tint_f32_to_i32(arr2_vec3_f32[int(0)][0u]))));
+  float3 v_55[2] = v((512u + (544u * uint(idx))));
+  int v_56 = (tint_f32_to_i32(scalar_f32) + scalar_i32);
+  int v_57 = (v_56 + int(scalar_u32));
+  int v_58 = ((v_57 + tint_f32_to_i32(vec2_f32[0u])) + vec2_i32[0u]);
+  int v_59 = (v_58 + int(vec2_u32[0u]));
+  int v_60 = ((v_59 + tint_f32_to_i32(vec3_f32[1u])) + vec3_i32[1u]);
+  int v_61 = (v_60 + int(vec3_u32[1u]));
+  int v_62 = ((v_61 + tint_f32_to_i32(vec4_f32[2u])) + vec4_i32[2u]);
+  int v_63 = (v_62 + int(vec4_u32[2u]));
+  int v_64 = (v_63 + tint_f32_to_i32(mat2x2_f32[int(0)][0u]));
+  int v_65 = (v_64 + tint_f32_to_i32(mat2x3_f32[int(0)][0u]));
+  int v_66 = (v_65 + tint_f32_to_i32(mat2x4_f32[int(0)][0u]));
+  int v_67 = (v_66 + tint_f32_to_i32(mat3x2_f32[int(0)][0u]));
+  int v_68 = (v_67 + tint_f32_to_i32(mat3x3_f32[int(0)][0u]));
+  int v_69 = (v_68 + tint_f32_to_i32(mat3x4_f32[int(0)][0u]));
+  int v_70 = (v_69 + tint_f32_to_i32(mat4x2_f32[int(0)][0u]));
+  int v_71 = (v_70 + tint_f32_to_i32(mat4x3_f32[int(0)][0u]));
+  int v_72 = (v_71 + tint_f32_to_i32(mat4x4_f32[int(0)][0u]));
+  float3 arr2_vec3_f32[2] = v_55;
+  s.Store(0u, asuint((v_72 + tint_f32_to_i32(arr2_vec3_f32[int(0)][0u]))));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.dxc.hlsl b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.dxc.hlsl
index 0031724..8a7171d 100644
--- a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.ir.dxc.hlsl
@@ -227,14 +227,22 @@
   uint v_96 = (40u + (800u * uint(idx)));
   uint4 v_97 = ub[(v_96 / 16u)];
   vector<float16_t, 2> vec2_f16 = tint_bitcast_to_f16((((((v_96 % 16u) / 4u) == 2u)) ? (v_97.z) : (v_97.x)));
-  float3 vec3_f32 = asfloat(ub[((48u + (800u * uint(idx))) / 16u)].xyz);
-  int3 vec3_i32 = asint(ub[((64u + (800u * uint(idx))) / 16u)].xyz);
-  uint3 vec3_u32 = ub[((80u + (800u * uint(idx))) / 16u)].xyz;
-  vector<float16_t, 3> vec3_f16 = tint_bitcast_to_f16_1(ub[((96u + (800u * uint(idx))) / 16u)]).xyz;
-  float4 vec4_f32 = asfloat(ub[((112u + (800u * uint(idx))) / 16u)]);
-  int4 vec4_i32 = asint(ub[((128u + (800u * uint(idx))) / 16u)]);
-  uint4 vec4_u32 = ub[((144u + (800u * uint(idx))) / 16u)];
-  vector<float16_t, 4> vec4_f16 = tint_bitcast_to_f16_1(ub[((160u + (800u * uint(idx))) / 16u)]);
+  uint v_98 = ((48u + (800u * uint(idx))) / 16u);
+  float3 vec3_f32 = asfloat(ub[v_98].xyz);
+  uint v_99 = ((64u + (800u * uint(idx))) / 16u);
+  int3 vec3_i32 = asint(ub[v_99].xyz);
+  uint v_100 = ((80u + (800u * uint(idx))) / 16u);
+  uint3 vec3_u32 = ub[v_100].xyz;
+  uint v_101 = ((96u + (800u * uint(idx))) / 16u);
+  vector<float16_t, 3> vec3_f16 = tint_bitcast_to_f16_1(ub[v_101]).xyz;
+  uint v_102 = ((112u + (800u * uint(idx))) / 16u);
+  float4 vec4_f32 = asfloat(ub[v_102]);
+  uint v_103 = ((128u + (800u * uint(idx))) / 16u);
+  int4 vec4_i32 = asint(ub[v_103]);
+  uint v_104 = ((144u + (800u * uint(idx))) / 16u);
+  uint4 vec4_u32 = ub[v_104];
+  uint v_105 = ((160u + (800u * uint(idx))) / 16u);
+  vector<float16_t, 4> vec4_f16 = tint_bitcast_to_f16_1(ub[v_105]);
   float2x2 mat2x2_f32 = v_81((168u + (800u * uint(idx))));
   float2x3 mat2x3_f32 = v_79((192u + (800u * uint(idx))));
   float2x4 mat2x4_f32 = v_77((224u + (800u * uint(idx))));
@@ -253,42 +261,42 @@
   matrix<float16_t, 4, 2> mat4x2_f16 = v_2((648u + (800u * uint(idx))));
   matrix<float16_t, 4, 3> mat4x3_f16 = v_25((664u + (800u * uint(idx))));
   matrix<float16_t, 4, 4> mat4x4_f16 = v_21((696u + (800u * uint(idx))));
-  float3 v_98[2] = v_14((736u + (800u * uint(idx))));
-  matrix<float16_t, 4, 2> v_99[2] = v_10((768u + (800u * uint(idx))));
-  int v_100 = (tint_f32_to_i32(scalar_f32) + scalar_i32);
-  int v_101 = (v_100 + int(scalar_u32));
-  int v_102 = (v_101 + tint_f16_to_i32(scalar_f16));
-  int v_103 = ((v_102 + tint_f32_to_i32(vec2_f32[0u])) + vec2_i32[0u]);
-  int v_104 = (v_103 + int(vec2_u32[0u]));
-  int v_105 = (v_104 + tint_f16_to_i32(vec2_f16[0u]));
-  int v_106 = ((v_105 + tint_f32_to_i32(vec3_f32[1u])) + vec3_i32[1u]);
-  int v_107 = (v_106 + int(vec3_u32[1u]));
-  int v_108 = (v_107 + tint_f16_to_i32(vec3_f16[1u]));
-  int v_109 = ((v_108 + tint_f32_to_i32(vec4_f32[2u])) + vec4_i32[2u]);
-  int v_110 = (v_109 + int(vec4_u32[2u]));
-  int v_111 = (v_110 + tint_f16_to_i32(vec4_f16[2u]));
-  int v_112 = (v_111 + tint_f32_to_i32(mat2x2_f32[int(0)][0u]));
-  int v_113 = (v_112 + tint_f32_to_i32(mat2x3_f32[int(0)][0u]));
-  int v_114 = (v_113 + tint_f32_to_i32(mat2x4_f32[int(0)][0u]));
-  int v_115 = (v_114 + tint_f32_to_i32(mat3x2_f32[int(0)][0u]));
-  int v_116 = (v_115 + tint_f32_to_i32(mat3x3_f32[int(0)][0u]));
-  int v_117 = (v_116 + tint_f32_to_i32(mat3x4_f32[int(0)][0u]));
-  int v_118 = (v_117 + tint_f32_to_i32(mat4x2_f32[int(0)][0u]));
-  int v_119 = (v_118 + tint_f32_to_i32(mat4x3_f32[int(0)][0u]));
-  int v_120 = (v_119 + tint_f32_to_i32(mat4x4_f32[int(0)][0u]));
-  int v_121 = (v_120 + tint_f16_to_i32(mat2x2_f16[int(0)][0u]));
-  int v_122 = (v_121 + tint_f16_to_i32(mat2x3_f16[int(0)][0u]));
-  int v_123 = (v_122 + tint_f16_to_i32(mat2x4_f16[int(0)][0u]));
-  int v_124 = (v_123 + tint_f16_to_i32(mat3x2_f16[int(0)][0u]));
-  int v_125 = (v_124 + tint_f16_to_i32(mat3x3_f16[int(0)][0u]));
-  int v_126 = (v_125 + tint_f16_to_i32(mat3x4_f16[int(0)][0u]));
-  int v_127 = (v_126 + tint_f16_to_i32(mat4x2_f16[int(0)][0u]));
-  int v_128 = (v_127 + tint_f16_to_i32(mat4x3_f16[int(0)][0u]));
-  int v_129 = (v_128 + tint_f16_to_i32(mat4x4_f16[int(0)][0u]));
-  float3 arr2_vec3_f32[2] = v_98;
-  int v_130 = (v_129 + tint_f32_to_i32(arr2_vec3_f32[int(0)][0u]));
-  matrix<float16_t, 4, 2> arr2_mat4x2_f16[2] = v_99;
-  s.Store(0u, asuint((v_130 + tint_f16_to_i32(arr2_mat4x2_f16[int(0)][int(0)][0u]))));
+  float3 v_106[2] = v_14((736u + (800u * uint(idx))));
+  matrix<float16_t, 4, 2> v_107[2] = v_10((768u + (800u * uint(idx))));
+  int v_108 = (tint_f32_to_i32(scalar_f32) + scalar_i32);
+  int v_109 = (v_108 + int(scalar_u32));
+  int v_110 = (v_109 + tint_f16_to_i32(scalar_f16));
+  int v_111 = ((v_110 + tint_f32_to_i32(vec2_f32[0u])) + vec2_i32[0u]);
+  int v_112 = (v_111 + int(vec2_u32[0u]));
+  int v_113 = (v_112 + tint_f16_to_i32(vec2_f16[0u]));
+  int v_114 = ((v_113 + tint_f32_to_i32(vec3_f32[1u])) + vec3_i32[1u]);
+  int v_115 = (v_114 + int(vec3_u32[1u]));
+  int v_116 = (v_115 + tint_f16_to_i32(vec3_f16[1u]));
+  int v_117 = ((v_116 + tint_f32_to_i32(vec4_f32[2u])) + vec4_i32[2u]);
+  int v_118 = (v_117 + int(vec4_u32[2u]));
+  int v_119 = (v_118 + tint_f16_to_i32(vec4_f16[2u]));
+  int v_120 = (v_119 + tint_f32_to_i32(mat2x2_f32[int(0)][0u]));
+  int v_121 = (v_120 + tint_f32_to_i32(mat2x3_f32[int(0)][0u]));
+  int v_122 = (v_121 + tint_f32_to_i32(mat2x4_f32[int(0)][0u]));
+  int v_123 = (v_122 + tint_f32_to_i32(mat3x2_f32[int(0)][0u]));
+  int v_124 = (v_123 + tint_f32_to_i32(mat3x3_f32[int(0)][0u]));
+  int v_125 = (v_124 + tint_f32_to_i32(mat3x4_f32[int(0)][0u]));
+  int v_126 = (v_125 + tint_f32_to_i32(mat4x2_f32[int(0)][0u]));
+  int v_127 = (v_126 + tint_f32_to_i32(mat4x3_f32[int(0)][0u]));
+  int v_128 = (v_127 + tint_f32_to_i32(mat4x4_f32[int(0)][0u]));
+  int v_129 = (v_128 + tint_f16_to_i32(mat2x2_f16[int(0)][0u]));
+  int v_130 = (v_129 + tint_f16_to_i32(mat2x3_f16[int(0)][0u]));
+  int v_131 = (v_130 + tint_f16_to_i32(mat2x4_f16[int(0)][0u]));
+  int v_132 = (v_131 + tint_f16_to_i32(mat3x2_f16[int(0)][0u]));
+  int v_133 = (v_132 + tint_f16_to_i32(mat3x3_f16[int(0)][0u]));
+  int v_134 = (v_133 + tint_f16_to_i32(mat3x4_f16[int(0)][0u]));
+  int v_135 = (v_134 + tint_f16_to_i32(mat4x2_f16[int(0)][0u]));
+  int v_136 = (v_135 + tint_f16_to_i32(mat4x3_f16[int(0)][0u]));
+  int v_137 = (v_136 + tint_f16_to_i32(mat4x4_f16[int(0)][0u]));
+  float3 arr2_vec3_f32[2] = v_106;
+  int v_138 = (v_137 + tint_f32_to_i32(arr2_vec3_f32[int(0)][0u]));
+  matrix<float16_t, 4, 2> arr2_mat4x2_f16[2] = v_107;
+  s.Store(0u, asuint((v_138 + tint_f16_to_i32(arr2_mat4x2_f16[int(0)][int(0)][0u]))));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/bug/chromium/1433499.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/chromium/1433499.wgsl.expected.ir.dxc.hlsl
index ae009bb..854fd75 100644
--- a/test/tint/bug/chromium/1433499.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/chromium/1433499.wgsl.expected.ir.dxc.hlsl
@@ -1,6 +1,5 @@
 
 void f(inout float p) {
-  float x = p;
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.dxc.hlsl
index 186a8ec..862961f 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.dxc.hlsl
@@ -10,6 +10,7 @@
 [numthreads(1, 1, 1)]
 void f() {
   S s = (S)0;
-  result.Store(0u, asuint(s.data[asint(ubo[0u].x)]));
+  int v = asint(ubo[0u].x);
+  result.Store(0u, asuint(s.data[v]));
 }
 
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.fxc.hlsl
index 186a8ec..862961f 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/function.wgsl.expected.ir.fxc.hlsl
@@ -10,6 +10,7 @@
 [numthreads(1, 1, 1)]
 void f() {
   S s = (S)0;
-  result.Store(0u, asuint(s.data[asint(ubo[0u].x)]));
+  int v = asint(ubo[0u].x);
+  result.Store(0u, asuint(s.data[v]));
 }
 
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.dxc.hlsl
index 23e8f6e..1180c04 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.dxc.hlsl
@@ -10,6 +10,7 @@
 static S s = (S)0;
 [numthreads(1, 1, 1)]
 void f() {
-  result.Store(0u, asuint(s.data[asint(ubo[0u].x)]));
+  int v = asint(ubo[0u].x);
+  result.Store(0u, asuint(s.data[v]));
 }
 
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.fxc.hlsl
index 23e8f6e..1180c04 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/private.wgsl.expected.ir.fxc.hlsl
@@ -10,6 +10,7 @@
 static S s = (S)0;
 [numthreads(1, 1, 1)]
 void f() {
-  result.Store(0u, asuint(s.data[asint(ubo[0u].x)]));
+  int v = asint(ubo[0u].x);
+  result.Store(0u, asuint(s.data[v]));
 }
 
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.dxc.hlsl
index 1a11d1b..1f32ea6 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.dxc.hlsl
@@ -29,7 +29,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  result.Store(0u, asuint(s.data[asint(ubo[0u].x)]));
+  int v_2 = asint(ubo[0u].x);
+  result.Store(0u, asuint(s.data[v_2]));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.fxc.hlsl
index 1a11d1b..1f32ea6 100644
--- a/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.ir.fxc.hlsl
@@ -29,7 +29,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  result.Store(0u, asuint(s.data[asint(ubo[0u].x)]));
+  int v_2 = asint(ubo[0u].x);
+  result.Store(0u, asuint(s.data[v_2]));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.dxc.hlsl
index 6156113..84880c4 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/function.wgsl.expected.ir.dxc.hlsl
@@ -10,7 +10,8 @@
 [numthreads(1, 1, 1)]
 void f() {
   S s = (S)0;
-  s.data[asint(ubo[0u].x)] = int(1);
+  int v = asint(ubo[0u].x);
+  s.data[v] = int(1);
   result.Store(0u, asuint(s.data[int(3)]));
 }
 
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.dxc.hlsl
index fef4d79..6b5b381 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/function_via_param.wgsl.expected.ir.dxc.hlsl
@@ -8,7 +8,8 @@
 };
 RWByteAddressBuffer result : register(u1);
 void x(inout S p) {
-  p.data[asint(ubo[0u].x)] = int(1);
+  int v = asint(ubo[0u].x);
+  p.data[v] = int(1);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.dxc.hlsl
index 1b53f80..dea5353 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/private.wgsl.expected.ir.dxc.hlsl
@@ -10,7 +10,8 @@
 static S s = (S)0;
 [numthreads(1, 1, 1)]
 void f() {
-  s.data[asint(ubo[0u].x)] = int(1);
+  int v = asint(ubo[0u].x);
+  s.data[v] = int(1);
   result.Store(0u, asuint(s.data[int(3)]));
 }
 
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.dxc.hlsl
index be19cd2..97ba0a1 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/private_via_param.wgsl.expected.ir.dxc.hlsl
@@ -9,7 +9,8 @@
 RWByteAddressBuffer result : register(u1);
 static S s = (S)0;
 void x(inout S p) {
-  p.data[asint(ubo[0u].x)] = int(1);
+  int v = asint(ubo[0u].x);
+  p.data[v] = int(1);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.dxc.hlsl
index 899621e..bf11112 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.dxc.hlsl
@@ -29,7 +29,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  s.data[asint(ubo[0u].x)] = int(1);
+  int v_2 = asint(ubo[0u].x);
+  s.data[v_2] = int(1);
   result.Store(0u, asuint(s.data[int(3)]));
 }
 
diff --git a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.fxc.hlsl
index 899621e..bf11112 100644
--- a/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.ir.fxc.hlsl
@@ -29,7 +29,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  s.data[asint(ubo[0u].x)] = int(1);
+  int v_2 = asint(ubo[0u].x);
+  s.data[v_2] = int(1);
   result.Store(0u, asuint(s.data[int(3)]));
 }
 
diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.dxc.hlsl
index 24e2323..d856260 100644
--- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.dxc.hlsl
@@ -44,6 +44,8 @@
 [numthreads(1, 1, 1)]
 void main() {
   Particle particle = v_4(0u);
-  particle.position[sim[0u].x] = particle.position[sim[0u].x];
+  uint v_10 = sim[0u].x;
+  uint v_11 = sim[0u].x;
+  particle.position[v_10] = particle.position[v_11];
 }
 
diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.fxc.hlsl
index ee10081..808f0db 100644
--- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.ir.fxc.hlsl
@@ -45,9 +45,10 @@
 void main() {
   Particle particle = v_4(0u);
   uint v_10 = sim[0u].x;
+  uint v_11 = sim[0u].x;
   float3 tint_array_copy[8] = particle.position;
-  tint_array_copy[v_10] = particle.position[sim[0u].x];
-  float3 v_11[8] = tint_array_copy;
-  particle.position = v_11;
+  tint_array_copy[v_10] = particle.position[v_11];
+  float3 v_12[8] = tint_array_copy;
+  particle.position = v_12;
 }
 
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.dxc.hlsl
index 189d0f5..8dd0639 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_x.wgsl.expected.ir.dxc.hlsl
@@ -5,6 +5,7 @@
 [numthreads(1, 1, 1)]
 void main() {
   float2x4 m1 = float2x4((0.0f).xxxx, (0.0f).xxxx);
-  m1[uniforms[0u].x][int(0)] = 1.0f;
+  uint v = uniforms[0u].x;
+  m1[v][int(0)] = 1.0f;
 }
 
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl
index 542318f..72f575a 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl
@@ -5,6 +5,7 @@
 [numthreads(1, 1, 1)]
 void main() {
   float2x4 m1 = float2x4((0.0f).xxxx, (0.0f).xxxx);
-  m1[uniforms[0u].x][uniforms[0u].y] = 1.0f;
+  uint v = uniforms[0u].x;
+  m1[v][uniforms[0u].y] = 1.0f;
 }
 
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.dxc.hlsl
index 19af7e8..d70b912 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/local_assign_vector.wgsl.expected.ir.dxc.hlsl
@@ -5,6 +5,7 @@
 [numthreads(1, 1, 1)]
 void main() {
   float2x4 m1 = float2x4((0.0f).xxxx, (0.0f).xxxx);
-  m1[uniforms[0u].x] = (1.0f).xxxx;
+  uint v = uniforms[0u].x;
+  m1[v] = (1.0f).xxxx;
 }
 
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.dxc.hlsl
index fbab03c..02ee6a5 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_x.wgsl.expected.ir.dxc.hlsl
@@ -5,6 +5,7 @@
 static float2x4 m1 = float2x4((0.0f).xxxx, (0.0f).xxxx);
 [numthreads(1, 1, 1)]
 void main() {
-  m1[uniforms[0u].x][int(0)] = 1.0f;
+  uint v = uniforms[0u].x;
+  m1[v][int(0)] = 1.0f;
 }
 
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl
index 8417610..dc9d126 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_scalar_xy.wgsl.expected.ir.dxc.hlsl
@@ -5,6 +5,7 @@
 static float2x4 m1 = float2x4((0.0f).xxxx, (0.0f).xxxx);
 [numthreads(1, 1, 1)]
 void main() {
-  m1[uniforms[0u].x][uniforms[0u].y] = 1.0f;
+  uint v = uniforms[0u].x;
+  m1[v][uniforms[0u].y] = 1.0f;
 }
 
diff --git a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.dxc.hlsl
index ee087bb..84f8202 100644
--- a/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/fxc/matrix_assignment_dynamic_index/module_assign_vector.wgsl.expected.ir.dxc.hlsl
@@ -5,6 +5,7 @@
 static float2x4 m1 = float2x4((0.0f).xxxx, (0.0f).xxxx);
 [numthreads(1, 1, 1)]
 void main() {
-  m1[uniforms[0u].x] = (1.0f).xxxx;
+  uint v = uniforms[0u].x;
+  m1[v] = (1.0f).xxxx;
 }
 
diff --git a/test/tint/bug/tint/1121.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/1121.wgsl.expected.ir.dxc.hlsl
index 24d15ec..acc92d6 100644
--- a/test/tint/bug/tint/1121.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/1121.wgsl.expected.ir.dxc.hlsl
@@ -85,24 +85,29 @@
                 break;
               }
               float4 p = (0.0f).xxxx;
-              if ((frustumPlanes[i].x > 0.0f)) {
+              uint v_15 = i;
+              if ((frustumPlanes[v_15].x > 0.0f)) {
                 p[0u] = boxMax.x;
               } else {
                 p[0u] = boxMin.x;
               }
-              if ((frustumPlanes[i].y > 0.0f)) {
+              uint v_16 = i;
+              if ((frustumPlanes[v_16].y > 0.0f)) {
                 p[1u] = boxMax.y;
               } else {
                 p[1u] = boxMin.y;
               }
-              if ((frustumPlanes[i].z > 0.0f)) {
+              uint v_17 = i;
+              if ((frustumPlanes[v_17].z > 0.0f)) {
                 p[2u] = boxMax.z;
               } else {
                 p[2u] = boxMin.z;
               }
               p[3u] = 1.0f;
-              float v_15 = dp;
-              dp = (v_15 + min(0.0f, dot(p, frustumPlanes[i])));
+              float v_18 = dp;
+              float4 v_19 = p;
+              uint v_20 = i;
+              dp = (v_18 + min(0.0f, dot(v_19, frustumPlanes[v_20])));
               {
                 i = (i + 1u);
               }
@@ -111,31 +116,31 @@
           }
           if ((dp >= 0.0f)) {
             uint tileId = uint((x + (y * TILE_COUNT_X)));
-            bool v_16 = false;
+            bool v_21 = false;
             if ((tileId < 0u)) {
-              v_16 = true;
+              v_21 = true;
             } else {
-              v_16 = (tileId >= config[0u].y);
+              v_21 = (tileId >= config[0u].y);
             }
-            if (v_16) {
+            if (v_21) {
               {
                 x = (x + int(1));
               }
               continue;
             }
-            uint v_17 = (uint(tileId) * 260u);
-            uint v_18 = 0u;
-            tileLightId.InterlockedAdd(uint(0u), 1u, v_18);
-            uint offset = v_18;
+            uint v_22 = (uint(tileId) * 260u);
+            uint v_23 = 0u;
+            tileLightId.InterlockedAdd(uint(0u), 1u, v_23);
+            uint offset = v_23;
             if ((offset >= config[1u].x)) {
               {
                 x = (x + int(1));
               }
               continue;
             }
-            uint v_19 = offset;
-            uint v_20 = (uint(tileId) * 260u);
-            tileLightId.Store(((4u + v_20) + (uint(v_19) * 4u)), GlobalInvocationID[0u]);
+            uint v_24 = offset;
+            uint v_25 = (uint(tileId) * 260u);
+            tileLightId.Store(((4u + v_25) + (uint(v_24) * 4u)), GlobalInvocationID[0u]);
           }
           {
             x = (x + int(1));
diff --git a/test/tint/bug/tint/1121.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/tint/1121.wgsl.expected.ir.fxc.hlsl
index 24d15ec..acc92d6 100644
--- a/test/tint/bug/tint/1121.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/tint/1121.wgsl.expected.ir.fxc.hlsl
@@ -85,24 +85,29 @@
                 break;
               }
               float4 p = (0.0f).xxxx;
-              if ((frustumPlanes[i].x > 0.0f)) {
+              uint v_15 = i;
+              if ((frustumPlanes[v_15].x > 0.0f)) {
                 p[0u] = boxMax.x;
               } else {
                 p[0u] = boxMin.x;
               }
-              if ((frustumPlanes[i].y > 0.0f)) {
+              uint v_16 = i;
+              if ((frustumPlanes[v_16].y > 0.0f)) {
                 p[1u] = boxMax.y;
               } else {
                 p[1u] = boxMin.y;
               }
-              if ((frustumPlanes[i].z > 0.0f)) {
+              uint v_17 = i;
+              if ((frustumPlanes[v_17].z > 0.0f)) {
                 p[2u] = boxMax.z;
               } else {
                 p[2u] = boxMin.z;
               }
               p[3u] = 1.0f;
-              float v_15 = dp;
-              dp = (v_15 + min(0.0f, dot(p, frustumPlanes[i])));
+              float v_18 = dp;
+              float4 v_19 = p;
+              uint v_20 = i;
+              dp = (v_18 + min(0.0f, dot(v_19, frustumPlanes[v_20])));
               {
                 i = (i + 1u);
               }
@@ -111,31 +116,31 @@
           }
           if ((dp >= 0.0f)) {
             uint tileId = uint((x + (y * TILE_COUNT_X)));
-            bool v_16 = false;
+            bool v_21 = false;
             if ((tileId < 0u)) {
-              v_16 = true;
+              v_21 = true;
             } else {
-              v_16 = (tileId >= config[0u].y);
+              v_21 = (tileId >= config[0u].y);
             }
-            if (v_16) {
+            if (v_21) {
               {
                 x = (x + int(1));
               }
               continue;
             }
-            uint v_17 = (uint(tileId) * 260u);
-            uint v_18 = 0u;
-            tileLightId.InterlockedAdd(uint(0u), 1u, v_18);
-            uint offset = v_18;
+            uint v_22 = (uint(tileId) * 260u);
+            uint v_23 = 0u;
+            tileLightId.InterlockedAdd(uint(0u), 1u, v_23);
+            uint offset = v_23;
             if ((offset >= config[1u].x)) {
               {
                 x = (x + int(1));
               }
               continue;
             }
-            uint v_19 = offset;
-            uint v_20 = (uint(tileId) * 260u);
-            tileLightId.Store(((4u + v_20) + (uint(v_19) * 4u)), GlobalInvocationID[0u]);
+            uint v_24 = offset;
+            uint v_25 = (uint(tileId) * 260u);
+            tileLightId.Store(((4u + v_25) + (uint(v_24) * 4u)), GlobalInvocationID[0u]);
           }
           {
             x = (x + int(1));
diff --git a/test/tint/bug/tint/1321.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/1321.wgsl.expected.ir.dxc.hlsl
index 049e98f..5b0e8af 100644
--- a/test/tint/bug/tint/1321.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/1321.wgsl.expected.ir.dxc.hlsl
@@ -6,9 +6,9 @@
 void main() {
   float arr[4] = (float[4])0;
   {
-    float a = arr[foo()];
+    int v = foo();
     while(true) {
-      float x = a;
+      float x = arr[v];
       break;
     }
   }
diff --git a/test/tint/bug/tint/1321.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/tint/1321.wgsl.expected.ir.fxc.hlsl
index 036cde1..5b0e8af 100644
--- a/test/tint/bug/tint/1321.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/tint/1321.wgsl.expected.ir.fxc.hlsl
@@ -6,9 +6,9 @@
 void main() {
   float arr[4] = (float[4])0;
   {
-    float v = arr[foo()];
+    int v = foo();
     while(true) {
-      float x = v;
+      float x = arr[v];
       break;
     }
   }
diff --git a/test/tint/bug/tint/1764.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/1764.wgsl.expected.ir.dxc.hlsl
index b22dbe6..40aba4a 100644
--- a/test/tint/bug/tint/1764.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/1764.wgsl.expected.ir.dxc.hlsl
@@ -21,8 +21,7 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  int p[246] = W;
-  p[int(0)] = int(42);
+  W[int(0)] = int(42);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/bug/tint/2059.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/2059.wgsl.expected.ir.dxc.hlsl
index 23c0b83..0fd28a0 100644
--- a/test/tint/bug/tint/2059.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/2059.wgsl.expected.ir.dxc.hlsl
@@ -228,10 +228,10 @@
       } else {
         break;
       }
-      float3 v_41 = m[c];
+      uint v_41 = c;
       float v_42 = float(((c * 3u) + 1u));
       float v_43 = float(((c * 3u) + 2u));
-      v_41 = float3(v_42, v_43, float(((c * 3u) + 3u)));
+      m[v_41] = float3(v_42, v_43, float(((c * 3u) + 3u)));
       {
         c = (c + 1u);
       }
diff --git a/test/tint/bug/tint/2059.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/tint/2059.wgsl.expected.ir.fxc.hlsl
index 23c0b83..0fd28a0 100644
--- a/test/tint/bug/tint/2059.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/tint/2059.wgsl.expected.ir.fxc.hlsl
@@ -228,10 +228,10 @@
       } else {
         break;
       }
-      float3 v_41 = m[c];
+      uint v_41 = c;
       float v_42 = float(((c * 3u) + 1u));
       float v_43 = float(((c * 3u) + 2u));
-      v_41 = float3(v_42, v_43, float(((c * 3u) + 3u)));
+      m[v_41] = float3(v_42, v_43, float(((c * 3u) + 3u)));
       {
         c = (c + 1u);
       }
diff --git a/test/tint/bug/tint/914.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/914.wgsl.expected.ir.dxc.hlsl
index 93d5cd5..2845d3d 100644
--- a/test/tint/bug/tint/914.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/914.wgsl.expected.ir.dxc.hlsl
@@ -92,7 +92,8 @@
       } else {
         break;
       }
-      acc[index] = 0.0f;
+      uint v_6 = index;
+      acc[v_6] = 0.0f;
       {
         index = (index + 1u);
       }
@@ -155,8 +156,8 @@
               }
               uint inputRow = (tileRowB + innerRow);
               uint inputCol = (tileCol + innerCol);
-              float v_6 = mm_Bsub[innerCol][inputCol];
-              v_6 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
+              uint v_7 = innerCol;
+              mm_Bsub[v_7][inputCol] = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
               {
                 innerCol = (innerCol + 1u);
               }
@@ -184,7 +185,10 @@
               } else {
                 break;
               }
-              BCached[inner] = mm_Bsub[k][(tileCol + inner)];
+              uint v_8 = inner;
+              uint v_9 = k;
+              uint v_10 = (tileCol + inner);
+              BCached[v_8] = mm_Bsub[v_9][v_10];
               {
                 inner = (inner + 1u);
               }
@@ -198,7 +202,9 @@
               } else {
                 break;
               }
-              ACached = mm_Asub[(tileRow + innerRow)][k];
+              uint v_11 = (tileRow + innerRow);
+              uint v_12 = k;
+              ACached = mm_Asub[v_11][v_12];
               {
                 uint innerCol = 0u;
                 while(true) {
@@ -207,7 +213,10 @@
                     break;
                   }
                   uint index = ((innerRow * 4u) + innerCol);
-                  acc[index] = (acc[index] + (ACached * BCached[innerCol]));
+                  float v_13 = acc[index];
+                  float v_14 = ACached;
+                  uint v_15 = innerCol;
+                  acc[index] = (v_13 + (v_14 * BCached[v_15]));
                   {
                     innerCol = (innerCol + 1u);
                   }
diff --git a/test/tint/bug/tint/914.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/tint/914.wgsl.expected.ir.fxc.hlsl
index 93d5cd5..2845d3d 100644
--- a/test/tint/bug/tint/914.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/tint/914.wgsl.expected.ir.fxc.hlsl
@@ -92,7 +92,8 @@
       } else {
         break;
       }
-      acc[index] = 0.0f;
+      uint v_6 = index;
+      acc[v_6] = 0.0f;
       {
         index = (index + 1u);
       }
@@ -155,8 +156,8 @@
               }
               uint inputRow = (tileRowB + innerRow);
               uint inputCol = (tileCol + innerCol);
-              float v_6 = mm_Bsub[innerCol][inputCol];
-              v_6 = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
+              uint v_7 = innerCol;
+              mm_Bsub[v_7][inputCol] = mm_readB(((t * 64u) + inputRow), (globalCol + innerCol));
               {
                 innerCol = (innerCol + 1u);
               }
@@ -184,7 +185,10 @@
               } else {
                 break;
               }
-              BCached[inner] = mm_Bsub[k][(tileCol + inner)];
+              uint v_8 = inner;
+              uint v_9 = k;
+              uint v_10 = (tileCol + inner);
+              BCached[v_8] = mm_Bsub[v_9][v_10];
               {
                 inner = (inner + 1u);
               }
@@ -198,7 +202,9 @@
               } else {
                 break;
               }
-              ACached = mm_Asub[(tileRow + innerRow)][k];
+              uint v_11 = (tileRow + innerRow);
+              uint v_12 = k;
+              ACached = mm_Asub[v_11][v_12];
               {
                 uint innerCol = 0u;
                 while(true) {
@@ -207,7 +213,10 @@
                     break;
                   }
                   uint index = ((innerRow * 4u) + innerCol);
-                  acc[index] = (acc[index] + (ACached * BCached[innerCol]));
+                  float v_13 = acc[index];
+                  float v_14 = ACached;
+                  uint v_15 = innerCol;
+                  acc[index] = (v_13 + (v_14 * BCached[v_15]));
                   {
                     innerCol = (innerCol + 1u);
                   }
diff --git a/test/tint/bug/tint/942.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/942.wgsl.expected.ir.dxc.hlsl
index 0bd8f81..d39696a 100644
--- a/test/tint/bug/tint/942.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/942.wgsl.expected.ir.dxc.hlsl
@@ -60,10 +60,11 @@
           if ((flip[0u].x != 0u)) {
             loadIndex = loadIndex.yx;
           }
-          float3 v_4 = tile[r][((4u * LocalInvocationID[0u]) + c)];
-          float2 v_5 = (float2(loadIndex) + (0.25f).xx);
-          float2 v_6 = (v_5 / float2(dims));
-          v_4 = inputTex.SampleLevel(samp, v_6, float(0.0f)).xyz;
+          uint v_4 = r;
+          uint v_5 = ((4u * LocalInvocationID[0u]) + c);
+          float2 v_6 = (float2(loadIndex) + (0.25f).xx);
+          float2 v_7 = (v_6 / float2(dims));
+          tile[v_4][v_5] = inputTex.SampleLevel(samp, v_7, float(0.0f)).xyz;
           {
             c = (c + 1u);
           }
@@ -96,19 +97,19 @@
             writeIndex = writeIndex.yx;
           }
           uint center = ((4u * LocalInvocationID[0u]) + c);
-          bool v_7 = false;
-          if ((center >= filterOffset)) {
-            v_7 = (center < (256u - filterOffset));
-          } else {
-            v_7 = false;
-          }
           bool v_8 = false;
-          if (v_7) {
-            v_8 = all((writeIndex < dims));
+          if ((center >= filterOffset)) {
+            v_8 = (center < (256u - filterOffset));
           } else {
             v_8 = false;
           }
+          bool v_9 = false;
           if (v_8) {
+            v_9 = all((writeIndex < dims));
+          } else {
+            v_9 = false;
+          }
+          if (v_9) {
             float3 acc = (0.0f).xxx;
             {
               uint f = 0u;
@@ -118,17 +119,19 @@
                   break;
                 }
                 uint i = ((center + f) - filterOffset);
-                float3 v_9 = acc;
-                float v_10 = (1.0f / float(params[0u].x));
-                acc = (v_9 + (v_10 * tile[r][i]));
+                float3 v_10 = acc;
+                float v_11 = (1.0f / float(params[0u].x));
+                uint v_12 = r;
+                uint v_13 = i;
+                acc = (v_10 + (v_11 * tile[v_12][v_13]));
                 {
                   f = (f + 1u);
                 }
                 continue;
               }
             }
-            uint2 v_11 = writeIndex;
-            outputTex[v_11] = float4(acc, 1.0f);
+            uint2 v_14 = writeIndex;
+            outputTex[v_14] = float4(acc, 1.0f);
           }
           {
             c = (c + 1u);
diff --git a/test/tint/bug/tint/942.wgsl.expected.ir.fxc.hlsl b/test/tint/bug/tint/942.wgsl.expected.ir.fxc.hlsl
index 0bd8f81..d39696a 100644
--- a/test/tint/bug/tint/942.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/bug/tint/942.wgsl.expected.ir.fxc.hlsl
@@ -60,10 +60,11 @@
           if ((flip[0u].x != 0u)) {
             loadIndex = loadIndex.yx;
           }
-          float3 v_4 = tile[r][((4u * LocalInvocationID[0u]) + c)];
-          float2 v_5 = (float2(loadIndex) + (0.25f).xx);
-          float2 v_6 = (v_5 / float2(dims));
-          v_4 = inputTex.SampleLevel(samp, v_6, float(0.0f)).xyz;
+          uint v_4 = r;
+          uint v_5 = ((4u * LocalInvocationID[0u]) + c);
+          float2 v_6 = (float2(loadIndex) + (0.25f).xx);
+          float2 v_7 = (v_6 / float2(dims));
+          tile[v_4][v_5] = inputTex.SampleLevel(samp, v_7, float(0.0f)).xyz;
           {
             c = (c + 1u);
           }
@@ -96,19 +97,19 @@
             writeIndex = writeIndex.yx;
           }
           uint center = ((4u * LocalInvocationID[0u]) + c);
-          bool v_7 = false;
-          if ((center >= filterOffset)) {
-            v_7 = (center < (256u - filterOffset));
-          } else {
-            v_7 = false;
-          }
           bool v_8 = false;
-          if (v_7) {
-            v_8 = all((writeIndex < dims));
+          if ((center >= filterOffset)) {
+            v_8 = (center < (256u - filterOffset));
           } else {
             v_8 = false;
           }
+          bool v_9 = false;
           if (v_8) {
+            v_9 = all((writeIndex < dims));
+          } else {
+            v_9 = false;
+          }
+          if (v_9) {
             float3 acc = (0.0f).xxx;
             {
               uint f = 0u;
@@ -118,17 +119,19 @@
                   break;
                 }
                 uint i = ((center + f) - filterOffset);
-                float3 v_9 = acc;
-                float v_10 = (1.0f / float(params[0u].x));
-                acc = (v_9 + (v_10 * tile[r][i]));
+                float3 v_10 = acc;
+                float v_11 = (1.0f / float(params[0u].x));
+                uint v_12 = r;
+                uint v_13 = i;
+                acc = (v_10 + (v_11 * tile[v_12][v_13]));
                 {
                   f = (f + 1u);
                 }
                 continue;
               }
             }
-            uint2 v_11 = writeIndex;
-            outputTex[v_11] = float4(acc, 1.0f);
+            uint2 v_14 = writeIndex;
+            outputTex[v_14] = float4(acc, 1.0f);
           }
           {
             c = (c + 1u);
diff --git a/test/tint/bug/tint/990.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/990.wgsl.expected.ir.dxc.hlsl
index 3f7a614..6814f11 100644
--- a/test/tint/bug/tint/990.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/990.wgsl.expected.ir.dxc.hlsl
@@ -2,7 +2,6 @@
 void f() {
   int i = int(0);
   {
-    int p = i;
     while(true) {
       if (false) {
       } else {
diff --git a/test/tint/bug/tint/998.wgsl.expected.ir.dxc.hlsl b/test/tint/bug/tint/998.wgsl.expected.ir.dxc.hlsl
index 3f7c1d4..ea68142 100644
--- a/test/tint/bug/tint/998.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/bug/tint/998.wgsl.expected.ir.dxc.hlsl
@@ -10,6 +10,7 @@
 static S s = (S)0;
 [numthreads(1, 1, 1)]
 void main() {
-  s.data[constants[0u].x] = 0u;
+  uint v = constants[0u].x;
+  s.data[v] = 0u;
 }
 
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.dxc.hlsl b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.dxc.hlsl
index e6704b9..cba56b2 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.dxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.dxc.hlsl
@@ -27,8 +27,9 @@
       uint x_35 = idx;
       uint v_1 = tint_div_u32(x_31, 2u);
       uint v_2 = tint_mod_u32(x_33, 2u);
-      uint v_3 = 0u;
-      InterlockedExchange(wg[v_1][v_2][tint_mod_u32(x_35, 1u)], 0u, v_3);
+      uint v_3 = tint_mod_u32(x_35, 1u);
+      uint v_4 = 0u;
+      InterlockedExchange(wg[v_1][v_2][v_3], 0u, v_4);
       {
         idx = (idx + 1u);
       }
@@ -36,8 +37,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  uint v_4 = 0u;
-  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_4);
+  uint v_5 = 0u;
+  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_5);
 }
 
 void compute_main_1() {
@@ -47,17 +48,17 @@
 
 void compute_main_inner_1(uint local_invocation_index_1_param) {
   {
-    uint v_5 = 0u;
-    v_5 = local_invocation_index_1_param;
+    uint v_6 = 0u;
+    v_6 = local_invocation_index_1_param;
     while(true) {
-      uint v_6 = v_5;
-      if ((v_6 >= 6u)) {
+      uint v_7 = v_6;
+      if ((v_7 >= 6u)) {
         break;
       }
-      uint v_7 = 0u;
-      InterlockedExchange(wg[(v_6 / 2u)][(v_6 % 2u)][0u], 0u, v_7);
+      uint v_8 = 0u;
+      InterlockedExchange(wg[(v_7 / 2u)][(v_7 % 2u)][0u], 0u, v_8);
       {
-        v_5 = (v_6 + 1u);
+        v_6 = (v_7 + 1u);
       }
       continue;
     }
diff --git a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.fxc.hlsl b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.fxc.hlsl
index e6704b9..cba56b2 100644
--- a/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.fxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/aliased_arrays.spvasm.expected.ir.fxc.hlsl
@@ -27,8 +27,9 @@
       uint x_35 = idx;
       uint v_1 = tint_div_u32(x_31, 2u);
       uint v_2 = tint_mod_u32(x_33, 2u);
-      uint v_3 = 0u;
-      InterlockedExchange(wg[v_1][v_2][tint_mod_u32(x_35, 1u)], 0u, v_3);
+      uint v_3 = tint_mod_u32(x_35, 1u);
+      uint v_4 = 0u;
+      InterlockedExchange(wg[v_1][v_2][v_3], 0u, v_4);
       {
         idx = (idx + 1u);
       }
@@ -36,8 +37,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  uint v_4 = 0u;
-  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_4);
+  uint v_5 = 0u;
+  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_5);
 }
 
 void compute_main_1() {
@@ -47,17 +48,17 @@
 
 void compute_main_inner_1(uint local_invocation_index_1_param) {
   {
-    uint v_5 = 0u;
-    v_5 = local_invocation_index_1_param;
+    uint v_6 = 0u;
+    v_6 = local_invocation_index_1_param;
     while(true) {
-      uint v_6 = v_5;
-      if ((v_6 >= 6u)) {
+      uint v_7 = v_6;
+      if ((v_7 >= 6u)) {
         break;
       }
-      uint v_7 = 0u;
-      InterlockedExchange(wg[(v_6 / 2u)][(v_6 % 2u)][0u], 0u, v_7);
+      uint v_8 = 0u;
+      InterlockedExchange(wg[(v_7 / 2u)][(v_7 % 2u)][0u], 0u, v_8);
       {
-        v_5 = (v_6 + 1u);
+        v_6 = (v_7 + 1u);
       }
       continue;
     }
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.dxc.hlsl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.dxc.hlsl
index e6704b9..cba56b2 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.dxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.dxc.hlsl
@@ -27,8 +27,9 @@
       uint x_35 = idx;
       uint v_1 = tint_div_u32(x_31, 2u);
       uint v_2 = tint_mod_u32(x_33, 2u);
-      uint v_3 = 0u;
-      InterlockedExchange(wg[v_1][v_2][tint_mod_u32(x_35, 1u)], 0u, v_3);
+      uint v_3 = tint_mod_u32(x_35, 1u);
+      uint v_4 = 0u;
+      InterlockedExchange(wg[v_1][v_2][v_3], 0u, v_4);
       {
         idx = (idx + 1u);
       }
@@ -36,8 +37,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  uint v_4 = 0u;
-  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_4);
+  uint v_5 = 0u;
+  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_5);
 }
 
 void compute_main_1() {
@@ -47,17 +48,17 @@
 
 void compute_main_inner_1(uint local_invocation_index_1_param) {
   {
-    uint v_5 = 0u;
-    v_5 = local_invocation_index_1_param;
+    uint v_6 = 0u;
+    v_6 = local_invocation_index_1_param;
     while(true) {
-      uint v_6 = v_5;
-      if ((v_6 >= 6u)) {
+      uint v_7 = v_6;
+      if ((v_7 >= 6u)) {
         break;
       }
-      uint v_7 = 0u;
-      InterlockedExchange(wg[(v_6 / 2u)][(v_6 % 2u)][0u], 0u, v_7);
+      uint v_8 = 0u;
+      InterlockedExchange(wg[(v_7 / 2u)][(v_7 % 2u)][0u], 0u, v_8);
       {
-        v_5 = (v_6 + 1u);
+        v_6 = (v_7 + 1u);
       }
       continue;
     }
diff --git a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.fxc.hlsl b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.fxc.hlsl
index e6704b9..cba56b2 100644
--- a/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.fxc.hlsl
+++ b/test/tint/builtins/atomicStore/array/arrays.spvasm.expected.ir.fxc.hlsl
@@ -27,8 +27,9 @@
       uint x_35 = idx;
       uint v_1 = tint_div_u32(x_31, 2u);
       uint v_2 = tint_mod_u32(x_33, 2u);
-      uint v_3 = 0u;
-      InterlockedExchange(wg[v_1][v_2][tint_mod_u32(x_35, 1u)], 0u, v_3);
+      uint v_3 = tint_mod_u32(x_35, 1u);
+      uint v_4 = 0u;
+      InterlockedExchange(wg[v_1][v_2][v_3], 0u, v_4);
       {
         idx = (idx + 1u);
       }
@@ -36,8 +37,8 @@
     }
   }
   GroupMemoryBarrierWithGroupSync();
-  uint v_4 = 0u;
-  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_4);
+  uint v_5 = 0u;
+  InterlockedExchange(wg[int(2)][int(1)][int(0)], 1u, v_5);
 }
 
 void compute_main_1() {
@@ -47,17 +48,17 @@
 
 void compute_main_inner_1(uint local_invocation_index_1_param) {
   {
-    uint v_5 = 0u;
-    v_5 = local_invocation_index_1_param;
+    uint v_6 = 0u;
+    v_6 = local_invocation_index_1_param;
     while(true) {
-      uint v_6 = v_5;
-      if ((v_6 >= 6u)) {
+      uint v_7 = v_6;
+      if ((v_7 >= 6u)) {
         break;
       }
-      uint v_7 = 0u;
-      InterlockedExchange(wg[(v_6 / 2u)][(v_6 % 2u)][0u], 0u, v_7);
+      uint v_8 = 0u;
+      InterlockedExchange(wg[(v_7 / 2u)][(v_7 % 2u)][0u], 0u, v_8);
       {
-        v_5 = (v_6 + 1u);
+        v_6 = (v_7 + 1u);
       }
       continue;
     }
diff --git a/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.ir.dxc.hlsl
index 103dd73..c4be0f5 100644
--- a/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/builtins/atomicStore/struct/via_ptr_let.wgsl.expected.ir.dxc.hlsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 struct S {
   int x;
   uint a;
@@ -14,16 +12,14 @@
 groupshared S wg;
 void compute_main_inner(uint tint_local_index) {
   if ((tint_local_index == 0u)) {
-    wg.x = 0;
+    wg.x = int(0);
     uint v = 0u;
     InterlockedExchange(wg.a, 0u, v);
     wg.y = 0u;
   }
   GroupMemoryBarrierWithGroupSync();
-  S p0 = wg;
-  uint p1 = p0.a;
   uint v_1 = 0u;
-  InterlockedExchange(p1, 1u, v_1);
+  InterlockedExchange(wg.a, 1u, v_1);
 }
 
 [numthreads(1, 1, 1)]
@@ -31,21 +27,3 @@
   compute_main_inner(inputs.tint_local_index);
 }
 
-DXC validation failure:
-hlsl.hlsl:14:25: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
-  if ((tint_local_index == 0u)) {
-       ~~~~~~~~~~~~~~~~~^~~~~
-hlsl.hlsl:14:25: note: remove extraneous parentheses around the comparison to silence this warning
-  if ((tint_local_index == 0u)) {
-      ~                 ^    ~
-hlsl.hlsl:14:25: note: use '=' to turn this equality comparison into an assignment
-  if ((tint_local_index == 0u)) {
-                        ^~
-                        =
-error: cannot map resource to handle.
-hlsl.hlsl:24:3: error: Atomic operation targets must be groupshared, Node Record or UAV.
-  InterlockedExchange(p1, 1u, v_1);
-  ^
-
-
-tint executable returned error: exit status 1
diff --git a/test/tint/ptr_ref/access/matrix.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_ref/access/matrix.wgsl.expected.ir.dxc.hlsl
index 3551188..d9c180e 100644
--- a/test/tint/ptr_ref/access/matrix.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_ref/access/matrix.wgsl.expected.ir.dxc.hlsl
@@ -2,7 +2,6 @@
 [numthreads(1, 1, 1)]
 void main() {
   float3x3 m = float3x3(float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f));
-  float3 v = m[int(1)];
-  v = (5.0f).xxx;
+  m[int(1)] = (5.0f).xxx;
 }
 
diff --git a/test/tint/ptr_ref/load/local/ptr_function.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_ref/load/local/ptr_function.wgsl.expected.ir.dxc.hlsl
index f741046..45b0c55 100644
--- a/test/tint/ptr_ref/load/local/ptr_function.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_ref/load/local/ptr_function.wgsl.expected.ir.dxc.hlsl
@@ -2,7 +2,6 @@
 [numthreads(1, 1, 1)]
 void main() {
   int i = int(123);
-  int p = i;
-  int u = (p + int(1));
+  int u = (i + int(1));
 }
 
diff --git a/test/tint/ptr_ref/load/local/ptr_private.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_ref/load/local/ptr_private.wgsl.expected.ir.dxc.hlsl
index a4a308c..904f880 100644
--- a/test/tint/ptr_ref/load/local/ptr_private.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_ref/load/local/ptr_private.wgsl.expected.ir.dxc.hlsl
@@ -2,7 +2,6 @@
 static int i = int(123);
 [numthreads(1, 1, 1)]
 void main() {
-  int p = i;
-  int u = (p + int(1));
+  int u = (i + int(1));
 }
 
diff --git a/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.ir.dxc.hlsl
index a8da9d7..2fadb57 100644
--- a/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_ref/load/local/ptr_workgroup.wgsl.expected.ir.dxc.hlsl
@@ -10,8 +10,7 @@
   }
   GroupMemoryBarrierWithGroupSync();
   i = int(123);
-  int p = i;
-  int u = (p + int(1));
+  int u = (i + int(1));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.dxc.hlsl
index d10214c..9fa6205 100644
--- a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.dxc.hlsl
@@ -3,12 +3,13 @@
   uint4 S[2];
 };
 float4 func(uint pointer_indices[1]) {
-  return asfloat(S[((16u * uint(pointer_indices[0u])) / 16u)]);
+  uint v = ((16u * uint(pointer_indices[0u])) / 16u);
+  return asfloat(S[v]);
 }
 
 [numthreads(1, 1, 1)]
 void main() {
-  uint v[1] = (uint[1])0;
-  float4 r = func(v);
+  uint v_1[1] = (uint[1])0;
+  float4 r = func(v_1);
 }
 
diff --git a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.fxc.hlsl b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.fxc.hlsl
index d10214c..9fa6205 100644
--- a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.ir.fxc.hlsl
@@ -3,12 +3,13 @@
   uint4 S[2];
 };
 float4 func(uint pointer_indices[1]) {
-  return asfloat(S[((16u * uint(pointer_indices[0u])) / 16u)]);
+  uint v = ((16u * uint(pointer_indices[0u])) / 16u);
+  return asfloat(S[v]);
 }
 
 [numthreads(1, 1, 1)]
 void main() {
-  uint v[1] = (uint[1])0;
-  float4 r = func(v);
+  uint v_1[1] = (uint[1])0;
+  float4 r = func(v_1);
 }
 
diff --git a/test/tint/ptr_ref/store/local/i32.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_ref/store/local/i32.wgsl.expected.ir.dxc.hlsl
index 080e0b2..20b825e 100644
--- a/test/tint/ptr_ref/store/local/i32.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_ref/store/local/i32.wgsl.expected.ir.dxc.hlsl
@@ -2,8 +2,7 @@
 [numthreads(1, 1, 1)]
 void main() {
   int i = int(123);
-  int p = i;
-  p = int(123);
-  p = int(123);
+  i = int(123);
+  i = int(123);
 }
 
diff --git a/test/tint/ptr_sugar/array.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/array.wgsl.expected.ir.dxc.hlsl
index d9fbb8c..69bd634 100644
--- a/test/tint/ptr_sugar/array.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/array.wgsl.expected.ir.dxc.hlsl
@@ -1,48 +1,44 @@
 
 void deref_const() {
   int a[10] = (int[10])0;
-  int p[10] = a;
-  int b = p[int(0)];
-  p[int(0)] = int(42);
+  int b = a[int(0)];
+  a[int(0)] = int(42);
 }
 
 void no_deref_const() {
   int a[10] = (int[10])0;
-  int p[10] = a;
-  int b = p[int(0)];
-  p[int(0)] = int(42);
+  int b = a[int(0)];
+  a[int(0)] = int(42);
 }
 
 void deref_let() {
   int a[10] = (int[10])0;
-  int p[10] = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int b = a[i];
+  a[int(0)] = int(42);
 }
 
 void no_deref_let() {
   int a[10] = (int[10])0;
-  int p[10] = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int b = a[i];
+  a[int(0)] = int(42);
 }
 
 void deref_var() {
   int a[10] = (int[10])0;
-  int p[10] = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int v = i;
+  int b = a[v];
+  a[int(0)] = int(42);
 }
 
 void no_deref_var() {
   int a[10] = (int[10])0;
-  int p[10] = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int v_1 = i;
+  int b = a[v_1];
+  a[int(0)] = int(42);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_sugar/array.wgsl.expected.ir.fxc.hlsl b/test/tint/ptr_sugar/array.wgsl.expected.ir.fxc.hlsl
index 59e0faf..69bd634 100644
--- a/test/tint/ptr_sugar/array.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/ptr_sugar/array.wgsl.expected.ir.fxc.hlsl
@@ -28,14 +28,16 @@
 void deref_var() {
   int a[10] = (int[10])0;
   int i = int(0);
-  int b = a[i];
+  int v = i;
+  int b = a[v];
   a[int(0)] = int(42);
 }
 
 void no_deref_var() {
   int a[10] = (int[10])0;
   int i = int(0);
-  int b = a[i];
+  int v_1 = i;
+  int b = a[v_1];
   a[int(0)] = int(42);
 }
 
diff --git a/test/tint/ptr_sugar/builtin_struct.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/builtin_struct.wgsl.expected.ir.dxc.hlsl
index cbde557..6b92cdf 100644
--- a/test/tint/ptr_sugar/builtin_struct.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/builtin_struct.wgsl.expected.ir.dxc.hlsl
@@ -11,30 +11,26 @@
 
 void deref_modf() {
   modf_result_f32 a = {0.5f, 1.0f};
-  modf_result_f32 p = a;
-  float fract = p.fract;
-  float whole = p.whole;
+  float fract = a.fract;
+  float whole = a.whole;
 }
 
 void no_deref_modf() {
   modf_result_f32 a = {0.5f, 1.0f};
-  modf_result_f32 p = a;
-  float fract = p.fract;
-  float whole = p.whole;
+  float fract = a.fract;
+  float whole = a.whole;
 }
 
 void deref_frexp() {
   frexp_result_f32 a = {0.75f, int(1)};
-  frexp_result_f32 p = a;
-  float fract = p.fract;
-  int exp = p.exp;
+  float fract = a.fract;
+  int exp = a.exp;
 }
 
 void no_deref_frexp() {
   frexp_result_f32 a = {0.75f, int(1)};
-  frexp_result_f32 p = a;
-  float fract = p.fract;
-  int exp = p.exp;
+  float fract = a.fract;
+  int exp = a.exp;
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_sugar/compound_assign_index.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/compound_assign_index.wgsl.expected.ir.dxc.hlsl
index d694332..7577f65 100644
--- a/test/tint/ptr_sugar/compound_assign_index.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/compound_assign_index.wgsl.expected.ir.dxc.hlsl
@@ -1,26 +1,22 @@
 
 void deref() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  p[int(0)] = (p.x + int(42));
+  a[int(0)] = (a.x + int(42));
 }
 
 void no_deref() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  p[int(0)] = (p.x + int(42));
+  a[int(0)] = (a.x + int(42));
 }
 
 void deref_inc() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  p[int(0)] = (p.x + int(1));
+  a[int(0)] = (a.x + int(1));
 }
 
 void no_deref_inc() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  p[int(0)] = (p.x + int(1));
+  a[int(0)] = (a.x + int(1));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_sugar/compound_assign_member.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/compound_assign_member.wgsl.expected.ir.dxc.hlsl
index e34674c..3a99d9b 100644
--- a/test/tint/ptr_sugar/compound_assign_member.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/compound_assign_member.wgsl.expected.ir.dxc.hlsl
@@ -1,14 +1,12 @@
 
 void deref() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  p[0u] = (p.x + int(42));
+  a[0u] = (a.x + int(42));
 }
 
 void no_deref() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  p[0u] = (p.x + int(42));
+  a[0u] = (a.x + int(42));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_sugar/matrix.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/matrix.wgsl.expected.ir.dxc.hlsl
index 7f90e3e..fc5524e 100644
--- a/test/tint/ptr_sugar/matrix.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/matrix.wgsl.expected.ir.dxc.hlsl
@@ -1,16 +1,14 @@
 
 void deref() {
   float2x3 a = float2x3((0.0f).xxx, (0.0f).xxx);
-  float2x3 p = a;
-  float3 b = p[int(0)];
-  p[int(0)] = float3(1.0f, 2.0f, 3.0f);
+  float3 b = a[int(0)];
+  a[int(0)] = float3(1.0f, 2.0f, 3.0f);
 }
 
 void no_deref() {
   float2x3 a = float2x3((0.0f).xxx, (0.0f).xxx);
-  float2x3 p = a;
-  float3 b = p[int(0)];
-  p[int(0)] = float3(1.0f, 2.0f, 3.0f);
+  float3 b = a[int(0)];
+  a[int(0)] = float3(1.0f, 2.0f, 3.0f);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_sugar/struct.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/struct.wgsl.expected.ir.dxc.hlsl
index fc4bea1..e62c4a5 100644
--- a/test/tint/ptr_sugar/struct.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/struct.wgsl.expected.ir.dxc.hlsl
@@ -5,16 +5,14 @@
 
 void deref() {
   S a = (S)0;
-  S p = a;
-  int b = p.x;
-  p.x = int(42);
+  int b = a.x;
+  a.x = int(42);
 }
 
 void no_deref() {
   S a = (S)0;
-  S p = a;
-  int b = p.x;
-  p.x = int(42);
+  int b = a.x;
+  a.x = int(42);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_sugar/vector_index.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/vector_index.wgsl.expected.ir.dxc.hlsl
index c7299e0..1eaa143 100644
--- a/test/tint/ptr_sugar/vector_index.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/vector_index.wgsl.expected.ir.dxc.hlsl
@@ -1,48 +1,42 @@
 
 void deref_const() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  int b = p.x;
-  p[int(0)] = int(42);
+  int b = a.x;
+  a[int(0)] = int(42);
 }
 
 void no_deref_const() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  int b = p.x;
-  p[int(0)] = int(42);
+  int b = a.x;
+  a[int(0)] = int(42);
 }
 
 void deref_let() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int b = a[i];
+  a[int(0)] = int(42);
 }
 
 void no_deref_let() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int b = a[i];
+  a[int(0)] = int(42);
 }
 
 void deref_var() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int b = a[i];
+  a[int(0)] = int(42);
 }
 
 void no_deref_var() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
   int i = int(0);
-  int b = p[i];
-  p[int(0)] = int(42);
+  int b = a[i];
+  a[int(0)] = int(42);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/ptr_sugar/vector_member.wgsl.expected.ir.dxc.hlsl b/test/tint/ptr_sugar/vector_member.wgsl.expected.ir.dxc.hlsl
index 9438c9e..637284e 100644
--- a/test/tint/ptr_sugar/vector_member.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/ptr_sugar/vector_member.wgsl.expected.ir.dxc.hlsl
@@ -1,16 +1,14 @@
 
 void deref() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  int b = p.x;
-  p[0u] = int(42);
+  int b = a.x;
+  a[0u] = int(42);
 }
 
 void no_deref() {
   int3 a = (int(0)).xxx;
-  int3 p = a;
-  int b = p.x;
-  p[0u] = int(42);
+  int b = a.x;
+  a[0u] = int(42);
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.dxc.hlsl
index 04b0429..16f1fd2 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_body.wgsl.expected.ir.dxc.hlsl
@@ -21,8 +21,9 @@
       } else {
         break;
       }
-      InnerS v_1 = v;
-      s1.a1[uniforms[0u].x] = v_1;
+      uint v_1 = uniforms[0u].x;
+      InnerS v_2 = v;
+      s1.a1[v_1] = v_2;
       {
         i = (i + int(1));
       }
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.dxc.hlsl
index f2e8647..1b8aefc 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_continuing.wgsl.expected.ir.dxc.hlsl
@@ -23,8 +23,9 @@
       }
       i = (i + int(1));
       {
-        InnerS v_1 = v;
-        s1.a1[uniforms[0u].x] = v_1;
+        uint v_1 = uniforms[0u].x;
+        InnerS v_2 = v;
+        s1.a1[v_1] = v_2;
       }
       continue;
     }
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.dxc.hlsl
index 22ae59f..4e2f45c 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/in_for_loop_init.wgsl.expected.ir.dxc.hlsl
@@ -16,8 +16,9 @@
   OuterS s1 = (OuterS)0;
   int i = int(0);
   {
-    InnerS v_1 = v;
-    s1.a1[uniforms[0u].x] = v_1;
+    uint v_1 = uniforms[0u].x;
+    InnerS v_2 = v;
+    s1.a1[v_1] = v_2;
     while(true) {
       if ((i < int(4))) {
       } else {
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.dxc.hlsl
index 11c9231..52ff861 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/indexing_with_side_effect_func.wgsl.expected.ir.dxc.hlsl
@@ -25,7 +25,8 @@
   InnerS v = (InnerS)0;
   OuterS s = (OuterS)0;
   uint v_1 = getNextIndex();
-  InnerS v_2 = v;
-  s.a1[v_1].a2[uniforms[0u].y] = v_2;
+  uint v_2 = uniforms[0u].y;
+  InnerS v_3 = v;
+  s.a1[v_1].a2[v_2] = v_3;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.dxc.hlsl
index 07174a1..29a037b 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array.wgsl.expected.ir.dxc.hlsl
@@ -14,7 +14,8 @@
 void main() {
   InnerS v = (InnerS)0;
   OuterS s1 = (OuterS)0;
-  InnerS v_1 = v;
-  s1.a1[uniforms[0u].x] = v_1;
+  uint v_1 = uniforms[0u].x;
+  InnerS v_2 = v;
+  s1.a1[v_1] = v_2;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.dxc.hlsl
index f4d3670..c608a6d 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_array.wgsl.expected.ir.dxc.hlsl
@@ -14,7 +14,9 @@
 void main() {
   InnerS v = (InnerS)0;
   OuterS s1 = (OuterS)0;
-  InnerS v_1 = v;
-  s1.a1[uniforms[0u].x][uniforms[0u].y] = v_1;
+  uint v_1 = uniforms[0u].x;
+  uint v_2 = uniforms[0u].y;
+  InnerS v_3 = v;
+  s1.a1[v_1][v_2] = v_3;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.dxc.hlsl
index e51ac33..af87bd1 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct.wgsl.expected.ir.dxc.hlsl
@@ -18,7 +18,8 @@
 void main() {
   InnerS v = (InnerS)0;
   OuterS s1 = (OuterS)0;
-  InnerS v_1 = v;
-  s1.a1[uniforms[0u].x].s2 = v_1;
+  uint v_1 = uniforms[0u].x;
+  InnerS v_2 = v;
+  s1.a1[v_1].s2 = v_2;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.dxc.hlsl
index 1461abb..91951da 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_array_struct_array.wgsl.expected.ir.dxc.hlsl
@@ -18,7 +18,9 @@
 void main() {
   InnerS v = (InnerS)0;
   OuterS s = (OuterS)0;
-  InnerS v_1 = v;
-  s.a1[uniforms[0u].x].a2[uniforms[0u].y] = v_1;
+  uint v_1 = uniforms[0u].x;
+  uint v_2 = uniforms[0u].y;
+  InnerS v_3 = v;
+  s.a1[v_1].a2[v_2] = v_3;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.dxc.hlsl
index 953df93..4b04a28 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_matrix.wgsl.expected.ir.dxc.hlsl
@@ -9,7 +9,9 @@
 [numthreads(1, 1, 1)]
 void main() {
   OuterS s1 = (OuterS)0;
-  s1.m1[uniforms[0u].x] = (1.0f).xxxx;
-  s1.m1[uniforms[0u].x][uniforms[0u].x] = 1.0f;
+  uint v = uniforms[0u].x;
+  s1.m1[v] = (1.0f).xxxx;
+  uint v_1 = uniforms[0u].x;
+  s1.m1[v_1][uniforms[0u].x] = 1.0f;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.dxc.hlsl
index ec3f8b2..c480ddd 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_multiple_arrays.wgsl.expected.ir.dxc.hlsl
@@ -15,9 +15,11 @@
 void main() {
   InnerS v = (InnerS)0;
   OuterS s1 = (OuterS)0;
-  InnerS v_1 = v;
-  s1.a1[uniforms[0u].x] = v_1;
+  uint v_1 = uniforms[0u].x;
   InnerS v_2 = v;
-  s1.a2[uniforms[0u].x] = v_2;
+  s1.a1[v_1] = v_2;
+  uint v_3 = uniforms[0u].x;
+  InnerS v_4 = v;
+  s1.a2[v_3] = v_4;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.dxc.hlsl
index c57629c..dd6563d 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_struct_array.wgsl.expected.ir.dxc.hlsl
@@ -18,7 +18,8 @@
 void main() {
   InnerS v = (InnerS)0;
   OuterS s1 = (OuterS)0;
-  InnerS v_1 = v;
-  s1.s2.a[uniforms[0u].x] = v_1;
+  uint v_1 = uniforms[0u].x;
+  InnerS v_2 = v;
+  s1.s2.a[v_1] = v_2;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.dxc.hlsl
index 9341da6..c380d42 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.dxc.hlsl
@@ -14,7 +14,9 @@
 void main() {
   OuterS s1 = (OuterS)0;
   float3 v = (0.0f).xxx;
-  v[s1.a1[uniforms[0u].x]] = 1.0f;
-  v[f(s1.a1[uniforms[0u].x])] = 1.0f;
+  uint v_1 = uniforms[0u].x;
+  v[s1.a1[v_1]] = 1.0f;
+  uint v_2 = uniforms[0u].x;
+  v[f(s1.a1[v_2])] = 1.0f;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.fxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.fxc.hlsl
index 9341da6..c380d42 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/vector_assign.wgsl.expected.ir.fxc.hlsl
@@ -14,7 +14,9 @@
 void main() {
   OuterS s1 = (OuterS)0;
   float3 v = (0.0f).xxx;
-  v[s1.a1[uniforms[0u].x]] = 1.0f;
-  v[f(s1.a1[uniforms[0u].x])] = 1.0f;
+  uint v_1 = uniforms[0u].x;
+  v[s1.a1[v_1]] = 1.0f;
+  uint v_2 = uniforms[0u].x;
+  v[f(s1.a1[v_2])] = 1.0f;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.dxc.hlsl
index aa66407..29a037b 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer.wgsl.expected.ir.dxc.hlsl
@@ -14,8 +14,8 @@
 void main() {
   InnerS v = (InnerS)0;
   OuterS s1 = (OuterS)0;
-  InnerS p = s1.a1[uniforms[0u].x];
-  InnerS v_1 = v;
-  p = v_1;
+  uint v_1 = uniforms[0u].x;
+  InnerS v_2 = v;
+  s1.a1[v_1] = v_2;
 }
 
diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.dxc.hlsl
index ce150e6..e988a2d 100644
--- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/via_pointer_arg.wgsl.expected.ir.dxc.hlsl
@@ -12,8 +12,9 @@
 };
 void f(inout OuterS p) {
   InnerS v = (InnerS)0;
-  InnerS v_1 = v;
-  p.a1[uniforms[0u].x] = v_1;
+  uint v_1 = uniforms[0u].x;
+  InnerS v_2 = v;
+  p.a1[v_1] = v_2;
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.dxc.hlsl
index f2db107..b99a5f0 100644
--- a/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.dxc.hlsl
@@ -16,10 +16,9 @@
 
 void main() {
   S x = (S)0;
-  S p = x;
-  int4 v = p.a[foo()];
+  int v = foo();
   int v_1 = bar();
-  v[v_1] = (v[v_1] + int(5));
+  x.a[v][v_1] = (x.a[v][v_1] + int(5));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.fxc.hlsl b/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.fxc.hlsl
index 162a84f..b99a5f0 100644
--- a/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/statements/compound_assign/complex_lhs.wgsl.expected.ir.fxc.hlsl
@@ -16,9 +16,9 @@
 
 void main() {
   S x = (S)0;
-  int4 v = x.a[foo()];
+  int v = foo();
   int v_1 = bar();
-  v[v_1] = (v[v_1] + int(5));
+  x.a[v][v_1] = (x.a[v][v_1] + int(5));
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.dxc.hlsl b/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.dxc.hlsl
index a997992..070b80d 100644
--- a/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.dxc.hlsl
@@ -19,16 +19,17 @@
 void foo() {
   float a[4] = (float[4])0;
   {
-    float v_1 = a[idx1()];
-    v_1 = (v_1 * 2.0f);
+    int v_1 = idx1();
+    a[v_1] = (a[v_1] * 2.0f);
     while(true) {
-      if ((a[idx2()] < 10.0f)) {
+      int v_2 = idx2();
+      if ((a[v_2] < 10.0f)) {
       } else {
         break;
       }
       {
-        float v_2 = a[idx3()];
-        v_2 = (v_2 + 1.0f);
+        int v_3 = idx3();
+        a[v_3] = (a[v_3] + 1.0f);
       }
       continue;
     }
diff --git a/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.fxc.hlsl b/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.fxc.hlsl
index a997992..070b80d 100644
--- a/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/statements/compound_assign/for_loop.wgsl.expected.ir.fxc.hlsl
@@ -19,16 +19,17 @@
 void foo() {
   float a[4] = (float[4])0;
   {
-    float v_1 = a[idx1()];
-    v_1 = (v_1 * 2.0f);
+    int v_1 = idx1();
+    a[v_1] = (a[v_1] * 2.0f);
     while(true) {
-      if ((a[idx2()] < 10.0f)) {
+      int v_2 = idx2();
+      if ((a[v_2] < 10.0f)) {
       } else {
         break;
       }
       {
-        float v_2 = a[idx3()];
-        v_2 = (v_2 + 1.0f);
+        int v_3 = idx3();
+        a[v_3] = (a[v_3] + 1.0f);
       }
       continue;
     }
diff --git a/test/tint/types/function_scope_declarations.wgsl.expected.ir.dxc.hlsl b/test/tint/types/function_scope_declarations.wgsl.expected.ir.dxc.hlsl
index 2a8263d..3c4a8c9 100644
--- a/test/tint/types/function_scope_declarations.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/types/function_scope_declarations.wgsl.expected.ir.dxc.hlsl
@@ -25,8 +25,5 @@
   float arr_let[4] = (float[4])0;
   S struct_var = (S)0;
   S struct_let = (S)0;
-  float ptr_f32 = f32_var;
-  float4 ptr_vec = v4f32_var;
-  float ptr_arr[4] = arr_var;
 }
 
diff --git a/test/tint/types/module_scope_vars_pointers.wgsl.expected.ir.dxc.hlsl b/test/tint/types/module_scope_vars_pointers.wgsl.expected.ir.dxc.hlsl
index 74ad4fb..eb76f21 100644
--- a/test/tint/types/module_scope_vars_pointers.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/types/module_scope_vars_pointers.wgsl.expected.ir.dxc.hlsl
@@ -10,10 +10,8 @@
     w = 0.0f;
   }
   GroupMemoryBarrierWithGroupSync();
-  float p_ptr = p;
-  float w_ptr = w;
-  float x = (p_ptr + w_ptr);
-  p_ptr = x;
+  float x = (p + w);
+  p = x;
 }
 
 [numthreads(1, 1, 1)]
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.ir.dxc.hlsl b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.ir.dxc.hlsl
index 41b6467..f8336f8 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.ir.dxc.hlsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.ir.dxc.hlsl
@@ -14,22 +14,22 @@
 };
 static float4 x_GLF_color = (0.0f).xxxx;
 void main_1() {
-  int idx = 0;
+  int idx = int(0);
   float4x3 m43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
-  int ll_1 = 0;
-  int GLF_live6rows = 0;
-  int z = 0;
-  int ll_2 = 0;
-  int ctr = 0;
+  int ll_1 = int(0);
+  int GLF_live6rows = int(0);
+  int z = int(0);
+  int ll_2 = int(0);
+  int ctr = int(0);
   float4x3 tempm43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
-  int ll_3 = 0;
-  int c = 0;
-  int d = 0;
+  int ll_3 = int(0);
+  int c = int(0);
+  int d = int(0);
   float GLF_live6sums[9] = (float[9])0;
-  idx = 0;
+  idx = int(0);
   m43 = float4x3(float3(1.0f, 0.0f, 0.0f), float3(0.0f, 1.0f, 0.0f), float3(0.0f, 0.0f, 1.0f), (0.0f).xxx);
-  ll_1 = 0;
-  GLF_live6rows = 2;
+  ll_1 = int(0);
+  GLF_live6rows = int(2);
   {
     while(true) {
       int v = ll_1;
@@ -37,13 +37,13 @@
         x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
         break;
       }
-      ll_1 = (ll_1 + 1);
+      ll_1 = (ll_1 + int(1));
       z = asint(x_9[0u].x);
-      ll_2 = 0;
-      ctr = 0;
+      ll_2 = int(0);
+      ctr = int(0);
       {
         while(true) {
-          if ((ctr < 1)) {
+          if ((ctr < int(1))) {
           } else {
             break;
           }
@@ -51,40 +51,42 @@
           if ((v_1 >= asint(x_9[0u].x))) {
             break;
           }
-          ll_2 = (ll_2 + 1);
+          ll_2 = (ll_2 + int(1));
           tempm43 = m43;
-          ll_3 = 0;
-          c = 0;
+          ll_3 = int(0);
+          c = int(0);
           {
             while(true) {
-              if ((1 < z)) {
+              if ((int(1) < z)) {
               } else {
                 break;
               }
-              d = 0;
+              d = int(0);
               int x_29 = c;
               int x_30 = c;
               int x_31 = c;
               int x_32 = d;
               int x_33 = d;
               int x_34 = d;
-              float3 v_2 = tempm43[((((x_29 >= 0) & (x_30 < 4))) ? (x_31) : (0))];
-              v_2[((((x_32 >= 0) & (x_33 < 3))) ? (x_34) : (0))] = 1.0f;
+              int v_2 = ((((x_29 >= int(0)) & (x_30 < int(4)))) ? (x_31) : (int(0)));
+              tempm43[v_2][((((x_32 >= int(0)) & (x_33 < int(3)))) ? (x_34) : (int(0)))] = 1.0f;
               {
-                c = (c + 1);
+                c = (c + int(1));
               }
               continue;
             }
           }
-          int x_117 = ((((idx >= 0) & (idx < 9))) ? (idx) : (0));
-          GLF_live6sums[x_117] = (GLF_live6sums[x_117] + m43[ctr].y);
+          int x_117 = ((((idx >= int(0)) & (idx < int(9)))) ? (idx) : (int(0)));
+          float v_3 = GLF_live6sums[x_117];
+          int v_4 = ctr;
+          GLF_live6sums[x_117] = (v_3 + m43[v_4].y);
           {
-            ctr = (ctr + 1);
+            ctr = (ctr + int(1));
           }
           continue;
         }
       }
-      idx = (idx + 1);
+      idx = (idx + int(1));
       {
       }
       continue;
@@ -94,19 +96,19 @@
 
 main_out main_inner() {
   main_1();
-  main_out v_3 = {x_GLF_color};
-  return v_3;
+  main_out v_5 = {x_GLF_color};
+  return v_5;
 }
 
 main_outputs main() {
-  main_out v_4 = main_inner();
-  main_outputs v_5 = {v_4.x_GLF_color_1};
-  return v_5;
+  main_out v_6 = main_inner();
+  main_outputs v_7 = {v_6.x_GLF_color_1};
+  return v_7;
 }
 
 DXC validation failure:
 error: validation errors
-hlsl.hlsl:99: error: Loop must have break.
+hlsl.hlsl:101: error: Loop must have break.
 Validation failed.
 
 
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.ir.fxc.hlsl b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.ir.fxc.hlsl
new file mode 100644
index 0000000..da28904
--- /dev/null
+++ b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.spvasm.expected.ir.fxc.hlsl
@@ -0,0 +1,115 @@
+SKIP: FAILED
+
+struct main_out {
+  float4 x_GLF_color_1;
+};
+
+struct main_outputs {
+  float4 main_out_x_GLF_color_1 : SV_Target0;
+};
+
+
+cbuffer cbuffer_x_9 : register(b0) {
+  uint4 x_9[1];
+};
+static float4 x_GLF_color = (0.0f).xxxx;
+void main_1() {
+  int idx = int(0);
+  float4x3 m43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
+  int ll_1 = int(0);
+  int GLF_live6rows = int(0);
+  int z = int(0);
+  int ll_2 = int(0);
+  int ctr = int(0);
+  float4x3 tempm43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
+  int ll_3 = int(0);
+  int c = int(0);
+  int d = int(0);
+  float GLF_live6sums[9] = (float[9])0;
+  idx = int(0);
+  m43 = float4x3(float3(1.0f, 0.0f, 0.0f), float3(0.0f, 1.0f, 0.0f), float3(0.0f, 0.0f, 1.0f), (0.0f).xxx);
+  ll_1 = int(0);
+  GLF_live6rows = int(2);
+  {
+    while(true) {
+      int v = ll_1;
+      if ((v >= asint(x_9[0u].x))) {
+        x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
+        break;
+      }
+      ll_1 = (ll_1 + int(1));
+      z = asint(x_9[0u].x);
+      ll_2 = int(0);
+      ctr = int(0);
+      {
+        while(true) {
+          if ((ctr < int(1))) {
+          } else {
+            break;
+          }
+          int v_1 = ll_2;
+          if ((v_1 >= asint(x_9[0u].x))) {
+            break;
+          }
+          ll_2 = (ll_2 + int(1));
+          tempm43 = m43;
+          ll_3 = int(0);
+          c = int(0);
+          {
+            while(true) {
+              if ((int(1) < z)) {
+              } else {
+                break;
+              }
+              d = int(0);
+              int x_29 = c;
+              int x_30 = c;
+              int x_31 = c;
+              int x_32 = d;
+              int x_33 = d;
+              int x_34 = d;
+              int v_2 = ((((x_29 >= int(0)) & (x_30 < int(4)))) ? (x_31) : (int(0)));
+              tempm43[v_2][((((x_32 >= int(0)) & (x_33 < int(3)))) ? (x_34) : (int(0)))] = 1.0f;
+              {
+                c = (c + int(1));
+              }
+              continue;
+            }
+          }
+          int x_117 = ((((idx >= int(0)) & (idx < int(9)))) ? (idx) : (int(0)));
+          float v_3 = GLF_live6sums[x_117];
+          int v_4 = ctr;
+          GLF_live6sums[x_117] = (v_3 + m43[v_4].y);
+          {
+            ctr = (ctr + int(1));
+          }
+          continue;
+        }
+      }
+      idx = (idx + int(1));
+      {
+      }
+      continue;
+    }
+  }
+}
+
+main_out main_inner() {
+  main_1();
+  main_out v_5 = {x_GLF_color};
+  return v_5;
+}
+
+main_outputs main() {
+  main_out v_6 = main_inner();
+  main_outputs v_7 = {v_6.x_GLF_color_1};
+  return v_7;
+}
+
+FXC validation failure:
+<scrubbed_path>(57,13-23): error X3511: forced to unroll loop, but unrolling failed.
+<scrubbed_path>(43,9-19): error X3511: forced to unroll loop, but unrolling failed.
+<scrubbed_path>(32,5-15): error X3511: forced to unroll loop, but unrolling failed.
+
+
+tint executable returned error: exit status 1
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.ir.dxc.hlsl b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.ir.dxc.hlsl
index a8d8977..59cf4c9 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.ir.dxc.hlsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.ir.dxc.hlsl
@@ -14,22 +14,22 @@
 };
 static float4 x_GLF_color = (0.0f).xxxx;
 void main_1() {
-  int idx = 0;
+  int idx = int(0);
   float4x3 m43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
-  int ll_1 = 0;
-  int GLF_live6rows = 0;
-  int z = 0;
-  int ll_2 = 0;
-  int ctr = 0;
+  int ll_1 = int(0);
+  int GLF_live6rows = int(0);
+  int z = int(0);
+  int ll_2 = int(0);
+  int ctr = int(0);
   float4x3 tempm43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
-  int ll_3 = 0;
-  int c = 0;
-  int d = 0;
+  int ll_3 = int(0);
+  int c = int(0);
+  int d = int(0);
   float GLF_live6sums[9] = (float[9])0;
-  idx = 0;
+  idx = int(0);
   m43 = float4x3(float3(1.0f, 0.0f, 0.0f), float3(0.0f, 1.0f, 0.0f), float3(0.0f, 0.0f, 1.0f), (0.0f).xxx);
-  ll_1 = 0;
-  GLF_live6rows = 2;
+  ll_1 = int(0);
+  GLF_live6rows = int(2);
   {
     while(true) {
       int x_18 = ll_1;
@@ -39,15 +39,15 @@
         break;
       }
       int x_20 = ll_1;
-      ll_1 = (x_20 + 1);
+      ll_1 = (x_20 + int(1));
       int x_22 = asint(x_9[0u].x);
       z = x_22;
-      ll_2 = 0;
-      ctr = 0;
+      ll_2 = int(0);
+      ctr = int(0);
       {
         while(true) {
           int x_23 = ctr;
-          if ((x_23 < 1)) {
+          if ((x_23 < int(1))) {
           } else {
             break;
           }
@@ -57,30 +57,30 @@
             break;
           }
           int x_26 = ll_2;
-          ll_2 = (x_26 + 1);
+          ll_2 = (x_26 + int(1));
           float4x3 x_98 = m43;
           tempm43 = x_98;
-          ll_3 = 0;
-          c = 0;
+          ll_3 = int(0);
+          c = int(0);
           {
             while(true) {
               int x_28 = z;
-              if ((1 < x_28)) {
+              if ((int(1) < x_28)) {
               } else {
                 break;
               }
-              d = 0;
+              d = int(0);
               int x_29 = c;
               int x_30 = c;
               int x_31 = c;
               int x_32 = d;
               int x_33 = d;
               int x_34 = d;
-              float3 v = tempm43[((((x_29 >= 0) & (x_30 < 4))) ? (x_31) : (0))];
-              v[((((x_32 >= 0) & (x_33 < 3))) ? (x_34) : (0))] = 1.0f;
+              int v = ((((x_29 >= int(0)) & (x_30 < int(4)))) ? (x_31) : (int(0)));
+              tempm43[v][((((x_32 >= int(0)) & (x_33 < int(3)))) ? (x_34) : (int(0)))] = 1.0f;
               {
                 int x_35 = c;
-                c = (x_35 + 1);
+                c = (x_35 + int(1));
               }
               continue;
             }
@@ -88,20 +88,20 @@
           int x_37 = idx;
           int x_38 = idx;
           int x_39 = idx;
-          int x_117 = ((((x_37 >= 0) & (x_38 < 9))) ? (x_39) : (0));
+          int x_117 = ((((x_37 >= int(0)) & (x_38 < int(9)))) ? (x_39) : (int(0)));
           int x_40 = ctr;
           float x_119 = m43[x_40].y;
           float x_121 = GLF_live6sums[x_117];
           GLF_live6sums[x_117] = (x_121 + x_119);
           {
             int x_41 = ctr;
-            ctr = (x_41 + 1);
+            ctr = (x_41 + int(1));
           }
           continue;
         }
       }
       int x_43 = idx;
-      idx = (x_43 + 1);
+      idx = (x_43 + int(1));
       {
       }
       continue;
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.ir.fxc.hlsl b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.ir.fxc.hlsl
new file mode 100644
index 0000000..034fa8d
--- /dev/null
+++ b/test/tint/vk-gl-cts/graphicsfuzz/write-before-break/0-opt.wgsl.expected.ir.fxc.hlsl
@@ -0,0 +1,130 @@
+SKIP: FAILED
+
+struct main_out {
+  float4 x_GLF_color_1;
+};
+
+struct main_outputs {
+  float4 main_out_x_GLF_color_1 : SV_Target0;
+};
+
+
+cbuffer cbuffer_x_9 : register(b0) {
+  uint4 x_9[1];
+};
+static float4 x_GLF_color = (0.0f).xxxx;
+void main_1() {
+  int idx = int(0);
+  float4x3 m43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
+  int ll_1 = int(0);
+  int GLF_live6rows = int(0);
+  int z = int(0);
+  int ll_2 = int(0);
+  int ctr = int(0);
+  float4x3 tempm43 = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx);
+  int ll_3 = int(0);
+  int c = int(0);
+  int d = int(0);
+  float GLF_live6sums[9] = (float[9])0;
+  idx = int(0);
+  m43 = float4x3(float3(1.0f, 0.0f, 0.0f), float3(0.0f, 1.0f, 0.0f), float3(0.0f, 0.0f, 1.0f), (0.0f).xxx);
+  ll_1 = int(0);
+  GLF_live6rows = int(2);
+  {
+    while(true) {
+      int x_18 = ll_1;
+      int x_19 = asint(x_9[0u].x);
+      if ((x_18 >= x_19)) {
+        x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
+        break;
+      }
+      int x_20 = ll_1;
+      ll_1 = (x_20 + int(1));
+      int x_22 = asint(x_9[0u].x);
+      z = x_22;
+      ll_2 = int(0);
+      ctr = int(0);
+      {
+        while(true) {
+          int x_23 = ctr;
+          if ((x_23 < int(1))) {
+          } else {
+            break;
+          }
+          int x_24 = ll_2;
+          int x_25 = asint(x_9[0u].x);
+          if ((x_24 >= x_25)) {
+            break;
+          }
+          int x_26 = ll_2;
+          ll_2 = (x_26 + int(1));
+          float4x3 x_98 = m43;
+          tempm43 = x_98;
+          ll_3 = int(0);
+          c = int(0);
+          {
+            while(true) {
+              int x_28 = z;
+              if ((int(1) < x_28)) {
+              } else {
+                break;
+              }
+              d = int(0);
+              int x_29 = c;
+              int x_30 = c;
+              int x_31 = c;
+              int x_32 = d;
+              int x_33 = d;
+              int x_34 = d;
+              int v = ((((x_29 >= int(0)) & (x_30 < int(4)))) ? (x_31) : (int(0)));
+              tempm43[v][((((x_32 >= int(0)) & (x_33 < int(3)))) ? (x_34) : (int(0)))] = 1.0f;
+              {
+                int x_35 = c;
+                c = (x_35 + int(1));
+              }
+              continue;
+            }
+          }
+          int x_37 = idx;
+          int x_38 = idx;
+          int x_39 = idx;
+          int x_117 = ((((x_37 >= int(0)) & (x_38 < int(9)))) ? (x_39) : (int(0)));
+          int x_40 = ctr;
+          float x_119 = m43[x_40].y;
+          float x_121 = GLF_live6sums[x_117];
+          GLF_live6sums[x_117] = (x_121 + x_119);
+          {
+            int x_41 = ctr;
+            ctr = (x_41 + int(1));
+          }
+          continue;
+        }
+      }
+      int x_43 = idx;
+      idx = (x_43 + int(1));
+      {
+      }
+      continue;
+    }
+  }
+}
+
+main_out main_inner() {
+  main_1();
+  main_out v_1 = {x_GLF_color};
+  return v_1;
+}
+
+main_outputs main() {
+  main_out v_2 = main_inner();
+  main_outputs v_3 = {v_2.x_GLF_color_1};
+  return v_3;
+}
+
+FXC validation failure:
+<scrubbed_path>(64,13-23): error X3511: forced to unroll loop, but unrolling failed.
+<scrubbed_path>(46,9-19): error X3511: forced to unroll loop, but unrolling failed.
+<scrubbed_path>(32,5-15): error X3511: forced to unroll loop, but unrolling failed.
+
+
+tint executable returned error: exit status 1